@@ -6,4 +6,9 @@ BACKEND_SERVER_URI =http://127.0.0.1:14005 | |||||
//live | //live | ||||
API_URL=http://172.16.1.8:14009 | API_URL=http://172.16.1.8:14009 | ||||
API_GRAPHQL_URI=http://172.16.1.8:14009/graphql | API_GRAPHQL_URI=http://172.16.1.8:14009/graphql | ||||
BACKEND_SERVER_URI=http://172.16.1.8:14009 | |||||
BACKEND_SERVER_URI=http://172.16.1.8:14009 | |||||
//strapi live server | |||||
API_URL=https://strapisite.thamrin.xyz | |||||
API_GRAPHQL_URI=https://strapisite.thamrin.xyz/graphql | |||||
BACKEND_SERVER_URI =https://strapisite.thamrin.xyz |
@@ -0,0 +1,52 @@ | |||||
import apollo from "../../lib/apollo.js"; | |||||
async function GetDealers(token="", start = 0) { | |||||
var res = await apollo.query( | |||||
` | |||||
query($start: Int!) { | |||||
dealers(limit:6,start:$start) | |||||
{ | |||||
name | |||||
kota_dealer | |||||
address | |||||
telp | |||||
location | |||||
} | |||||
} | |||||
`, | |||||
token, | |||||
{ | |||||
start: start, | |||||
} | |||||
); | |||||
return res; | |||||
} | |||||
async function GetDealersDetails(token="") { | |||||
var res = await apollo.query( | |||||
` | |||||
query($input: ID!) { | |||||
dealers(where:{id:$input}) | |||||
{ | |||||
name | |||||
kota_dealer | |||||
address | |||||
telp | |||||
location | |||||
} | |||||
} | |||||
`, | |||||
token, | |||||
{ | |||||
"input": id | |||||
} | |||||
); | |||||
return res; | |||||
} | |||||
module.exports = { | |||||
GetDealers: GetDealers, | |||||
GetDealersDetails: GetDealersDetails, | |||||
}; |
@@ -36,45 +36,40 @@ export default function Footer(props) { | |||||
</ListItem> */} | </ListItem> */} | ||||
<ListItem className={classes.inlineBlock}> | <ListItem className={classes.inlineBlock}> | ||||
<a | <a | ||||
href="https://www.creative-tim.com/?ref=njsmk-footer" | |||||
href="/home" | |||||
className={classes.block} | className={classes.block} | ||||
target="_blank" | |||||
> | > | ||||
Home | Home | ||||
</a> | </a> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.inlineBlock}> | <ListItem className={classes.inlineBlock}> | ||||
<a | <a | ||||
href="https://www.creative-tim.com/presentation?ref=njsmk-footer" | |||||
href="/product/product" | |||||
className={classes.block} | className={classes.block} | ||||
target="_blank" | |||||
> | > | ||||
Product | Product | ||||
</a> | </a> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.inlineBlock}> | <ListItem className={classes.inlineBlock}> | ||||
<a | <a | ||||
href="http://blog.creative-tim.com/?ref=njsmk-footer" | |||||
href="/latestsnews" | |||||
className={classes.block} | className={classes.block} | ||||
target="_blank" | |||||
> | > | ||||
Latest News | Latest News | ||||
</a> | </a> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.inlineBlock}> | <ListItem className={classes.inlineBlock}> | ||||
<a | <a | ||||
href="https://www.creative-tim.com/license?ref=njsmk-footer" | |||||
href="/carrer" | |||||
className={classes.block} | className={classes.block} | ||||
target="_blank" | |||||
> | > | ||||
Carrer | Carrer | ||||
</a> | </a> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.inlineBlock}> | <ListItem className={classes.inlineBlock}> | ||||
<a | <a | ||||
href="https://www.creative-tim.com/license?ref=njsmk-footer" | |||||
href="/about_us/aboutus" | |||||
className={classes.block} | className={classes.block} | ||||
target="_blank" | |||||
> | > | ||||
About Us | About Us | ||||
</a> | </a> | ||||
@@ -72,6 +72,13 @@ export default function HeaderLinks(props) { | |||||
/> | /> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.listItem}> | <ListItem className={classes.listItem}> | ||||
<Link href="/dealers"> | |||||
<Button color="transparent" className={classes.navLink}> | |||||
<Icon className={classes.icons}>event</Icon> Dealers | |||||
</Button> | |||||
</Link> | |||||
</ListItem> | |||||
<ListItem className={classes.listItem}> | |||||
<Link href="/latestnews"> | <Link href="/latestnews"> | ||||
<Button color="transparent" className={classes.navLink}> | <Button color="transparent" className={classes.navLink}> | ||||
<Icon className={classes.icons}>event</Icon> Latest News | <Icon className={classes.icons}>event</Icon> Latest News | ||||
@@ -141,7 +148,7 @@ export default function HeaderLinks(props) { | |||||
<Chart className={classes.icons} /> | <Chart className={classes.icons} /> | ||||
</Button> | </Button> | ||||
</ListItem> | </ListItem> | ||||
<ListItem className={classes.listItem}> | |||||
{/* <ListItem className={classes.listItem}> | |||||
<Button | <Button | ||||
href="/login" | href="/login" | ||||
className={classes.registerNavLink} | className={classes.registerNavLink} | ||||
@@ -150,7 +157,7 @@ export default function HeaderLinks(props) { | |||||
> | > | ||||
<Icon className={classes.icons}>input</Icon> Login | <Icon className={classes.icons}>input</Icon> Login | ||||
</Button> | </Button> | ||||
</ListItem> | |||||
</ListItem> */} | |||||
</List> | </List> | ||||
); | ); | ||||
} | } |
@@ -0,0 +1,56 @@ | |||||
import React from "react"; | |||||
import { makeStyles } from "@material-ui/core/styles"; | |||||
import GridContainer from "components/Grid/GridContainer.js"; | |||||
import Grid from '@material-ui/core/Grid'; | |||||
import Card from "components/Card/Card.js"; | |||||
import CardBody from "components/Card/CardBody.js"; | |||||
import CardHeader from "components/Card/CardHeader.js"; | |||||
import Quote from "components/Typography/Quote.js" | |||||
import Icon from "@material-ui/core/Icon"; | |||||
import Button from "components/CustomButtons/Button.js"; | |||||
import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; | |||||
const useStyles = makeStyles(styles); | |||||
const DataDealer = function ({ backend, dealers, ...props }) { | |||||
const classes = useStyles(); | |||||
const Dealers = dealers.map((data) => { | |||||
return ( | |||||
<Grid style={{width:"400px", padding:"30px"}}> | |||||
<Card> | |||||
<CardHeader color="danger"><div align="center">{data.name}</div></CardHeader> | |||||
<CardBody> | |||||
<Quote | |||||
text={data.kota_dealer} | |||||
author={data.address} | |||||
/> | |||||
<Quote | |||||
text={data.telp} | |||||
author={data.email} | |||||
/> | |||||
<div align="center"> | |||||
<Button color="danger" round href={data.location} target="_blank"> | |||||
<Icon className={classes.icons}>room</Icon>View Location | |||||
</Button> | |||||
</div> | |||||
</CardBody> | |||||
</Card> | |||||
</Grid> | |||||
); | |||||
}) | |||||
return ( | |||||
<div className={classes.section} id="notifications"> | |||||
<div align="center"> | |||||
<h2>Dealers & Service</h2> | |||||
</div> | |||||
<div> | |||||
<GridContainer justify="center"> | |||||
{Dealers} | |||||
</GridContainer> | |||||
</div> | |||||
</div> | |||||
); | |||||
} | |||||
export default DataDealer; |
@@ -217,7 +217,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
color="primary" | color="primary" | ||||
tabs={[ | tabs={[ | ||||
{ | { | ||||
tabButton: "Yamaha", | |||||
tabButton: "Maxi Yamaha", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -226,7 +226,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Suzuki", | |||||
tabButton: "Matic", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -235,7 +235,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Honda", | |||||
tabButton: "Naked Bike", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -244,7 +244,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Hino", | |||||
tabButton: "Sport", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -253,7 +253,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Mercedes Benz", | |||||
tabButton: "Off Road", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -262,7 +262,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "BPR Berkat Sejati", | |||||
tabButton: "Moped", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -271,7 +271,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Emilia Hotel", | |||||
tabButton: "Monster Energy MotoGP", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -280,7 +280,25 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes, | |||||
), | ), | ||||
}, | }, | ||||
{ | { | ||||
tabButton: "Thamrin Homes", | |||||
tabButton: "CBU", | |||||
tabIcon: Dashboard, | |||||
tabContent: ( | |||||
<GridContainer justify="center"> | |||||
{Producthomes} | |||||
</GridContainer> | |||||
), | |||||
}, | |||||
{ | |||||
tabButton: "ATV", | |||||
tabIcon: Dashboard, | |||||
tabContent: ( | |||||
<GridContainer justify="center"> | |||||
{Producthomes} | |||||
</GridContainer> | |||||
), | |||||
}, | |||||
{ | |||||
tabButton: "Power Product", | |||||
tabIcon: Dashboard, | tabIcon: Dashboard, | ||||
tabContent: ( | tabContent: ( | ||||
<GridContainer justify="center"> | <GridContainer justify="center"> | ||||
@@ -68,17 +68,17 @@ const DetailDataYamalube = function ({ backend, detailyamalube, ...props }) { | |||||
</ul> | </ul> | ||||
</Grid> | </Grid> | ||||
</GridContainer> | </GridContainer> | ||||
{/* <GridContainer> | |||||
<Grid className={classes.marginAuto} style={{padding:"10px", marginTop:"-30px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img_relate1["url"]}`} height="165px" width="200px"/> | |||||
<GridContainer> | |||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
<Grid className={classes.marginAuto} style={{padding:"10px", marginTop:"-30px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img_relate2["url"]}`} height="165px" width="200px"/> | |||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
<Grid className={classes.marginAuto} style={{padding:"10px", marginTop:"-30px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img_relate3["url"]}`} height="165px" width="200px"/> | |||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
</GridContainer> */} | |||||
</GridContainer> | |||||
<div align="center"> | <div align="center"> | ||||
<hr></hr> | <hr></hr> | ||||
<h2>Deskripsi</h2> | <h2>Deskripsi</h2> | ||||
@@ -58,13 +58,13 @@ const DetailDataYGP = function ({ backend, detailygp, ...props }) { | |||||
</GridContainer> | </GridContainer> | ||||
<GridContainer> | <GridContainer> | ||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | <Grid className={classes.marginAuto} style={{padding:"11px"}}> | ||||
<img className={navImageClasses} src={`${backend}${data.img_relate1["url"]}`} height="165px" width="200px"/> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | <Grid className={classes.marginAuto} style={{padding:"11px"}}> | ||||
<img className={navImageClasses} src={`${backend}${data.img_relate2["url"]}`} height="165px" width="200px"/> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
<Grid className={classes.marginAuto} style={{padding:"11px"}}> | <Grid className={classes.marginAuto} style={{padding:"11px"}}> | ||||
<img className={navImageClasses} src={`${backend}${data.img_relate3["url"]}`} height="165px" width="200px"/> | |||||
<img className={navImageClasses} src={`${backend}${data.img["url"]}`} height="165px" width="200px"/> | |||||
</Grid> | </Grid> | ||||
</GridContainer> | </GridContainer> | ||||
<div align="center"> | <div align="center"> | ||||
@@ -0,0 +1,55 @@ | |||||
import React from "react"; | |||||
import classNames from "classnames"; | |||||
import { makeStyles } from "@material-ui/core/styles"; | |||||
import Header from "components/Header/Header.js"; | |||||
import HeaderLinks from "components/Header/HeaderLinks.js"; | |||||
import Parallax from "components/Parallax/Parallax.js"; | |||||
import styles from "assets/jss/nextjs-material-kit/pages/components.js"; | |||||
import Footer from "components/Footer/Footer.js"; | |||||
import Getdealer from "../api/dealer/dealer.js"; | |||||
import DataSnackbarContent from "../pages-sections/snackbar.js"; | |||||
import DataDealers from "../pages-sections/dealers/dealers.js"; | |||||
const useStyles = makeStyles(styles); | |||||
const Dealers = function ({ backend, dealers, ...props }) { | |||||
const classes = useStyles(); | |||||
const { ...rest } = props; | |||||
return ( | |||||
<div> | |||||
<Header | |||||
rightLinks={<HeaderLinks/>} | |||||
fixed | |||||
color="info" | |||||
changeColorOnScroll={{ | |||||
height: 400, | |||||
color: "white", | |||||
}} | |||||
{...rest} | |||||
/> | |||||
<Parallax image={require("assets/img/dealers.png")}styles={{ marginTop: "50px" }}/> | |||||
<div className={classNames(classes.main, classes.mainRaised)}> | |||||
<DataSnackbarContent /> | |||||
<DataDealers dealers={dealers} backend={backend} /> | |||||
</div> | |||||
<Footer /> | |||||
</div> | |||||
); | |||||
}; | |||||
export async function getServerSideProps(context) { | |||||
var dealers = []; | |||||
const backend = process.env.BACKEND_SERVER_URI; | |||||
var res = await Getdealer.GetDealers(); | |||||
if (res["STATUS"] === 1) { | |||||
dealers = res["DATA"]["dealers"]; | |||||
} | |||||
return { | |||||
props: { dealers, backend }, // will be passed to the page component as props | |||||
}; | |||||
} | |||||
export default Dealers; |
@@ -31,7 +31,7 @@ const Home = function ({ | |||||
return ( | return ( | ||||
<div> | <div> | ||||
<Header | <Header | ||||
rightLinks={<HeaderLinks />} | |||||
rightLinks={<HeaderLinks/>} | |||||
fixed | fixed | ||||
color="info" | color="info" | ||||
changeColorOnScroll={{ | changeColorOnScroll={{ | ||||
@@ -40,7 +40,7 @@ const Home = function ({ | |||||
}} | }} | ||||
{...rest} | {...rest} | ||||
/> | /> | ||||
<Parallax image={require("assets/img/welcome.png")}styles={{ marginTop: "50px" }}/> | |||||
<Parallax image={require("assets/img/Promotion_2-1.jpg")}styles={{ marginTop: "50px" }}/> | |||||
<div className={classNames(classes.main, classes.mainRaised)}> | <div className={classNames(classes.main, classes.mainRaised)}> | ||||
<DataSnackbarContent /> | <DataSnackbarContent /> | ||||
<CoreValue /> | <CoreValue /> | ||||