diff --git a/.next/build-manifest.json b/.next/build-manifest.json index 2fdab92..1aaa22a 100644 --- a/.next/build-manifest.json +++ b/.next/build-manifest.json @@ -24,7 +24,23 @@ "static/runtime/polyfills.js", "static/runtime/polyfills.js.map" ], - "/yamaha/cart/checkout": [ + "/suzuki/home": [ + "static/runtime/webpack.js", + "static/runtime/main.js" + ], + "/suzuki/latest_news/latestnews_details": [ + "static/runtime/webpack.js", + "static/runtime/main.js" + ], + "/suzuki/product/product": [ + "static/runtime/webpack.js", + "static/runtime/main.js" + ], + "/suzuki/product/product_detail": [ + "static/runtime/webpack.js", + "static/runtime/main.js" + ], + "/yamaha/latest_news/latestnews": [ "static/runtime/webpack.js", "static/runtime/main.js" ] diff --git a/.next/server/pages-manifest.json b/.next/server/pages-manifest.json index 27d04df..90f81a8 100644 --- a/.next/server/pages-manifest.json +++ b/.next/server/pages-manifest.json @@ -1 +1 @@ -{"/_app":"static/development/pages/_app.js","/_document":"static/development/pages/_document.js","/_error":"static/development/pages/_error.js","/yamaha/cart/checkout":"static/development/pages/yamaha/cart/checkout.js"} \ No newline at end of file +{"/_app":"static/development/pages/_app.js","/_document":"static/development/pages/_document.js","/_error":"static/development/pages/_error.js","/suzuki/home":"static/development/pages/suzuki/home.js","/suzuki/latest_news/latestnews_details":"static/development/pages/suzuki/latest_news/latestnews_details.js","/suzuki/product/product":"static/development/pages/suzuki/product/product.js","/suzuki/product/product_detail":"static/development/pages/suzuki/product/product_detail.js","/yamaha/latest_news/latestnews":"static/development/pages/yamaha/latest_news/latestnews.js"} \ No newline at end of file diff --git a/api/carrer/carrer.js b/api/carrer/carrer.js index 5a5ef86..1422a25 100644 --- a/api/carrer/carrer.js +++ b/api/carrer/carrer.js @@ -1,6 +1,6 @@ import apollo from "../../lib/apollo.js"; -async function GetCarrerS1(token="") { +async function GetCarrerS1Yamaha(token="") { var res = await apollo.query( ` query { @@ -18,7 +18,7 @@ async function GetCarrerS1(token="") { return res; } -async function GetCarrerD3(token="") { +async function GetCarrerD3Yamaha(token="") { var res = await apollo.query( ` query { @@ -36,7 +36,7 @@ async function GetCarrerD3(token="") { return res; } -async function GetCarrerSMA(token="") { +async function GetCarrerSMAYamaha(token="") { var res = await apollo.query( ` query { @@ -80,9 +80,69 @@ async function GetDetailCarrer(id, token="") { return res; } +async function GetCarrerS1Suzuki(token="") { + var res = await apollo.query( + ` + query { + carrers(where: {category: "S1" business_partner:"2"}) + { + id + name + start_regis + until_regis + name_description + } + }`, + token + ); + return res; +} + +async function GetCarrerD3Suzuki(token="") { + var res = await apollo.query( + ` + query { + carrers(where: {category: "D3" business_partner:"2"}) + { + id + name + start_regis + until_regis + name_description + } + }`, + token + ); + return res; +} + +async function GetCarrerSMASuzuki(token="") { + var res = await apollo.query( + ` + query { + carrers(where: {category: "SMA" business_partner:"2"}) + { + id + name + start_regis + until_regis + name_description + } + }`, + token + ); + return res; +} + module.exports = { - GetCarrerS1:GetCarrerS1, - GetCarrerD3:GetCarrerD3, - GetCarrerSMA:GetCarrerSMA, + //yamaha + GetCarrerS1Yamaha:GetCarrerS1Yamaha, + GetCarrerD3Yamaha:GetCarrerD3Yamaha, + GetCarrerSMAYamaha:GetCarrerSMAYamaha, + + //suzuki + GetCarrerS1Suzuki:GetCarrerS1Suzuki, + GetCarrerD3Suzuki:GetCarrerD3Suzuki, + GetCarrerSMASuzuki:GetCarrerSMASuzuki, GetDetailCarrer:GetDetailCarrer, }; \ No newline at end of file diff --git a/api/home/carousel.js b/api/home/carousel.js index c4cbdcb..ee4d44a 100644 --- a/api/home/carousel.js +++ b/api/home/carousel.js @@ -1,6 +1,6 @@ import apollo from "../../lib/apollo.js"; -async function GetCarousels(token="") { +async function GetCarouselsYamaha(token="") { var res = await apollo.query( ` query{ @@ -17,6 +17,24 @@ async function GetCarousels(token="") { return res; } +async function GetCarouselsSuzuki(token="") { + var res = await apollo.query( + ` + query { + carousels(where: { business_partner: "2" }) { + id + img { + url + } + } + } + `, + token + ); + return res; +} + module.exports = { - GetCarousels: GetCarousels, + GetCarouselsYamaha:GetCarouselsYamaha, + GetCarouselsSuzuki:GetCarouselsSuzuki, }; \ No newline at end of file diff --git a/api/home/service.js b/api/home/service.js index 0f0d3e5..fcb0969 100644 --- a/api/home/service.js +++ b/api/home/service.js @@ -1,6 +1,24 @@ import apollo from "../../lib/apollo.js"; -async function Getservices(token="") { +async function GetservicesYamaha(token="") { + var res = await apollo.query( + ` + query{ + services + { + name + img{ + url + } + } + } + `, + token + ); + return res; +} + +async function GetservicesSuzuki(token="") { var res = await apollo.query( ` query{ @@ -19,5 +37,6 @@ async function Getservices(token="") { } module.exports = { - Getservices: Getservices, + GetservicesYamaha: GetservicesYamaha, + GetservicesSuzuki:GetservicesSuzuki, }; \ No newline at end of file diff --git a/api/latest_news/news.js b/api/latest_news/news.js index 9f3c2a2..21a0e66 100644 --- a/api/latest_news/news.js +++ b/api/latest_news/news.js @@ -1,6 +1,6 @@ import apollo from "../../lib/apollo.js"; -async function GetNews(token="", start = 0) { +async function GetNewsYamaha(token="", start = 0) { var res = await apollo.query( ` query($start: Int!) { @@ -24,7 +24,7 @@ async function GetNews(token="", start = 0) { return res; } -async function GetOtherNews(token="", start = 0) { +async function GetOtherNewsYamaha(token="", start = 0) { var res = await apollo.query( ` query($start: Int!) { @@ -48,6 +48,54 @@ async function GetOtherNews(token="", start = 0) { return res; } +async function GetNewsSuzuki(token="", start = 0) { + var res = await apollo.query( + ` + query{ + latestNews(where: { business_partner: "2" }) + { + id + title + description + img{ + url + } + published_at + } + } + `, + token, + { + start: start, + } + ); + return res; +} + +async function GetOtherNewsSuzuki(token="", start = 0) { + var res = await apollo.query( + ` + query{ + latestNews(where: { business_partner: "2" }) + { + id + title + description + img{ + url + } + published_at + } + } + `, + token, + { + start: start, + } + ); + return res; +} + async function GetDetailNews(id, token="") { var res = await apollo.query( ` @@ -73,7 +121,9 @@ async function GetDetailNews(id, token="") { } module.exports = { - GetNews: GetNews, + GetNewsYamaha: GetNewsYamaha, + GetOtherNewsYamaha:GetOtherNewsYamaha, + GetNewsSuzuki:GetNewsSuzuki, + GetOtherNewsSuzuki:GetOtherNewsSuzuki, GetDetailNews: GetDetailNews, - GetOtherNews:GetOtherNews, }; \ No newline at end of file diff --git a/api/product/product.js b/api/product/product.js index 2212b17..376bb31 100644 --- a/api/product/product.js +++ b/api/product/product.js @@ -205,8 +205,26 @@ async function GetProductPowerProduct(token = "") { return res; } +async function GetProductSuzuki(token = "") { + var res = await apollo.query( + ` + query { + products(where: { business_partner: "2" }) { + id + name + price + img { + url + } + } + }`, + token + ); + return res; +} + module.exports = { - GetDetailProduct: GetDetailProduct, + //yamaha GetProductMatic: GetProductMatic, GetProductMaxi: GetProductMaxi, GetProductNaked: GetProductNaked, @@ -217,4 +235,10 @@ module.exports = { GetProductCBU: GetProductCBU, GetProductATV: GetProductATV, GetProductPowerProduct: GetProductPowerProduct, + + //suzuki + GetProductSuzuki:GetProductSuzuki, + + //detail + GetDetailProduct: GetDetailProduct, }; \ No newline at end of file diff --git a/api/suzuki/carrer/carrer.js b/api/suzuki/carrer/carrer.js deleted file mode 100644 index 08b60d9..0000000 --- a/api/suzuki/carrer/carrer.js +++ /dev/null @@ -1,88 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function GetCarrerS1(token="") { - var res = await apollo.query( - ` - query { - carrers(where: {category: "S1" business_partner:"2"}) - { - id - name - start_regis - until_regis - name_description - } - }`, - token - ); - return res; -} - -async function GetCarrerD3(token="") { - var res = await apollo.query( - ` - query { - carrers(where: {category: "D3" business_partner:"2"}) - { - id - name - start_regis - until_regis - name_description - } - }`, - token - ); - return res; -} - -async function GetCarrerSMA(token="") { - var res = await apollo.query( - ` - query { - carrers(where: {category: "SMA" business_partner:"2"}) - { - id - name - start_regis - until_regis - name_description - } - }`, - token - ); - return res; -} - -async function GetDetailCarrer(id, token="") { - var res = await apollo.query( - ` - query($input: ID!){ - carrers(where:{id:$input}) - { - name - description - category - img{ - url - } - start_regis - until_regis - name_description - } - } - `, - token, - { - "input": id - } - ); - return res; -} - -module.exports = { - GetCarrerS1:GetCarrerS1, - GetCarrerD3:GetCarrerD3, - GetCarrerSMA:GetCarrerSMA, - GetDetailCarrer:GetDetailCarrer, -}; \ No newline at end of file diff --git a/api/suzuki/dealer/dealer.js b/api/suzuki/dealer/dealer.js deleted file mode 100644 index 1531a56..0000000 --- a/api/suzuki/dealer/dealer.js +++ /dev/null @@ -1,26 +0,0 @@ -import apollo from "../../lib/apollo.js"; - -async function GetDealers(filter, token="") { - var res = await apollo.query( - ` - query { ${(filter!="")?`name: "${filter}"`:""} - dealers - { - id - name - kota_dealer - address - telp - email - location - } - } - `, - token - ); - return res; -} - -module.exports = { - GetDealers: GetDealers, -}; \ No newline at end of file diff --git a/api/suzuki/home/businessPartner.js b/api/suzuki/home/businessPartner.js deleted file mode 100644 index 4120cdd..0000000 --- a/api/suzuki/home/businessPartner.js +++ /dev/null @@ -1,23 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function GetbusinessPartners(token = "") { - var res = await apollo.query( - ` - query{ - businessPartners - { - name - img{ - url - } - } - } - `, - token - ); - return res; -} - -module.exports = { - GetbusinessPartners: GetbusinessPartners, -}; \ No newline at end of file diff --git a/api/suzuki/home/carousel.js b/api/suzuki/home/carousel.js deleted file mode 100644 index d7a5cdc..0000000 --- a/api/suzuki/home/carousel.js +++ /dev/null @@ -1,22 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function GetCarousels(token="") { - var res = await apollo.query( - ` - query { - carousels(where: { business_partner: "2" }) { - id - img { - url - } - } - } - `, - token - ); - return res; -} - -module.exports = { - GetCarousels: GetCarousels, -}; \ No newline at end of file diff --git a/api/suzuki/home/service.js b/api/suzuki/home/service.js deleted file mode 100644 index 36ed518..0000000 --- a/api/suzuki/home/service.js +++ /dev/null @@ -1,23 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function Getservices(token="") { - var res = await apollo.query( - ` - query{ - services - { - name - img{ - url - } - } - } - `, - token - ); - return res; -} - -module.exports = { - Getservices: Getservices, -}; \ No newline at end of file diff --git a/api/suzuki/latest_news/news.js b/api/suzuki/latest_news/news.js deleted file mode 100644 index 388d4ad..0000000 --- a/api/suzuki/latest_news/news.js +++ /dev/null @@ -1,79 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function GetNews(token="", start = 0) { - var res = await apollo.query( - ` - query{ - latestNews(where: { business_partner: "2" }) - { - id - title - description - img{ - url - } - published_at - } - } - `, - token, - { - start: start, - } - ); - return res; -} - -async function GetOtherNews(token="", start = 0) { - var res = await apollo.query( - ` - query{ - latestNews(where: { business_partner: "2" }) - { - id - title - description - img{ - url - } - published_at - } - } - `, - token, - { - start: start, - } - ); - return res; -} - -async function GetDetailNews(id, token="") { - var res = await apollo.query( - ` - query($input: ID!) { - latestNews(where:{id:$input}) - { - id - title - description - img{ - url - } - published_at - } - } - `, - token, - { - "input": id - } - ); - return res; -} - -module.exports = { - GetNews: GetNews, - GetDetailNews: GetDetailNews, - GetOtherNews:GetOtherNews, -}; \ No newline at end of file diff --git a/api/suzuki/product/product.js b/api/suzuki/product/product.js deleted file mode 100644 index a1fc07a..0000000 --- a/api/suzuki/product/product.js +++ /dev/null @@ -1,48 +0,0 @@ -import apollo from "../../../lib/apollo.js"; - -async function GetDetailProduct(id, token = "") { - var res = await apollo.query( - ` - query($input: ID!){ - products(where:{id:$input}) - { - name - price - description - img{ - url - } - overview - specification - film - stock - } - } `, - token, { - "input": id - } - ); - return res; -} - -async function GetProductSuzuki(token = "") { - var res = await apollo.query( - ` - query { - products(where: { business_partner: "2" }) { - id - name - price - img { - url - } - } - }`, - token - ); - return res; -} -module.exports = { - GetProductSuzuki: GetProductSuzuki, - GetDetailProduct:GetDetailProduct, -}; \ No newline at end of file diff --git a/assets/img/bca.png b/assets/img/bca.png new file mode 100644 index 0000000..9724e0b Binary files /dev/null and b/assets/img/bca.png differ diff --git a/components/Header/HeaderLinks.js b/components/Header/HeaderLinks.js index 28fc3e2..c658909 100644 --- a/components/Header/HeaderLinks.js +++ b/components/Header/HeaderLinks.js @@ -57,19 +57,19 @@ export default function HeaderLinks(props) { Apparel, Accessories, Service, - Dealers, + Dealers, ]} /> - + - diff --git a/components/Header/HeaderSuzuki.js b/components/Header/HeaderSuzuki.js index e95b310..17ba79d 100644 --- a/components/Header/HeaderSuzuki.js +++ b/components/Header/HeaderSuzuki.js @@ -85,14 +85,14 @@ export default function HeaderLinks(props) { /> */} - + - diff --git a/pages-sections/suzuki/latest_news/news.js b/pages-sections/suzuki/latest_news/news.js index 299d4e7..d891596 100644 --- a/pages-sections/suzuki/latest_news/news.js +++ b/pages-sections/suzuki/latest_news/news.js @@ -27,7 +27,7 @@ const DataLatestNews = function ({ backend, news, ...props }) {

{data.title}

{data.published_at}

-
diff --git a/pages-sections/yamaha/cart/cart.js b/pages-sections/yamaha/cart/cart.js index 4d4ef7c..be567e0 100644 --- a/pages-sections/yamaha/cart/cart.js +++ b/pages-sections/yamaha/cart/cart.js @@ -17,6 +17,7 @@ import Icon from "@material-ui/core/Icon"; import MenuItem from '@material-ui/core/MenuItem'; import FormControl from '@material-ui/core/FormControl'; import Select from '@material-ui/core/Select'; +import TextField from '@material-ui/core/TextField'; const useStyles = makeStyles({ table: { @@ -79,28 +80,16 @@ import Select from '@material-ui/core/Select'; Rp.{data.price} - - + + + Rp.{data.price} Hapus diff --git a/pages-sections/yamaha/cart/checkout.js b/pages-sections/yamaha/cart/checkout.js index 2428530..d2c94f0 100644 --- a/pages-sections/yamaha/cart/checkout.js +++ b/pages-sections/yamaha/cart/checkout.js @@ -1,5 +1,6 @@ import React from 'react'; import { makeStyles } from '@material-ui/core/styles'; +import clsx from 'clsx'; import SnackbarContent from "components/Snackbar/SnackbarContent.js"; import Button1 from "components/CustomButtons/Button.js"; @@ -28,6 +29,12 @@ import IconButton from '@material-ui/core/IconButton'; import Typography from '@material-ui/core/Typography'; import CloseIcon from '@material-ui/icons/Close'; import Slide from '@material-ui/core/Slide'; +import Radio from '@material-ui/core/Radio'; +import RadioGroup from '@material-ui/core/RadioGroup'; +import FormControlLabel from '@material-ui/core/FormControlLabel'; +import FormControl from '@material-ui/core/FormControl'; +import FormLabel from '@material-ui/core/FormLabel'; +import value from '@material-ui/core/FormLabel'; const useStyles = makeStyles((theme) => ({ root: { @@ -46,16 +53,68 @@ const useStyles = makeStyles((theme) => ({ appBar: { position: 'relative', }, - title: { + title: { marginLeft: theme.spacing(2), flex: 1, }, + root: { + '&:hover': { + backgroundColor: 'transparent', + }, + }, + icon: { + borderRadius: '50%', + width: 16, + height: 16, + boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)', + backgroundColor: '#f5f8fa', + backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))', + '$root.Mui-focusVisible &': { + outline: '2px auto rgba(19,124,189,.6)', + outlineOffset: 2, + }, + 'input:hover ~ &': { + backgroundColor: '#ebf1f5', + }, + 'input:disabled ~ &': { + boxShadow: 'none', + background: 'rgba(206,217,224,.5)', + }, + }, + checkedIcon: { + backgroundColor: '#137cbd', + backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))', + '&:before': { + display: 'block', + width: 16, + height: 16, + backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)', + content: '""', + }, + 'input:hover ~ &': { + backgroundColor: '#106ba3', + }, + }, })); function getSteps() { return ['Alamat Pengiriman', 'Pesanan Produk', 'Metode Pembayaran']; } +function StyledRadio(props) { + const classes = useStyles(); + return ( + } + icon={} + {...props} + /> + ); +} + const Transition = React.forwardRef(function Transition(props, ref) { return ; }); @@ -205,18 +264,92 @@ const DataCheckout = function ({ backend, checkoutproduct, ...props }) { const CartMetodePembayaran = checkoutproduct.map((data) => { return ( -
-

-

Alamat Pengiriman

-
-
Yusmar
-
087797315685
-
Thamrin Indrapura Jl.Aipda Karel Satsuit Tubun,17 Ilir, Kec.Ilir Tim.I, Palembang, KOTA PALEMBANG - ILIR TIMUR II, SUMATERA SELATAN, ID 30114
- - - cached - Ubah Alamat - +
+
+ + Pilih Metode Pembayaran +

+ + + + + +
+ } />

+ +

Bank BCA

+
+
+
+ + +
+ } />

+ +

Bank BRI

+
+
+
+ + +
+ } />

+ +

Bank Mandiri

+
+
+
+ + +
+ } />

+ +

Bank BNI

+
+
+
+
+ + + +
+ } />

+ +

Bank BSI

+
+
+
+ + +
+ } />

+ +

Bank Permata

+
+
+
+ + +
+ } />

+ +

Bank Danamon

+
+
+
+ + +
+ } />

+ +

Bank Maybank

+
+
+
+
+
+
+
); }) @@ -237,7 +370,7 @@ const DataCheckout = function ({ backend, checkoutproduct, ...props }) { {label} - {CartProdukPesanan} + {CartMetodePembayaran}
diff --git a/pages/_error.js b/pages/_error.js index d5bfbc0..36ee317 100644 --- a/pages/_error.js +++ b/pages/_error.js @@ -3,7 +3,7 @@ import Router from "next/router"; export default class _error extends Component { componentDidMount = () => { - Router.push("/suzuki/home"); + Router.push("/yamaha/home"); }; render() { diff --git a/pages/suzuki/carrer.js b/pages/suzuki/carrer/carrer.js similarity index 88% rename from pages/suzuki/carrer.js rename to pages/suzuki/carrer/carrer.js index 3355c79..bda230c 100644 --- a/pages/suzuki/carrer.js +++ b/pages/suzuki/carrer/carrer.js @@ -9,7 +9,7 @@ import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; import SectionCarrer from "pages-sections/suzuki/carrer/carrer.js"; -import Getcarrer from "../../api/suzuki/carrer/carrer.js" +import Getcarrer from "../../../api/carrer/carrer.js" const useStyles = makeStyles(styles); @@ -45,17 +45,17 @@ export async function getServerSideProps(context) { var sma = []; const backend = process.env.BACKEND_SERVER_URI; - var res = await Getcarrer.GetCarrerS1(); + var res = await Getcarrer.GetCarrerS1Suzuki(); if (res["STATUS"] === 1) { s1 = res["DATA"]["carrers"]; } - var res = await Getcarrer.GetCarrerD3(); + var res = await Getcarrer.GetCarrerD3Suzuki(); if (res["STATUS"] === 1) { d3 = res["DATA"]["carrers"]; } - var res = await Getcarrer.GetCarrerSMA(); + var res = await Getcarrer.GetCarrerSMASuzuki(); if (res["STATUS"] === 1) { sma = res["DATA"]["carrers"]; } diff --git a/pages/suzuki/carrer_details.js b/pages/suzuki/carrer/carrer_details.js similarity index 96% rename from pages/suzuki/carrer_details.js rename to pages/suzuki/carrer/carrer_details.js index ee97278..5bbe150 100644 --- a/pages/suzuki/carrer_details.js +++ b/pages/suzuki/carrer/carrer_details.js @@ -8,7 +8,7 @@ import FooterSuzuki from "components/Footer/FooterSuzuki.js"; import CarrerDetail from "pages-sections/suzuki/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" +import GetDetailcarrer from "../../../api/carrer/carrer.js" const useStyles = makeStyles(styles); diff --git a/pages/suzuki/dealers.js b/pages/suzuki/dealers.js deleted file mode 100644 index b8b88e3..0000000 --- a/pages/suzuki/dealers.js +++ /dev/null @@ -1,74 +0,0 @@ -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/suzuki/home.js b/pages/suzuki/home.js index f40c598..811f925 100644 --- a/pages/suzuki/home.js +++ b/pages/suzuki/home.js @@ -8,9 +8,9 @@ import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; import FooterSuzuki from "components/Footer/FooterSuzuki.js"; -import GetbusinessPartners from "../../api/suzuki/home/businessPartner.js"; -import Getservices from "../../api/suzuki/home/service.js"; -import Getcarousels from "../../api/suzuki/home/carousel.js"; +import Getservices from "../../api/home/service.js"; +import Getcarousels from "../../api/home/carousel.js"; + import DataSnackbarContent from "../../pages-sections/suzuki/snackbar.js"; import DataCarousel from "../../pages-sections/suzuki/home/carousel.js"; import DataService from "../../pages-sections/suzuki/home/service.js"; @@ -22,7 +22,6 @@ import DataFeature from "../../pages-sections/suzuki/home/feature.js"; const useStyles = makeStyles(styles); const Home = function ({ backend, - businessPartners, service, carousels, ...props @@ -63,23 +62,18 @@ export async function getServerSideProps(context) { var carousels = []; 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(); + var res = await Getservices.GetservicesSuzuki(); if (res["STATUS"] === 1) { service = res["DATA"]["services"]; } - var res = await Getcarousels.GetCarousels(); + var res = await Getcarousels.GetCarouselsSuzuki(); if (res["STATUS"] === 1) { carousels = res["DATA"]["carousels"]; } return { - props: { businessPartners, service, carousels, backend }, // will be passed to the page component as props + props: { service, carousels, backend }, // will be passed to the page component as props }; } diff --git a/pages/suzuki/latestnews.js b/pages/suzuki/latest_news/latestnews.js similarity index 84% rename from pages/suzuki/latestnews.js rename to pages/suzuki/latest_news/latestnews.js index 9640188..1b6377e 100644 --- a/pages/suzuki/latestnews.js +++ b/pages/suzuki/latest_news/latestnews.js @@ -8,9 +8,9 @@ import FooterSuzuki from "components/Footer/FooterSuzuki.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; -import GetLatestNews from "../../api/suzuki/latest_news/news.js" -import DataSnackbarContent from "../../pages-sections/suzuki/snackbar.js"; -import DataLatestNews from "../../pages-sections/suzuki/latest_news/news.js"; +import GetLatestNews from "../../../api/latest_news/news.js" +import DataSnackbarContent from "../../../pages-sections/suzuki/snackbar.js"; +import DataLatestNews from "../../../pages-sections/suzuki/latest_news/news.js"; const useStyles = makeStyles(styles); @@ -46,7 +46,7 @@ export async function getServerSideProps(context) { var news = []; const backend = process.env.BACKEND_SERVER_URI; - var res = await GetLatestNews.GetNews(); + var res = await GetLatestNews.GetNewsSuzuki(); if (res["STATUS"] === 1) { news = res["DATA"]["latestNews"]; } diff --git a/pages/suzuki/latestnews_details.js b/pages/suzuki/latest_news/latestnews_details.js similarity index 85% rename from pages/suzuki/latestnews_details.js rename to pages/suzuki/latest_news/latestnews_details.js index 0b026dd..b5cd340 100644 --- a/pages/suzuki/latestnews_details.js +++ b/pages/suzuki/latest_news/latestnews_details.js @@ -8,9 +8,9 @@ import FooterSuzuki from "components/Footer/FooterSuzuki.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; -import GetLatestNews from "../../api/suzuki/latest_news/news.js" -import DataSnackbarContent from "../../pages-sections/suzuki/snackbar.js"; -import DetailLatestNews from "../../pages-sections/suzuki/latest_news/news_details.js"; +import GetLatestNews from "../../../api/latest_news/news.js" +import DataSnackbarContent from "../../../pages-sections/suzuki/snackbar.js"; +import DetailLatestNews from "../../../pages-sections/suzuki/latest_news/news_details.js"; const useStyles = makeStyles(styles); @@ -53,7 +53,7 @@ export async function getServerSideProps(context) { news = res["DATA"]["latestNews"]; } - var res = await GetLatestNews.GetOtherNews(); + var res = await GetLatestNews.GetOtherNewsSuzuki(); if (res["STATUS"] === 1) { othernews = res["DATA"]["latestNews"]; } diff --git a/pages/suzuki/product/product.js b/pages/suzuki/product/product.js index 3efe2ca..877effa 100644 --- a/pages/suzuki/product/product.js +++ b/pages/suzuki/product/product.js @@ -9,7 +9,7 @@ import DataProduct from "pages-sections/suzuki/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/suzuki/product/product.js"; +import Getproduct from "../../../api/product/product.js"; const useStyles = makeStyles(styles); diff --git a/pages/yamaha/carrer.js b/pages/yamaha/carrer/carrer.js similarity index 88% rename from pages/yamaha/carrer.js rename to pages/yamaha/carrer/carrer.js index 9e45b8c..a76a39b 100644 --- a/pages/yamaha/carrer.js +++ b/pages/yamaha/carrer/carrer.js @@ -9,7 +9,7 @@ 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" +import Getcarrer from "../../../api/carrer/carrer.js" const useStyles = makeStyles(styles); @@ -45,17 +45,17 @@ export async function getServerSideProps(context) { var sma = []; const backend = process.env.BACKEND_SERVER_URI; - var res = await Getcarrer.GetCarrerS1(); + var res = await Getcarrer.GetCarrerS1Yamaha(); if (res["STATUS"] === 1) { s1 = res["DATA"]["carrers"]; } - var res = await Getcarrer.GetCarrerD3(); + var res = await Getcarrer.GetCarrerD3Yamaha(); if (res["STATUS"] === 1) { d3 = res["DATA"]["carrers"]; } - var res = await Getcarrer.GetCarrerSMA(); + var res = await Getcarrer.GetCarrerSMAYamaha(); if (res["STATUS"] === 1) { sma = res["DATA"]["carrers"]; } diff --git a/pages/yamaha/carrer_details.js b/pages/yamaha/carrer/carrer_details.js similarity index 96% rename from pages/yamaha/carrer_details.js rename to pages/yamaha/carrer/carrer_details.js index d6b1a60..c85dfc6 100644 --- a/pages/yamaha/carrer_details.js +++ b/pages/yamaha/carrer/carrer_details.js @@ -8,7 +8,7 @@ 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" +import GetDetailcarrer from "../../../api/carrer/carrer.js.js" const useStyles = makeStyles(styles); diff --git a/pages/yamaha/home.js b/pages/yamaha/home.js index 1cf396a..1140491 100644 --- a/pages/yamaha/home.js +++ b/pages/yamaha/home.js @@ -11,6 +11,7 @@ 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"; @@ -69,12 +70,12 @@ export async function getServerSideProps(context) { businessPartners = res["DATA"]["businessPartners"]; } - var res = await Getservices.Getservices(); + var res = await Getservices.GetservicesYamaha(); if (res["STATUS"] === 1) { service = res["DATA"]["services"]; } - var res = await Getcarousels.GetCarousels(); + var res = await Getcarousels.GetCarouselsYamaha(); if (res["STATUS"] === 1) { carousel = res["DATA"]["carousels"]; } diff --git a/pages/yamaha/latestnews.js b/pages/yamaha/latest_news/latestnews.js similarity index 84% rename from pages/yamaha/latestnews.js rename to pages/yamaha/latest_news/latestnews.js index cb29667..245f901 100644 --- a/pages/yamaha/latestnews.js +++ b/pages/yamaha/latest_news/latestnews.js @@ -8,9 +8,9 @@ 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"; +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); @@ -46,7 +46,7 @@ export async function getServerSideProps(context) { var news = []; const backend = process.env.BACKEND_SERVER_URI; - var res = await GetLatestNews.GetNews(); + var res = await GetLatestNews.GetNewsYamaha(); if (res["STATUS"] === 1) { news = res["DATA"]["latestNews"]; } diff --git a/pages/yamaha/latestnews_details.js b/pages/yamaha/latest_news/latestnews_details.js similarity index 85% rename from pages/yamaha/latestnews_details.js rename to pages/yamaha/latest_news/latestnews_details.js index 5b8e8b4..a255eb3 100644 --- a/pages/yamaha/latestnews_details.js +++ b/pages/yamaha/latest_news/latestnews_details.js @@ -8,9 +8,9 @@ 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"; +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); @@ -53,7 +53,7 @@ export async function getServerSideProps(context) { news = res["DATA"]["latestNews"]; } - var res = await GetLatestNews.GetOtherNews(); + var res = await GetLatestNews.GetOtherNewsYamaha(); if (res["STATUS"] === 1) { othernews = res["DATA"]["latestNews"]; }