diff --git a/assets/img/feature/1.jpg b/assets/img/feature/1.jpg new file mode 100644 index 0000000..4a2a483 Binary files /dev/null and b/assets/img/feature/1.jpg differ diff --git a/assets/img/feature/2.jpg b/assets/img/feature/2.jpg new file mode 100644 index 0000000..5a73141 Binary files /dev/null and b/assets/img/feature/2.jpg differ diff --git a/assets/img/feature/3.jpg b/assets/img/feature/3.jpg new file mode 100644 index 0000000..ac0d9f0 Binary files /dev/null and b/assets/img/feature/3.jpg differ diff --git a/assets/img/feature/4.jpg b/assets/img/feature/4.jpg new file mode 100644 index 0000000..e2e8121 Binary files /dev/null and b/assets/img/feature/4.jpg differ diff --git a/assets/img/feature/5.jpg b/assets/img/feature/5.jpg new file mode 100644 index 0000000..506437f Binary files /dev/null and b/assets/img/feature/5.jpg differ diff --git a/assets/img/feature/6.jpg b/assets/img/feature/6.jpg new file mode 100644 index 0000000..d78fa81 Binary files /dev/null and b/assets/img/feature/6.jpg differ diff --git a/pages-sections/hino/carrer/carrer.js b/pages-sections/hino/carrer/carrer.js index 2451ee8..26d6681 100644 --- a/pages-sections/hino/carrer/carrer.js +++ b/pages-sections/hino/carrer/carrer.js @@ -38,7 +38,7 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { author="Post By Thamrin Group" /> Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - @@ -57,7 +57,7 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { author="Post By Thamrin Group" /> Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - @@ -76,7 +76,7 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { author="Post By Thamrin Group" /> Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - diff --git a/pages-sections/hino/home/feature.js b/pages-sections/hino/home/feature.js index 897d3df..9f37d17 100644 --- a/pages-sections/hino/home/feature.js +++ b/pages-sections/hino/home/feature.js @@ -11,6 +11,13 @@ import SnackbarContent from "components/Snackbar/SnackbarContent.js"; import imagesStyles from "assets/jss/nextjs-material-kit/imagesStyles.js"; import { cardTitle } from "assets/jss/nextjs-material-kit.js"; +import Motor from "assets/img/feature/1.jpg"; +import YGP from "assets/img/feature/2.jpg"; +import Yamalube from "assets/img/feature/3.jpg"; +import Apparel from "assets/img/feature/4.jpg"; +import Helmet from "assets/img/feature/5.jpg"; +import Accessories from "assets/img/feature/6.jpg"; + const styles = { ...imagesStyles, cardTitle, @@ -27,88 +34,56 @@ const DataFeature = function ({ backend, service, ...props }) {

Feature Product

} align="center" - color="danger" + color="info" /> - - - - Card-img - {/*
-
- -
-
*/} + + + +
+ +
- - - Card-img - {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
diff --git a/pages-sections/hino/home/service.js b/pages-sections/hino/home/service.js index e9a4d25..3644f74 100644 --- a/pages-sections/hino/home/service.js +++ b/pages-sections/hino/home/service.js @@ -12,7 +12,7 @@ const useStyles = makeStyles(styles); const DataService = function ({ backend, service, ...props }) { const classes = useStyles(); const services = service.map((data, index) => ( - +
- )); - return ( + )); + return (
@@ -30,7 +30,7 @@ const DataService = function ({ backend, service, ...props }) {

Our Service

} align="center" - color="danger" + color="info" />
diff --git a/pages-sections/hino/product/product.js b/pages-sections/hino/product/product.js index 20904ea..34e2340 100644 --- a/pages-sections/hino/product/product.js +++ b/pages-sections/hino/product/product.js @@ -39,7 +39,7 @@ const DataProduct = function ({ backend, car, ...props }) {
Rp.{data.price}
@@ -72,8 +72,8 @@ const DataProduct = function ({ backend, car, ...props }) { color="primary" tabs={[ { - tabButton: "XL7", - tabIcon: Motorcycle, + tabButton: "Profia", + tabIcon: Dashboard, tabContent: ( {ProductSuzuki} diff --git a/pages-sections/hino/product/product_details.js b/pages-sections/hino/product/product_details.js new file mode 100644 index 0000000..ed3e946 --- /dev/null +++ b/pages-sections/hino/product/product_details.js @@ -0,0 +1,145 @@ +import React, { useState, useEffect } from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import ReactHtmlParser from "react-html-parser"; +import Dashboard from "@material-ui/icons/Dashboard"; +import Icon from "@material-ui/core/Icon"; + +import GridContainer from "components/Grid/GridContainer.js"; +import Grid from '@material-ui/core/Grid'; +import GridItem from "components/Grid/GridItem.js"; +import NavPills from "components/NavPills/NavPills.js"; +import Card from "components/Card/Card.js"; +import CardBody from "components/Card/CardBody.js"; +import CardHeader from "components/Card/CardHeader.js"; +import CardFooter from "components/Card/CardFooter.js"; +import Button from "components/CustomButtons/Button.js"; +import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js"; +import Carousel from "react-slick"; + +const useStyles = makeStyles(styles); + +const DataProduct = function ({ backend, detailproduct, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + const imageClasses = classNames( + classes.imgRaised, + classes.imgRoundedCircle, + classes.imgFluid + ); + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + time: 5 + }; + const navImageClasses = classNames(classes.imgRounded, classes.imgGallery); + const Productdetails = detailproduct.map((data) => { + return ( +
+ + +
+
+
+ + + + + First slide + + + {/* */} + + +
+
+
+
+ +

{data.name}

+

Rp.{data.price} - Stock Unit : {data.stock}

+
+
+

{ReactHtmlParser(data.description)}

+
+
+
+ + + + + +
+ {ReactHtmlParser(data.overview)} +
+
+
+
+ ), + }, + { + tabButton: "Specification", + tabIcon: Dashboard, + tabContent: ( + + +
+ {ReactHtmlParser(data.specification)} +
+
+
+ ), + }, + { + tabButton: "Film", + tabIcon: Dashboard, + tabContent: ( + + +
+ {ReactHtmlParser(data.film)} +
+
+
+ ), + }, + ]} + /> + +
+
+ ); + }) + return ( + +
+ Product Detail +
+ +
+ {Productdetails} +
+
+ + © 2020 , All Right Reserved by @Thamrin Brother Company + +
+ ); +} + +export default DataProduct; \ No newline at end of file diff --git a/pages-sections/honda/carrer/carrer.js b/pages-sections/honda/carrer/carrer.js index d9966df..a08df49 100644 --- a/pages-sections/honda/carrer/carrer.js +++ b/pages-sections/honda/carrer/carrer.js @@ -31,14 +31,14 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { return ( -
{data.name}
+
{data.name}
Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - @@ -50,14 +50,14 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { return ( - {data.name} + {data.name} Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - @@ -69,14 +69,14 @@ const DataCarrers = function ({ backend, s1, d3, sma, ...props }) { return ( - {data.name} + {data.name} Masa Pendaftaran : {data.start_regis} s/d {data.until_regis} - diff --git a/pages-sections/honda/home/feature.js b/pages-sections/honda/home/feature.js index 1868d5f..9f37d17 100644 --- a/pages-sections/honda/home/feature.js +++ b/pages-sections/honda/home/feature.js @@ -11,6 +11,13 @@ import SnackbarContent from "components/Snackbar/SnackbarContent.js"; import imagesStyles from "assets/jss/nextjs-material-kit/imagesStyles.js"; import { cardTitle } from "assets/jss/nextjs-material-kit.js"; +import Motor from "assets/img/feature/1.jpg"; +import YGP from "assets/img/feature/2.jpg"; +import Yamalube from "assets/img/feature/3.jpg"; +import Apparel from "assets/img/feature/4.jpg"; +import Helmet from "assets/img/feature/5.jpg"; +import Accessories from "assets/img/feature/6.jpg"; + const styles = { ...imagesStyles, cardTitle, @@ -30,85 +37,53 @@ const DataFeature = function ({ backend, service, ...props }) { color="info" />
- - - - Card-img - {/*
-
- -
-
*/} + + + +
+ +
- - - Card-img - {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
diff --git a/pages-sections/honda/home/service.js b/pages-sections/honda/home/service.js index caac9d7..ecf5034 100644 --- a/pages-sections/honda/home/service.js +++ b/pages-sections/honda/home/service.js @@ -12,7 +12,7 @@ const useStyles = makeStyles(styles); const DataService = function ({ backend, service, ...props }) { const classes = useStyles(); const services = service.map((data, index) => ( - +
Rp.{data.price} @@ -72,8 +71,8 @@ const DataProduct = function ({ backend, car, ...props }) { color="primary" tabs={[ { - tabButton: "XL7", - tabIcon: Motorcycle, + tabButton: "Brio", + tabIcon: Dashboard, tabContent: ( {ProductSuzuki} diff --git a/pages-sections/honda/product/product_details.js b/pages-sections/honda/product/product_details.js new file mode 100644 index 0000000..ed3e946 --- /dev/null +++ b/pages-sections/honda/product/product_details.js @@ -0,0 +1,145 @@ +import React, { useState, useEffect } from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import ReactHtmlParser from "react-html-parser"; +import Dashboard from "@material-ui/icons/Dashboard"; +import Icon from "@material-ui/core/Icon"; + +import GridContainer from "components/Grid/GridContainer.js"; +import Grid from '@material-ui/core/Grid'; +import GridItem from "components/Grid/GridItem.js"; +import NavPills from "components/NavPills/NavPills.js"; +import Card from "components/Card/Card.js"; +import CardBody from "components/Card/CardBody.js"; +import CardHeader from "components/Card/CardHeader.js"; +import CardFooter from "components/Card/CardFooter.js"; +import Button from "components/CustomButtons/Button.js"; +import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js"; +import Carousel from "react-slick"; + +const useStyles = makeStyles(styles); + +const DataProduct = function ({ backend, detailproduct, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + const imageClasses = classNames( + classes.imgRaised, + classes.imgRoundedCircle, + classes.imgFluid + ); + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + time: 5 + }; + const navImageClasses = classNames(classes.imgRounded, classes.imgGallery); + const Productdetails = detailproduct.map((data) => { + return ( +
+ + +
+
+
+ + + + + First slide + + + {/* */} + + +
+
+
+
+ +

{data.name}

+

Rp.{data.price} - Stock Unit : {data.stock}

+
+
+

{ReactHtmlParser(data.description)}

+
+
+
+ + + + + +
+ {ReactHtmlParser(data.overview)} +
+
+
+
+ ), + }, + { + tabButton: "Specification", + tabIcon: Dashboard, + tabContent: ( + + +
+ {ReactHtmlParser(data.specification)} +
+
+
+ ), + }, + { + tabButton: "Film", + tabIcon: Dashboard, + tabContent: ( + + +
+ {ReactHtmlParser(data.film)} +
+
+
+ ), + }, + ]} + /> + +
+
+ ); + }) + return ( + +
+ Product Detail +
+ +
+ {Productdetails} +
+
+ + © 2020 , All Right Reserved by @Thamrin Brother Company + +
+ ); +} + +export default DataProduct; \ No newline at end of file diff --git a/pages-sections/suzuki/home/feature.js b/pages-sections/suzuki/home/feature.js index 1868d5f..9f37d17 100644 --- a/pages-sections/suzuki/home/feature.js +++ b/pages-sections/suzuki/home/feature.js @@ -11,6 +11,13 @@ import SnackbarContent from "components/Snackbar/SnackbarContent.js"; import imagesStyles from "assets/jss/nextjs-material-kit/imagesStyles.js"; import { cardTitle } from "assets/jss/nextjs-material-kit.js"; +import Motor from "assets/img/feature/1.jpg"; +import YGP from "assets/img/feature/2.jpg"; +import Yamalube from "assets/img/feature/3.jpg"; +import Apparel from "assets/img/feature/4.jpg"; +import Helmet from "assets/img/feature/5.jpg"; +import Accessories from "assets/img/feature/6.jpg"; + const styles = { ...imagesStyles, cardTitle, @@ -30,85 +37,53 @@ const DataFeature = function ({ backend, service, ...props }) { color="info" /> - - - - Card-img - {/*
-
- -
-
*/} + + + +
+ +
- - - Card-img - {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
diff --git a/pages-sections/suzuki/home/service.js b/pages-sections/suzuki/home/service.js index 8c8e2ba..581e544 100644 --- a/pages-sections/suzuki/home/service.js +++ b/pages-sections/suzuki/home/service.js @@ -12,7 +12,7 @@ const useStyles = makeStyles(styles); const DataService = function ({ backend, service, ...props }) { const classes = useStyles(); const services = service.map((data, index) => ( - +
- - - - Card-img - {/*
-
- -
-
*/} + + + +
+ +
- - - Card-img - {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
- - -
- Card-img -
- {/*
-
- -
-
*/} + + +
+ +
diff --git a/pages/hino/carrer/carrer.js b/pages/hino/carrer/carrer.js index bf88b88..8007565 100644 --- a/pages/hino/carrer/carrer.js +++ b/pages/hino/carrer/carrer.js @@ -55,7 +55,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/hino/carrer/carrer_details.js b/pages/hino/carrer/carrer_details.js index 92258b4..9d3568e 100644 --- a/pages/hino/carrer/carrer_details.js +++ b/pages/hino/carrer/carrer_details.js @@ -53,7 +53,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" ); }); if (sessionId.length != 0) user = userObj["username"]; @@ -64,8 +64,6 @@ export async function getServerSideProps(context) { detailcarrer = res["DATA"]["carrers"]; } - console.log(res); - return { props: { user, detailcarrer, backend }, // will be passed to the page component as props }; diff --git a/pages/hino/home.js b/pages/hino/home.js index 7fd834f..e2343d0 100644 --- a/pages/hino/home.js +++ b/pages/hino/home.js @@ -78,7 +78,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/hino/product/product.js b/pages/hino/product/product.js index a9ddd2d..1198949 100644 --- a/pages/hino/product/product.js +++ b/pages/hino/product/product.js @@ -5,7 +5,7 @@ import { makeStyles } from "@material-ui/core/styles"; import Header from "components/Header/Header.js"; import HeaderHino from "components/Header/HeaderHino.js"; import FooterHino from "components/Footer/FooterHino.js"; -import DataProduct from "pages-sections/honda/product/product.js"; +import DataProduct from "pages-sections/hino/product/product.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; @@ -61,7 +61,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "SUZUKI" + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/hino/product/product_details.js b/pages/hino/product/product_details.js new file mode 100644 index 0000000..4a57768 --- /dev/null +++ b/pages/hino/product/product_details.js @@ -0,0 +1,70 @@ +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/HeaderHino.js"; +import Footer from "components/Footer/FooterHino.js"; +import ProductDetail from "pages-sections/hino/product/product_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailproduct from "api/product/product.js" +import Cookies from "cookies"; + +const useStyles = makeStyles(styles); + +const ProductDetails = function ({ backend, detailproduct, user, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default ProductDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailproduct = []; + const backend = process.env.BACKEND_SERVER_URI; + + var { req, resp } = context; + const cookies = new Cookies(req, resp); + var user = ""; + var userObj = (await cookies.get("user")) + ? JSON.parse(await cookies.get("user")) + : null; + if (userObj) { + let sessionId = userObj["partners_login_states"].filter(function (i) { + return ( + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" + ); + }); + if (sessionId.length != 0) user = userObj["username"]; + } + + var res = await GetDetailproduct.GetDetailProduct(query.s||0); + if (res["STATUS"] === 1) { + detailproduct = res["DATA"]["products"]; + } + + return { + props: { detailproduct, backend, user }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/hino/profile/edit-profile.js b/pages/hino/profile/edit-profile.js deleted file mode 100644 index e69de29..0000000 diff --git a/pages/hino/profile/profile.js b/pages/hino/profile/profile.js index f389239..575d8a0 100644 --- a/pages/hino/profile/profile.js +++ b/pages/hino/profile/profile.js @@ -55,7 +55,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HINO" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/hino/register.js b/pages/hino/register.js deleted file mode 100644 index e69de29..0000000 diff --git a/pages/honda/carrer/carrer.js b/pages/honda/carrer/carrer.js index 0e0e5ba..269c397 100644 --- a/pages/honda/carrer/carrer.js +++ b/pages/honda/carrer/carrer.js @@ -55,7 +55,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/honda/carrer/carrer_details.js b/pages/honda/carrer/carrer_details.js index 6982f06..a9d4153 100644 --- a/pages/honda/carrer/carrer_details.js +++ b/pages/honda/carrer/carrer_details.js @@ -53,7 +53,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" ); }); if (sessionId.length != 0) user = userObj["username"]; @@ -64,8 +64,6 @@ export async function getServerSideProps(context) { detailcarrer = res["DATA"]["carrers"]; } - console.log(res); - return { props: { user, detailcarrer, backend }, // will be passed to the page component as props }; diff --git a/pages/honda/home.js b/pages/honda/home.js index fd29c3b..8188856 100644 --- a/pages/honda/home.js +++ b/pages/honda/home.js @@ -78,7 +78,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/honda/product/product.js b/pages/honda/product/product.js index b3fe780..7d535e8 100644 --- a/pages/honda/product/product.js +++ b/pages/honda/product/product.js @@ -61,7 +61,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "SUZUKI" + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/honda/product/product_details.js b/pages/honda/product/product_details.js new file mode 100644 index 0000000..110fdff --- /dev/null +++ b/pages/honda/product/product_details.js @@ -0,0 +1,70 @@ +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/HeaderHonda.js"; +import Footer from "components/Footer/FooterHonda.js"; +import ProductDetail from "pages-sections/honda/product/product_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailproduct from "api/product/product.js" +import Cookies from "cookies"; + +const useStyles = makeStyles(styles); + +const ProductDetails = function ({ backend, detailproduct, user, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+ ); +} + +export default ProductDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailproduct = []; + const backend = process.env.BACKEND_SERVER_URI; + + var { req, resp } = context; + const cookies = new Cookies(req, resp); + var user = ""; + var userObj = (await cookies.get("user")) + ? JSON.parse(await cookies.get("user")) + : null; + if (userObj) { + let sessionId = userObj["partners_login_states"].filter(function (i) { + return ( + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" + ); + }); + if (sessionId.length != 0) user = userObj["username"]; + } + + var res = await GetDetailproduct.GetDetailProduct(query.s||0); + if (res["STATUS"] === 1) { + detailproduct = res["DATA"]["products"]; + } + + return { + props: { detailproduct, backend, user }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/honda/profile/edit-profile.js b/pages/honda/profile/edit-profile.js deleted file mode 100644 index e69de29..0000000 diff --git a/pages/honda/profile/profile.js b/pages/honda/profile/profile.js index dc273b7..926069a 100644 --- a/pages/honda/profile/profile.js +++ b/pages/honda/profile/profile.js @@ -55,7 +55,7 @@ export async function getServerSideProps(context) { if (userObj) { let sessionId = userObj["partners_login_states"].filter(function (i) { return ( - i.business_partner && i.business_partner.name.toUpperCase() == "YAMAHA" + i.business_partner && i.business_partner.name.toUpperCase() == "HONDA" ); }); if (sessionId.length != 0) user = userObj["username"]; diff --git a/pages/honda/register.js b/pages/honda/register.js deleted file mode 100644 index e69de29..0000000 diff --git a/pages/suzuki/checkout/checkout.js b/pages/suzuki/checkout/checkout.js deleted file mode 100644 index e69de29..0000000