diff --git a/components/Header/HeaderLinks.js b/components/Header/HeaderLinks.js index f798b68..de9e5dc 100644 --- a/components/Header/HeaderLinks.js +++ b/components/Header/HeaderLinks.js @@ -24,7 +24,7 @@ export default function HeaderLinks(props) { return ( - + @@ -50,42 +50,42 @@ export default function HeaderLinks(props) { }} buttonIcon={Apps} dropdownList={[ - + Motor , - + YGP , - + Yamalube , - + Helmet , - + Apparel , - + Accessories , Service , - + Dealers , ]} /> - + - @@ -135,7 +135,7 @@ export default function HeaderLinks(props) { @@ -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/carrer/carrer_details.js b/pages-sections/yamaha/carrer/carrer_details.js similarity index 100% rename from pages-sections/carrer/carrer_details.js rename to pages-sections/yamaha/carrer/carrer_details.js diff --git a/pages-sections/dealers/dealers.js b/pages-sections/yamaha/dealers/dealers.js similarity index 100% rename from pages-sections/dealers/dealers.js rename to pages-sections/yamaha/dealers/dealers.js diff --git a/pages-sections/home/business_partner.js b/pages-sections/yamaha/home/business_partner.js similarity index 100% rename from pages-sections/home/business_partner.js rename to pages-sections/yamaha/home/business_partner.js diff --git a/pages-sections/home/carousel.js b/pages-sections/yamaha/home/carousel.js similarity index 100% rename from pages-sections/home/carousel.js rename to pages-sections/yamaha/home/carousel.js diff --git a/pages-sections/home/core_value.js b/pages-sections/yamaha/home/core_value.js similarity index 100% rename from pages-sections/home/core_value.js rename to pages-sections/yamaha/home/core_value.js diff --git a/pages-sections/home/feature.js b/pages-sections/yamaha/home/feature.js similarity index 100% rename from pages-sections/home/feature.js rename to pages-sections/yamaha/home/feature.js diff --git a/pages-sections/home/service.js b/pages-sections/yamaha/home/service.js similarity index 100% rename from pages-sections/home/service.js rename to pages-sections/yamaha/home/service.js diff --git a/pages-sections/home/sosmed.js b/pages-sections/yamaha/home/sosmed.js similarity index 100% rename from pages-sections/home/sosmed.js rename to pages-sections/yamaha/home/sosmed.js diff --git a/pages-sections/latest_news/news.js b/pages-sections/yamaha/latest_news/news.js similarity index 95% rename from pages-sections/latest_news/news.js rename to pages-sections/yamaha/latest_news/news.js index 371b468..c043a48 100644 --- a/pages-sections/latest_news/news.js +++ b/pages-sections/yamaha/latest_news/news.js @@ -27,7 +27,7 @@ const DataLatestNews = function ({ backend, news, ...props }) {

{data.title}

{data.published_at}

-
diff --git a/pages-sections/latest_news/news_details.js b/pages-sections/yamaha/latest_news/news_details.js similarity index 100% rename from pages-sections/latest_news/news_details.js rename to pages-sections/yamaha/latest_news/news_details.js diff --git a/pages-sections/product/accessories.js b/pages-sections/yamaha/product/accessories.js similarity index 96% rename from pages-sections/product/accessories.js rename to pages-sections/yamaha/product/accessories.js index 4333028..e771bcc 100644 --- a/pages-sections/product/accessories.js +++ b/pages-sections/yamaha/product/accessories.js @@ -36,7 +36,7 @@ const DataAccessories = function ({ selected, handleName, backend, accessories,

Rp.{data.price}

diff --git a/pages-sections/product/accessories_details.js b/pages-sections/yamaha/product/accessories_details.js similarity index 100% rename from pages-sections/product/accessories_details.js rename to pages-sections/yamaha/product/accessories_details.js diff --git a/pages-sections/product/apparel.js b/pages-sections/yamaha/product/apparel.js similarity index 94% rename from pages-sections/product/apparel.js rename to pages-sections/yamaha/product/apparel.js index 53f4383..1d532aa 100644 --- a/pages-sections/product/apparel.js +++ b/pages-sections/yamaha/product/apparel.js @@ -39,7 +39,7 @@ const DataApparel = function ({ selected, handleName, backend, apparel, asia, ba
Rp.{data.price}
@@ -67,7 +67,7 @@ const DataApparel = function ({ selected, handleName, backend, apparel, asia, ba
Rp.{data.price}
@@ -82,7 +82,7 @@ const DataApparel = function ({ selected, handleName, backend, apparel, asia, ba
-
+ {/*

Yamaha Apparel

i.id==selected):null} getOptionLabel={option => `${option.name}`} getOptionValue={option => option.id} options={helmet} + options={mtx} + options={extreme} + options={ranger} + options={fighter} + options={swirl} + options={classic} + options={uno} isMulti instanceId="name" placeholder="Search" onChange={values => handleName(values)} />





-
-
+
*/} +
Rp.{data.price} @@ -63,7 +63,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -87,7 +87,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -111,7 +111,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -135,7 +135,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -159,7 +159,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -183,7 +183,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
@@ -207,7 +207,7 @@ const DataProduct = function ({ backend, maxi, matic, naked, sport, offroad, mop
Rp.{data.price}
diff --git a/pages-sections/product/product_details.js b/pages-sections/yamaha/product/product_details.js similarity index 100% rename from pages-sections/product/product_details.js rename to pages-sections/yamaha/product/product_details.js diff --git a/pages-sections/product/yamalube.js b/pages-sections/yamaha/product/yamalube.js similarity index 96% rename from pages-sections/product/yamalube.js rename to pages-sections/yamaha/product/yamalube.js index 465d8c1..ef27ca0 100644 --- a/pages-sections/product/yamalube.js +++ b/pages-sections/yamaha/product/yamalube.js @@ -35,7 +35,7 @@ const DataYamalube = function ({ selected, handleName, backend, yamalube, ...pro
Rp.{data.price}
diff --git a/pages-sections/product/yamalube_details.js b/pages-sections/yamaha/product/yamalube_details.js similarity index 100% rename from pages-sections/product/yamalube_details.js rename to pages-sections/yamaha/product/yamalube_details.js diff --git a/pages-sections/product/ygp.js b/pages-sections/yamaha/product/ygp.js similarity index 96% rename from pages-sections/product/ygp.js rename to pages-sections/yamaha/product/ygp.js index 06e3d31..b5e0450 100644 --- a/pages-sections/product/ygp.js +++ b/pages-sections/yamaha/product/ygp.js @@ -23,7 +23,7 @@ const DataYGP = function ({ selected,handleName, backend, ygp, ...props }) { ); const navImageClasses = classNames(classes.imgRounded, classes.imgGallery); const ProductYGP = ygp.map((data) => { - return ( + return (
@@ -35,7 +35,7 @@ const DataYGP = function ({ selected,handleName, backend, ygp, ...props }) {
Rp.{data.price}
diff --git a/pages-sections/product/ygp_details.js b/pages-sections/yamaha/product/ygp_details.js similarity index 100% rename from pages-sections/product/ygp_details.js rename to pages-sections/yamaha/product/ygp_details.js diff --git a/pages-sections/snackbar.js b/pages-sections/yamaha/snackbar.js similarity index 100% rename from pages-sections/snackbar.js rename to pages-sections/yamaha/snackbar.js diff --git a/pages/index.js b/pages/index.js index 0e48cc9..8231e6b 100644 --- a/pages/index.js +++ b/pages/index.js @@ -3,10 +3,10 @@ import Router from "next/router"; export default class Index extends Component { componentDidMount = () => { - Router.push("/home"); + Router.push("/yamaha/home"); }; render() { return
; } -} +} \ No newline at end of file diff --git a/pages/suzuki/_app.js b/pages/suzuki/_app.js new file mode 100644 index 0000000..5ebfe61 --- /dev/null +++ b/pages/suzuki/_app.js @@ -0,0 +1,48 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import App from "next/app"; +import Head from "next/head"; +import Router from "next/router"; +import PageChange from "components/PageChange/PageChange.js"; + +import "assets/scss/nextjs-material-kit.scss?v=1.1.0"; +// import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +Router.events.on("routeChangeStart", (url) => { + console.log(`Loading: ${url}`); + document.body.classList.add("body-page-transition"); + ReactDOM.render( + , + document.getElementById("page-transition") + ); +}); +Router.events.on("routeChangeComplete", () => { + ReactDOM.unmountComponentAtNode(document.getElementById("page-transition")); + document.body.classList.remove("body-page-transition"); +}); +Router.events.on("routeChangeError", () => { + ReactDOM.unmountComponentAtNode(document.getElementById("page-transition")); + document.body.classList.remove("body-page-transition"); +}); + +export default class MyApp extends App { + static async getInitialProps({ Component, router, ctx }) { + let pageProps = {}; + + if (Component.getInitialProps) { + pageProps = await Component.getInitialProps(ctx); + } + + return { pageProps }; + } + render() { + const { Component, pageProps } = this.props; + return ( + + + Thamrin Group + + + + ); + } +} diff --git a/pages/suzuki/_document.js b/pages/suzuki/_document.js new file mode 100644 index 0000000..4880d27 --- /dev/null +++ b/pages/suzuki/_document.js @@ -0,0 +1,89 @@ +import React from "react"; +import Document, { Head, Main, NextScript } from "next/document"; +import { ServerStyleSheets } from "@material-ui/styles"; + +class MyDocument extends Document { + render() { + return ( + + + + + + + + {/* Fonts and icons */} + + + + +
+
+ + + + ); + } +} + +MyDocument.getInitialProps = async ctx => { + // Resolution order + // + // On the server: + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. document.getInitialProps + // 4. app.render + // 5. page.render + // 6. document.render + // + // On the server with error: + // 1. document.getInitialProps + // 2. app.render + // 3. page.render + // 4. document.render + // + // On the client + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. app.render + // 4. page.render + + // Render app and page and get the context of the page with collected side effects. + const sheets = new ServerStyleSheets(); + const originalRenderPage = ctx.renderPage; + + ctx.renderPage = () => + originalRenderPage({ + enhanceApp: App => props => sheets.collect() + }); + + const initialProps = await Document.getInitialProps(ctx); + + return { + ...initialProps, + // Styles fragment is rendered after the app and page rendering finish. + styles: [ + + {initialProps.styles} + {sheets.getStyleElement()} + + ] + }; +}; + +export default MyDocument; diff --git a/pages/suzuki/_error.js b/pages/suzuki/_error.js new file mode 100644 index 0000000..47269ba --- /dev/null +++ b/pages/suzuki/_error.js @@ -0,0 +1,12 @@ +import React, { Component } from "react"; +import Router from "next/router"; + +export default class _error extends Component { + componentDidMount = () => { + Router.push("/home"); + }; + + render() { + return
; + } +} diff --git a/pages/abous_us/aboutus.js b/pages/suzuki/abous_us/aboutus.js similarity index 100% rename from pages/abous_us/aboutus.js rename to pages/suzuki/abous_us/aboutus.js diff --git a/pages/abous_us/penghargaan.js b/pages/suzuki/abous_us/penghargaan.js similarity index 100% rename from pages/abous_us/penghargaan.js rename to pages/suzuki/abous_us/penghargaan.js diff --git a/pages/abous_us/profile.js b/pages/suzuki/abous_us/profile.js similarity index 100% rename from pages/abous_us/profile.js rename to pages/suzuki/abous_us/profile.js diff --git a/pages/abous_us/saham.js b/pages/suzuki/abous_us/saham.js similarity index 100% rename from pages/abous_us/saham.js rename to pages/suzuki/abous_us/saham.js diff --git a/pages/abous_us/sejarah.js b/pages/suzuki/abous_us/sejarah.js similarity index 100% rename from pages/abous_us/sejarah.js rename to pages/suzuki/abous_us/sejarah.js diff --git a/pages/abous_us/struktur_organisasi.js b/pages/suzuki/abous_us/struktur_organisasi.js similarity index 100% rename from pages/abous_us/struktur_organisasi.js rename to pages/suzuki/abous_us/struktur_organisasi.js diff --git a/pages/abous_us/tata_kelola.js b/pages/suzuki/abous_us/tata_kelola.js similarity index 100% rename from pages/abous_us/tata_kelola.js rename to pages/suzuki/abous_us/tata_kelola.js diff --git a/pages/abous_us/tugas_fungsi.js b/pages/suzuki/abous_us/tugas_fungsi.js similarity index 100% rename from pages/abous_us/tugas_fungsi.js rename to pages/suzuki/abous_us/tugas_fungsi.js diff --git a/pages/suzuki/api/product/get.js b/pages/suzuki/api/product/get.js new file mode 100644 index 0000000..26306a7 --- /dev/null +++ b/pages/suzuki/api/product/get.js @@ -0,0 +1,27 @@ +import DetailProduct from "../../../api/product/product"; + +export default async function handler(req, res) { + console.log("masuk"); + if (req.method == "POST") { + var id = req.body.id; + var detailproduct = await DetailProduct.GetDetailProduct(id); + if (detailproduct["STATUS"] == 0) { + res.status(200).json(detailproduct); + } else if (detailproduct["DATA"]["products"] == null) { + res + .status(200) + .json({ + STATUS: 0, + DATA: "Product Tidak Ditemukan" + }); + } else { + res.status(200).json({ + STATUS: 1, + DATA: detailproduct["DATA"]["products"], + }); + } + } else { + console.log("masukas"); + res.status(200).send("NOT FOUND"); + } +} \ No newline at end of file diff --git a/pages/carrer.js b/pages/suzuki/carrer.js similarity index 100% rename from pages/carrer.js rename to pages/suzuki/carrer.js diff --git a/pages/carrer_details.js b/pages/suzuki/carrer_details.js similarity index 100% rename from pages/carrer_details.js rename to pages/suzuki/carrer_details.js diff --git a/pages/cart.js b/pages/suzuki/cart.js similarity index 100% rename from pages/cart.js rename to pages/suzuki/cart.js diff --git a/pages/dealers.js b/pages/suzuki/dealers.js similarity index 100% rename from pages/dealers.js rename to pages/suzuki/dealers.js diff --git a/pages/home.js b/pages/suzuki/home.js similarity index 100% rename from pages/home.js rename to pages/suzuki/home.js diff --git a/pages/suzuki/index.js b/pages/suzuki/index.js new file mode 100644 index 0000000..0e48cc9 --- /dev/null +++ b/pages/suzuki/index.js @@ -0,0 +1,12 @@ +import React, { Component } from "react"; +import Router from "next/router"; + +export default class Index extends Component { + componentDidMount = () => { + Router.push("/home"); + }; + + render() { + return
; + } +} diff --git a/pages/latestnews.js b/pages/suzuki/latestnews.js similarity index 100% rename from pages/latestnews.js rename to pages/suzuki/latestnews.js diff --git a/pages/latestnews_details.js b/pages/suzuki/latestnews_details.js similarity index 100% rename from pages/latestnews_details.js rename to pages/suzuki/latestnews_details.js diff --git a/pages/login.js b/pages/suzuki/login.js similarity index 100% rename from pages/login.js rename to pages/suzuki/login.js diff --git a/pages/product/accessories.js b/pages/suzuki/product/accessories.js similarity index 100% rename from pages/product/accessories.js rename to pages/suzuki/product/accessories.js diff --git a/pages/product/accessories_details.js b/pages/suzuki/product/accessories_details.js similarity index 100% rename from pages/product/accessories_details.js rename to pages/suzuki/product/accessories_details.js diff --git a/pages/product/apparel.js b/pages/suzuki/product/apparel.js similarity index 100% rename from pages/product/apparel.js rename to pages/suzuki/product/apparel.js diff --git a/pages/product/apparel_details.js b/pages/suzuki/product/apparel_details.js similarity index 100% rename from pages/product/apparel_details.js rename to pages/suzuki/product/apparel_details.js diff --git a/pages/product/helmet.js b/pages/suzuki/product/helmet.js similarity index 100% rename from pages/product/helmet.js rename to pages/suzuki/product/helmet.js diff --git a/pages/product/helmet_details.js b/pages/suzuki/product/helmet_details.js similarity index 100% rename from pages/product/helmet_details.js rename to pages/suzuki/product/helmet_details.js diff --git a/pages/product/product.js b/pages/suzuki/product/product.js similarity index 100% rename from pages/product/product.js rename to pages/suzuki/product/product.js diff --git a/pages/product/product_detail.js b/pages/suzuki/product/product_detail.js similarity index 100% rename from pages/product/product_detail.js rename to pages/suzuki/product/product_detail.js diff --git a/pages/product/yamalube.js b/pages/suzuki/product/yamalube.js similarity index 100% rename from pages/product/yamalube.js rename to pages/suzuki/product/yamalube.js diff --git a/pages/product/yamalube_details.js b/pages/suzuki/product/yamalube_details.js similarity index 100% rename from pages/product/yamalube_details.js rename to pages/suzuki/product/yamalube_details.js diff --git a/pages/product/ygp.js b/pages/suzuki/product/ygp.js similarity index 100% rename from pages/product/ygp.js rename to pages/suzuki/product/ygp.js diff --git a/pages/product/ygp_details.js b/pages/suzuki/product/ygp_details.js similarity index 100% rename from pages/product/ygp_details.js rename to pages/suzuki/product/ygp_details.js diff --git a/pages/yamaha/abous_us/aboutus.js b/pages/yamaha/abous_us/aboutus.js new file mode 100644 index 0000000..8c52206 --- /dev/null +++ b/pages/yamaha/abous_us/aboutus.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import AboutUs from "pages-sections/yamaha/about_us/about_us.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const AboutUS = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default AboutUS; diff --git a/pages/yamaha/abous_us/penghargaan.js b/pages/yamaha/abous_us/penghargaan.js new file mode 100644 index 0000000..e034bc9 --- /dev/null +++ b/pages/yamaha/abous_us/penghargaan.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Penghargaan from "pages-sections/yamaha/about_us/penghargaan.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const penghargaan = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default penghargaan; diff --git a/pages/yamaha/abous_us/profile.js b/pages/yamaha/abous_us/profile.js new file mode 100644 index 0000000..17ad9be --- /dev/null +++ b/pages/yamaha/abous_us/profile.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Profile from "pages-sections/yamaha/about_us/profile.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const profile = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default profile; diff --git a/pages/yamaha/abous_us/saham.js b/pages/yamaha/abous_us/saham.js new file mode 100644 index 0000000..8734d72 --- /dev/null +++ b/pages/yamaha/abous_us/saham.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Saham from "pages-sections/yamaha/about_us/saham.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const saham = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default saham; diff --git a/pages/yamaha/abous_us/sejarah.js b/pages/yamaha/abous_us/sejarah.js new file mode 100644 index 0000000..7fab4b3 --- /dev/null +++ b/pages/yamaha/abous_us/sejarah.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Sejarah from "pages-sections/yamaha/about_us/sejarah.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const sejarah = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default sejarah; diff --git a/pages/yamaha/abous_us/struktur_organisasi.js b/pages/yamaha/abous_us/struktur_organisasi.js new file mode 100644 index 0000000..26cf7c8 --- /dev/null +++ b/pages/yamaha/abous_us/struktur_organisasi.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import StrukturOrganisasi from "pages-sections/yamaha/about_us/struktur_organisasi.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const Strukturorganisasi = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default Strukturorganisasi; diff --git a/pages/yamaha/abous_us/tata_kelola.js b/pages/yamaha/abous_us/tata_kelola.js new file mode 100644 index 0000000..4818007 --- /dev/null +++ b/pages/yamaha/abous_us/tata_kelola.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import TataKelola from "pages-sections/yamaha/about_us/tata_kelola.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const Tatakelola = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default Tatakelola; diff --git a/pages/yamaha/abous_us/tugas_fungsi.js b/pages/yamaha/abous_us/tugas_fungsi.js new file mode 100644 index 0000000..96a1368 --- /dev/null +++ b/pages/yamaha/abous_us/tugas_fungsi.js @@ -0,0 +1,58 @@ +import React from "react"; +// nodejs library that concatenates classes +import classNames from "classnames"; +// react components for routing our app without refresh +import Link from "next/link"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +// @material-ui/icons +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import TugasFungsi from "pages-sections/yamaha/about_us/tugas_fungsi.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +const AboutUS = function ({ backend, businessPartners, service, carousel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + + {/*
+

NextJS Material Kit.

+

+ A Badass Material Kit based on Material-UI and NextJS. +

+
*/} +
+
+
+
+
+ +
+
+
+ ); +} + +export default AboutUS; diff --git a/pages/yamaha/carrer.js b/pages/yamaha/carrer.js new file mode 100644 index 0000000..9e45b8c --- /dev/null +++ b/pages/yamaha/carrer.js @@ -0,0 +1,66 @@ +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 Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import SectionCarrer from "pages-sections/yamaha/carrer/carrer.js"; +import Getcarrer from "../../api/carrer/carrer.js" + +const useStyles = makeStyles(styles); + +const Carrer = function ({ backend, s1, d3, sma, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default Carrer; + +export async function getServerSideProps(context) { + var s1 = []; + var d3 = []; + var sma = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await Getcarrer.GetCarrerS1(); + if (res["STATUS"] === 1) { + s1 = res["DATA"]["carrers"]; + } + + var res = await Getcarrer.GetCarrerD3(); + if (res["STATUS"] === 1) { + d3 = res["DATA"]["carrers"]; + } + + var res = await Getcarrer.GetCarrerSMA(); + if (res["STATUS"] === 1) { + sma = res["DATA"]["carrers"]; + } + + return { + props: { s1, d3, sma, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/carrer_details.js b/pages/yamaha/carrer_details.js new file mode 100644 index 0000000..d6b1a60 --- /dev/null +++ b/pages/yamaha/carrer_details.js @@ -0,0 +1,56 @@ +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 Footer from "components/Footer/Footer.js"; +import CarrerDetail from "pages-sections/yamaha/carrer/carrer_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailcarrer from "../../api/carrer/carrer.js" + +const useStyles = makeStyles(styles); + +const CarrerDetails = function ({ backend, detailcarrer, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default CarrerDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailcarrer = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailcarrer.GetDetailCarrer(query.s||0); + if (res["STATUS"] === 1) { + detailcarrer = res["DATA"]["carrers"]; + } + + console.log(res); + + return { + props: { detailcarrer, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/cart.js b/pages/yamaha/cart.js new file mode 100644 index 0000000..1b9514d --- /dev/null +++ b/pages/yamaha/cart.js @@ -0,0 +1,36 @@ +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 Footer from "components/Footer/Footer.js"; +// import SectionChart from "pages-sections/cart/SectionChart.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "../assets/jss/nextjs-material-kit/pages/components.js"; + +const useStyles = makeStyles(styles); + +export default function Components(props) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ {/* */} +
+
+
+ ); +} diff --git a/pages/yamaha/dealers.js b/pages/yamaha/dealers.js new file mode 100644 index 0000000..b8b88e3 --- /dev/null +++ b/pages/yamaha/dealers.js @@ -0,0 +1,74 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import Router from 'next/router' + +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/yamaha/snackbar.js"; +import DataDealers from "../../pages-sections/yamaha/dealers/dealers.js"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +const queryClient = new QueryClient() +const handleName = values => { + Router.push({ + pathname: 'yamaha/dealers', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} + +const useStyles = makeStyles(styles); +const Dealers = function ({ selected, backend, dealers, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default Dealers; + +export async function getServerSideProps(context) { + var dealers = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await Getdealer.GetDealers(filter); + if (res["STATUS"] === 1) { + dealers = res["DATA"]["dealers"]; + if (filter !=""){ + selected = dealers.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, dealers, backend, }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/home.js b/pages/yamaha/home.js new file mode 100644 index 0000000..1cf396a --- /dev/null +++ b/pages/yamaha/home.js @@ -0,0 +1,87 @@ +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 GetbusinessPartners from "../../api/home/businessPartner.js"; +import Getservices from "../../api/home/service.js"; +import Getcarousels from "../../api/home/carousel.js"; +import DataSnackbarContent from "../../pages-sections/yamaha/snackbar.js"; +import DataCarousel from "../../pages-sections/yamaha/home/carousel.js"; +import DataService from "../../pages-sections/yamaha/home/service.js"; +import DataBusinessPartner from "../../pages-sections/yamaha/home/business_partner.js"; +import DataSosmed from "../../pages-sections/yamaha/home/sosmed.js"; +import CoreValue from "../../pages-sections/yamaha/home/core_value.js"; +import DataFeature from "../../pages-sections/yamaha/home/feature.js"; + +const useStyles = makeStyles(styles); +const Home = function ({ + backend, + businessPartners, + service, + carousel, + ...props +}) { + const classes = useStyles(); + const { ...rest } = props; + ; + + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + + + + +
+
+
+ ); +}; + +export async function getServerSideProps(context) { + var businessPartners = []; + var service = []; + var carousel = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetbusinessPartners.GetbusinessPartners(); + if (res["STATUS"] === 1) { + businessPartners = res["DATA"]["businessPartners"]; + } + + var res = await Getservices.Getservices(); + if (res["STATUS"] === 1) { + service = res["DATA"]["services"]; + } + + var res = await Getcarousels.GetCarousels(); + if (res["STATUS"] === 1) { + carousel = res["DATA"]["carousels"]; + } + + return { + props: { businessPartners, service, carousel, backend }, // will be passed to the page component as props + }; +} + +export default Home; diff --git a/pages/yamaha/latestnews.js b/pages/yamaha/latestnews.js new file mode 100644 index 0000000..cb29667 --- /dev/null +++ b/pages/yamaha/latestnews.js @@ -0,0 +1,56 @@ +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 Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetLatestNews from "../../api/latest_news/news.js" +import DataSnackbarContent from "../../pages-sections/yamaha/snackbar.js"; +import DataLatestNews from "../../pages-sections/yamaha/latest_news/news.js"; + +const useStyles = makeStyles(styles); + +const LatestNews = function ({ backend, news, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + +
+
+
+ ); +} + +export default LatestNews; + +export async function getServerSideProps(context) { + var news = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetLatestNews.GetNews(); + if (res["STATUS"] === 1) { + news = res["DATA"]["latestNews"]; + } + return { + props: { news, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/latestnews_details.js b/pages/yamaha/latestnews_details.js new file mode 100644 index 0000000..5b8e8b4 --- /dev/null +++ b/pages/yamaha/latestnews_details.js @@ -0,0 +1,63 @@ +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 Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetLatestNews from "../../api/latest_news/news.js" +import DataSnackbarContent from "../../pages-sections/yamaha/snackbar.js"; +import DetailLatestNews from "../../pages-sections/yamaha/latest_news/news_details.js"; + +const useStyles = makeStyles(styles); + +const detailLatestNews = function ({ backend, news, othernews, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ + +
+
+
+ ); +} + +export default detailLatestNews; + +export async function getServerSideProps(context) { + var {query} = context; + var news = []; + var othernews = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetLatestNews.GetDetailNews(query.s||0); + if (res["STATUS"] === 1) { + news = res["DATA"]["latestNews"]; + } + + var res = await GetLatestNews.GetOtherNews(); + if (res["STATUS"] === 1) { + othernews = res["DATA"]["latestNews"]; + } + return { + props: { othernews, news, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/login.js b/pages/yamaha/login.js new file mode 100644 index 0000000..2130766 --- /dev/null +++ b/pages/yamaha/login.js @@ -0,0 +1,138 @@ +import React from "react"; +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; +import InputAdornment from "@material-ui/core/InputAdornment"; +import Icon from "@material-ui/core/Icon"; +// @material-ui/icons +import Email from "@material-ui/icons/Email"; +import People from "@material-ui/icons/People"; +// core components +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Button from "components/CustomButtons/Button.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 CustomInput from "components/CustomInput/CustomInput.js"; + +import styles from "assets/jss/nextjs-material-kit/pages/loginPage.js"; + +import image from "assets/img/bgtbg.jpg"; + +const useStyles = makeStyles(styles); + +export default function LoginPage(props) { + const [cardAnimaton, setCardAnimation] = React.useState("cardHidden"); + setTimeout(function() { + setCardAnimation(""); + }, 700); + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + {...rest} + /> +
+
+ + + +
+ +

Login

+
+ + + +
+
+

Welcome to Thamrin Brothers

+ + + + + ) + }} + /> + + + lock_outline + + + ), + autoComplete: "off" + }} + /> + + + + + +
+
+
+
+
+
+
+ ); +} diff --git a/pages/yamaha/product/accessories.js b/pages/yamaha/product/accessories.js new file mode 100644 index 0000000..0d2e795 --- /dev/null +++ b/pages/yamaha/product/accessories.js @@ -0,0 +1,72 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetDataAccessories from "../../../api/product/accessories.js"; +import DataAccessories from "../../../pages-sections/yamaha/product/accessories.js"; +import DataSnackbarContent from "../../../pages-sections/yamaha/snackbar.js"; +import Router from 'next/router' + +const useStyles = makeStyles(styles); +const queryClient = new QueryClient(); +const handleName = values => { + Router.push({ + pathname: 'yamaha/product/accessories', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} +const Accessories = function ({ selected, accessories, backend, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default Accessories; + +export async function getServerSideProps(context) { + var accessories = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDataAccessories.GetAccessories(filter); + if (res["STATUS"] === 1) { + accessories = res["DATA"]["accessories"]; + if (filter !=""){ + selected = accessories.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, accessories, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/accessories_details.js b/pages/yamaha/product/accessories_details.js new file mode 100644 index 0000000..c1e8c00 --- /dev/null +++ b/pages/yamaha/product/accessories_details.js @@ -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 Footer from "components/Footer/Footer.js"; +import AccessoriesDetail from "pages-sections/yamaha/product/accessories_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailAccessories from "../../../api/product/accessories.js" + +const useStyles = makeStyles(styles); + +const AccessoriesDetails = function ({ backend, detailaccessories, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default AccessoriesDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailaccessories = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailAccessories.GetDetailAccessories(query.s||0); + if (res["STATUS"] === 1) { + detailaccessories = res["DATA"]["accessories"]; + } + console.log(detailaccessories); + + return { + props: { detailaccessories, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/apparel.js b/pages/yamaha/product/apparel.js new file mode 100644 index 0000000..ad89731 --- /dev/null +++ b/pages/yamaha/product/apparel.js @@ -0,0 +1,135 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetDataApparel from "../../../api/product/apparel.js"; +import DataApparel from "../../../pages-sections/yamaha/product/apparel.js"; +import DataSnackbarContent from "../../../pages-sections/yamaha/snackbar.js"; +import Router from 'next/router' + +const useStyles = makeStyles(styles); +const queryClient = new QueryClient(); +const handleName = values => { + Router.push({ + pathname: 'yamaha/product/apparel', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} +const Apparel = function ({ selected, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, backend, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default Apparel; + +export async function getServerSideProps(context) { + var apparel = []; + var asia = []; + var basic = []; + var merchand = []; + var maxi = []; + var rainsuit = []; + var motogp = []; + var offroad = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDataApparel.GetApparel(filter); + if (res["STATUS"] === 1) { + apparel = res["DATA"]["apparels"]; + if (filter !=""){ + selected = apparel.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparel46Asia(filter); + if (res["STATUS"] === 1) { + asia = res["DATA"]["apparels"]; + if (filter !=""){ + selected = asia.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelBasic(filter); + if (res["STATUS"] === 1) { + basic = res["DATA"]["apparels"]; + if (filter !=""){ + selected = basic.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelMerchandise(filter); + if (res["STATUS"] === 1) { + merchand = res["DATA"]["apparels"]; + if (filter !=""){ + selected = merchand.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelMaxi(filter); + if (res["STATUS"] === 1) { + maxi = res["DATA"]["apparels"]; + if (filter !=""){ + selected = maxi.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelRainSuit(filter); + if (res["STATUS"] === 1) { + rainsuit = res["DATA"]["apparels"]; + if (filter !=""){ + selected = rainsuit.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelMotoGP(filter); + if (res["STATUS"] === 1) { + motogp = res["DATA"]["apparels"]; + if (filter !=""){ + selected = motogp.filter((i)=>i.name==filter); + } + } + + var res = await GetDataApparel.GetApparelOffRoad(filter); + if (res["STATUS"] === 1) { + offroad = res["DATA"]["apparels"]; + if (filter !=""){ + selected = offroad.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, apparel, asia, basic, merchand, maxi, rainsuit, motogp, offroad, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/apparel_details.js b/pages/yamaha/product/apparel_details.js new file mode 100644 index 0000000..b43a588 --- /dev/null +++ b/pages/yamaha/product/apparel_details.js @@ -0,0 +1,54 @@ +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 Footer from "components/Footer/Footer.js"; +import ApparelDetail from "pages-sections/yamaha/product/apparel_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailApparel from "../../../api/product/apparel.js" + +const useStyles = makeStyles(styles); + +const ApparelDetails = function ({ backend, detailapparel, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default ApparelDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailapparel = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailApparel.GetDetailApparel(query.s||0); + if (res["STATUS"] === 1) { + detailapparel = res["DATA"]["apparels"]; + } + + return { + props: { detailapparel, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/helmet.js b/pages/yamaha/product/helmet.js new file mode 100644 index 0000000..b359e21 --- /dev/null +++ b/pages/yamaha/product/helmet.js @@ -0,0 +1,135 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetDataHelmet from "../../../api/product/helmet.js" +import DataHelmet from "../../../pages-sections/yamaha/product/helmet.js"; +import DataSnackbarContent from "../../../pages-sections/yamaha/snackbar.js"; +import Router from 'next/router' + +const useStyles = makeStyles(styles); +const queryClient = new QueryClient(); +const handleName = values => { + Router.push({ + pathname: '/yamaha/product/helmet', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} +const Helmet = function ({ selected, helmet, mtx, extreme, ranger, backend, fighter, swirl, classic, uno, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default Helmet; + +export async function getServerSideProps(context) { + var helmet = []; + var mtx = []; + var extreme = []; + var ranger = []; + var fighter = []; + var swirl = []; + var classic = []; + var uno = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDataHelmet.GetHelmetRConcepts(filter); + if (res["STATUS"] === 1) { + helmet = res["DATA"]["helmets"]; + if (filter !=""){ + selected = helmet.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetMTX(filter); + if (res["STATUS"] === 1) { + mtx = res["DATA"]["helmets"]; + if (filter !=""){ + selected = mtx.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetExtreme(filter); + if (res["STATUS"] === 1) { + extreme = res["DATA"]["helmets"]; + if (filter !=""){ + selected = extreme.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetRanger(filter); + if (res["STATUS"] === 1) { + ranger = res["DATA"]["helmets"]; + if (filter !=""){ + selected = ranger.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetFighter(filter); + if (res["STATUS"] === 1) { + fighter = res["DATA"]["helmets"]; + if (filter !=""){ + selected = fighter.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetSwirl(filter); + if (res["STATUS"] === 1) { + swirl = res["DATA"]["helmets"]; + if (filter !=""){ + selected = swirl.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetClassic(filter); + if (res["STATUS"] === 1) { + classic = res["DATA"]["helmets"]; + if (filter !=""){ + selected = classic.filter((i)=>i.name==filter); + } + } + + var res = await GetDataHelmet.GetHelmetUno(filter); + if (res["STATUS"] === 1) { + uno = res["DATA"]["helmets"]; + if (filter !=""){ + selected = uno.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, helmet, mtx, extreme, ranger, fighter, swirl, classic, uno, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/helmet_details.js b/pages/yamaha/product/helmet_details.js new file mode 100644 index 0000000..302939f --- /dev/null +++ b/pages/yamaha/product/helmet_details.js @@ -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 Footer from "components/Footer/Footer.js"; +import HelmetDetail from "pages-sections/yamaha/product/helmet_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailHelmet from "../../../api/product/helmet.js" + +const useStyles = makeStyles(styles); + +const HelmetDetails = function ({ backend, detailhelmet, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default HelmetDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailhelmet = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailHelmet.GetDetailHelmet(query.s||0); + if (res["STATUS"] === 1) { + detailhelmet = res["DATA"]["helmets"]; + } + console.log(detailhelmet); + + return { + props: { detailhelmet, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/product.js b/pages/yamaha/product/product.js new file mode 100644 index 0000000..a9dfe58 --- /dev/null +++ b/pages/yamaha/product/product.js @@ -0,0 +1,129 @@ +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 Footer from "components/Footer/Footer.js"; +import DataProduct from "pages-sections/yamaha/product/product.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import Getproduct from "../../../api/product/product.js"; + +const useStyles = makeStyles(styles); + +const Product = function ({ + backend, + maxi, + matic, + naked, + sport, + offroad, + moped, + monsterenergy, + cbu, + ...props +}) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ +
+
+
+ ); +}; + +export default Product; + +export async function getServerSideProps(context) { + var maxi = []; + var matic = []; + var naked = []; + var sport = []; + var offroad = []; + var moped = []; + var monsterenergy = []; + var cbu = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await Getproduct.GetProductMaxi(); + if (res["STATUS"] === 1) { + maxi = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductMatic(); + if (res["STATUS"] === 1) { + matic = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductNaked(); + if (res["STATUS"] === 1) { + naked = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductSport(); + if (res["STATUS"] === 1) { + sport = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductOffRoad(); + if (res["STATUS"] === 1) { + offroad = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductMoped(); + if (res["STATUS"] === 1) { + moped = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductMonsterEnergy(); + if (res["STATUS"] === 1) { + monsterenergy = res["DATA"]["products"]; + } + + var res = await Getproduct.GetProductCBU(); + if (res["STATUS"] === 1) { + cbu = res["DATA"]["products"]; + } + + console.log(cbu); + + return { + props: { + maxi, + matic, + naked, + sport, + offroad, + moped, + monsterenergy, + cbu, + backend, + }, // will be passed to the page component as props + }; +} diff --git a/pages/yamaha/product/product_detail.js b/pages/yamaha/product/product_detail.js new file mode 100644 index 0000000..5ba3aea --- /dev/null +++ b/pages/yamaha/product/product_detail.js @@ -0,0 +1,54 @@ +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 Footer from "components/Footer/Footer.js"; +import ProductDetail from "pages-sections/yamaha/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" + +const useStyles = makeStyles(styles); + +const ProductDetails = function ({ backend, detailproduct, ...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 res = await GetDetailproduct.GetDetailProduct(query.s||0); + if (res["STATUS"] === 1) { + detailproduct = res["DATA"]["products"]; + } + + return { + props: { detailproduct, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/yamalube.js b/pages/yamaha/product/yamalube.js new file mode 100644 index 0000000..8d90a75 --- /dev/null +++ b/pages/yamaha/product/yamalube.js @@ -0,0 +1,73 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetDataYamalube from "../../../api/product/accessories.js"; +import DataYamalube from "../../../pages-sections/yamaha/product/yamalube.js"; +import DataSnackbarContent from "../../../pages-sections/yamaha/snackbar.js"; +import Router from 'next/router' + +const useStyles = makeStyles(styles); +const queryClient = new QueryClient(); +const handleName = values => { + Router.push({ + pathname: '/yamaha/product/yamalube', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} +const Yamalube = function ({ selected, yamalube, backend, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default Yamalube; + +export async function getServerSideProps(context) { + var yamalube = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDataYamalube.GetYamalube(filter); + + if (res["STATUS"] === 1) { + yamalube = res["DATA"]["accessories"]; + if (filter !=""){ + selected = yamalube.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, yamalube, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/yamalube_details.js b/pages/yamaha/product/yamalube_details.js new file mode 100644 index 0000000..7fbc412 --- /dev/null +++ b/pages/yamaha/product/yamalube_details.js @@ -0,0 +1,54 @@ +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 Footer from "components/Footer/Footer.js"; +import YamalubeDetail from "pages-sections/yamaha/product/yamalube_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailYamalube from "../../../api/product/accessories.js" + +const useStyles = makeStyles(styles); + +const YamalubeDetails = function ({ backend, detailyamalube, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+
+ ); +} + +export default YamalubeDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailyamalube = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailYamalube.GetDetailAccessories(query.s||0); + if (res["STATUS"] === 1) { + detailyamalube = res["DATA"]["accessories"]; + } + + return { + props: { detailyamalube, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/ygp.js b/pages/yamaha/product/ygp.js new file mode 100644 index 0000000..aa09b8a --- /dev/null +++ b/pages/yamaha/product/ygp.js @@ -0,0 +1,74 @@ +import React from "react"; +import classNames from "classnames"; +import { makeStyles } from "@material-ui/core/styles"; +import { QueryClient, QueryClientProvider, useQuery } from 'react-query' + +import Header from "components/Header/Header.js"; +import HeaderLinks from "components/Header/HeaderLinks.js"; +import Footer from "components/Footer/Footer.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; + +import GetDataYGP from "../../../api/product/accessories.js"; +import DataYGP from "../../../pages-sections/yamaha/product/ygp.js"; +import DataSnackbarContent from "../../../pages-sections/yamaha/snackbar.js"; +import Router from 'next/router' + + +const useStyles = makeStyles(styles); +const queryClient = new QueryClient(); +const handleName = values => { + Router.push({ + pathname: '/yamaha/product/ygp', + query: (values&&values.length!=0)?{ filter: values[0]["name"] }:{}, + }) +} +const YGP = function ({ selected,ygp, backend, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white", + }} + {...rest} + /> + +
+ + + + +
+
+
+ ); +}; + +export default YGP; + +export async function getServerSideProps(context) { + var ygp = []; + var filter = context.query.filter||""; + var selected = ""; + + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDataYGP.GetYGP(filter); + + if (res["STATUS"] === 1) { + ygp = res["DATA"]["accessories"]; + if (filter !=""){ + selected = ygp.filter((i)=>i.name==filter); + } + } + + return { + props: { selected, ygp, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/pages/yamaha/product/ygp_details.js b/pages/yamaha/product/ygp_details.js new file mode 100644 index 0000000..2e1179a --- /dev/null +++ b/pages/yamaha/product/ygp_details.js @@ -0,0 +1,54 @@ +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 Footer from "components/Footer/Footer.js"; +import YGPDetail from "pages-sections/yamaha/product/ygp_details.js"; +import Parallax from "components/Parallax/Parallax.js"; +import styles from "assets/jss/nextjs-material-kit/pages/components.js"; +import GetDetailYGP from "../../../api/product/accessories.js" + +const useStyles = makeStyles(styles); + +const YGPDetails = function ({ backend, detailygp, ...props }) { + const classes = useStyles(); + const { ...rest } = props; + return ( +
+
} + fixed + color="info" + changeColorOnScroll={{ + height: 400, + color: "white" + }} + {...rest} + /> + +
+ +
+
+ ); +} + +export default YGPDetails; + +export async function getServerSideProps(context) { + var {query} = context; + var detailygp = []; + const backend = process.env.BACKEND_SERVER_URI; + + var res = await GetDetailYGP.GetDetailAccessories(query.s||0); + if (res["STATUS"] === 1) { + detailygp = res["DATA"]["accessories"]; + } + + return { + props: { detailygp, backend }, // will be passed to the page component as props + }; +} \ No newline at end of file