From c90376c654b12ac8eae78579fb45f3938df3ab3d Mon Sep 17 00:00:00 2001 From: Yusmardianto Date: Wed, 17 Mar 2021 08:58:25 +0700 Subject: [PATCH] yarn build --- api/carrer/carrer.js | 12 -- api/dealer/dealer.js | 52 +----- api/product/accessories.js | 10 -- api/product/product.js | 305 +++++++++++++--------------------- components/Footer/Footer.js | 118 +++++++------ components/Header/HeaderLinks.js | 41 +++-- pages-sections/dealers/dealers.js | 59 +++---- pages-sections/dealers/filter.js | 28 ---- pages-sections/home/carousel.js | 13 ++ pages-sections/home/feature.js | 119 +++++++++++++ pages-sections/home/sosmed.js | 9 - pages-sections/latest_news/news.js | 1 + pages-sections/product/accessories.js | 1 - pages-sections/product/product.js | 192 +++++++++------------ pages-sections/product/ygp.js | 6 +- pages/carrer.js | 5 +- pages/dealers.js | 26 ++- pages/home.js | 3 + pages/product/product.js | 98 +++++------ pages/product/ygp.js | 1 - 20 files changed, 516 insertions(+), 583 deletions(-) delete mode 100644 pages-sections/dealers/filter.js create mode 100644 pages-sections/home/feature.js diff --git a/api/carrer/carrer.js b/api/carrer/carrer.js index 94a2811..5f990ed 100644 --- a/api/carrer/carrer.js +++ b/api/carrer/carrer.js @@ -8,10 +8,6 @@ async function GetCarrerS1(token="") { { id name - description - img{ - url - } start_regis until_regis name_description @@ -30,10 +26,6 @@ async function GetCarrerD3(token="") { { id name - description - img{ - url - } start_regis until_regis name_description @@ -52,10 +44,6 @@ async function GetCarrerSMA(token="") { { id name - description - img{ - url - } start_regis until_regis name_description diff --git a/api/dealer/dealer.js b/api/dealer/dealer.js index 1e95c8f..1531a56 100644 --- a/api/dealer/dealer.js +++ b/api/dealer/dealer.js @@ -1,11 +1,12 @@ import apollo from "../../lib/apollo.js"; -async function GetDealers(token="") { +async function GetDealers(filter, token="") { var res = await apollo.query( ` - query { + query { ${(filter!="")?`name: "${filter}"`:""} dealers { + id name kota_dealer address @@ -20,53 +21,6 @@ async function GetDealers(token="") { return res; } -async function GetDealersDetails(token="") { - var res = await apollo.query( - ` - query($input: ID!) { - dealers(where:{id:$input}) - { - name - kota_dealer - address - telp - email - location - } - } - `, - token, - { - "input": id - } - ); - return res; -} - -async function GetDealersbyFilter(token="") { - var res = await apollo.query( - ` - query($input: ID!) { - dealers(where:{id:$input}) - { - name - kota_dealer - address - telp - email - location - } - } - `, - token, - { - "input": id - } - ); - return res; -} - module.exports = { GetDealers: GetDealers, - GetDealersDetails: GetDealersDetails, }; \ No newline at end of file diff --git a/api/product/accessories.js b/api/product/accessories.js index c131c5c..e01c654 100644 --- a/api/product/accessories.js +++ b/api/product/accessories.js @@ -7,9 +7,7 @@ async function GetYGP(filter, token="") { accessories(where: { category: "YGP" ${(filter!="")?`name: "${filter}"`:""}}) { id name - description price - part_code img { url } @@ -27,9 +25,7 @@ async function GetYamalube(filter, token="") { accessories(where: { category: "Yamalube" ${(filter!="")?`name: "${filter}"`:""}}) { id name - description price - part_code img { url } @@ -47,9 +43,7 @@ async function GetHelmet(filter, token="") { accessories(where: { category: "Helmet" ${(filter!="")?`name: "${filter}"`:""}}) { id name - description price - part_code img { url } @@ -67,9 +61,7 @@ async function GetApparel(filter, token="") { accessories(where: { category: "Apparel" ${(filter!="")?`name: "${filter}"`:""}}) { id name - description price - part_code img { url } @@ -87,9 +79,7 @@ async function GetAccessories(filter, token="") { accessories(where: { category: "Accessories" ${(filter!="")?`name: "${filter}"`:""}}) { id name - description price - part_code img { url } diff --git a/api/product/product.js b/api/product/product.js index 2bd8e03..2212b17 100644 --- a/api/product/product.js +++ b/api/product/product.js @@ -1,35 +1,8 @@ import apollo from "../../lib/apollo.js"; -// async function GetProduct(token="", start = 0) { -// var res = await apollo.query( -// ` -// query($start: Int!) { -// products(limit:1,start:$start) -// { -// id -// name -// price -// description -// img{ -// url -// } -// business_partner -// { -// name -// } -// } -// }`, -// token, -// { -// start: start, -// } -// ); -// return res; -// } - -async function GetDetailProduct(id, token="") { - var res = await apollo.query( - ` +async function GetDetailProduct(id, token = "") { + var res = await apollo.query( + ` query($input: ID!){ products(where:{id:$input}) { @@ -39,257 +12,209 @@ async function GetDetailProduct(id, token="") { img{ url } - business_partner - { - name - } overview specification film stock } } `, - token, - { + token, { "input": id } - ); - return res; + ); + return res; } -async function GetProductYamaha(token="") { - var res = await apollo.query( - ` +async function GetProductMatic(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "1"}) - { + products(where: { categories: "matic" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductSuzuki(token="") { - var res = await apollo.query( - ` +async function GetProductMaxi(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "2"}) - { + products(where: { categories: "maxi" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductHonda(token="") { - var res = await apollo.query( - ` +async function GetProductNaked(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "3"}) - { + products(where: { categories: "naked" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductHino(token="") { - var res = await apollo.query( - ` +async function GetProductSport(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "4"}) - { + products(where: { categories: "sport" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductMercedes(token="") { - var res = await apollo.query( - ` +async function GetProductOffRoad(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "5"}) - { + products(where: { categories: "offroad" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductBPR(token="") { - var res = await apollo.query( - ` +async function GetProductMoped(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "6"}) - { + products(where: { categories: "moped" }) { id name - description price - img{ + img { url } - business_partner - { - name - } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductEmilia(token="") { - var res = await apollo.query( - ` +async function GetProductMonsterEnergy(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "8"}) - { + products(where: { categories: "monsterenergy" }) { id name - description price - img{ + img { url } - business_partner - { - name + } + }`, + token + ); + return res; +} + +async function GetProductCBU(token = "") { + var res = await apollo.query( + ` + query { + products(where: { categories: "cbu" }) { + id + name + price + img { + url } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } -async function GetProductHomes(token="") { - var res = await apollo.query( - ` +async function GetProductATV(token = "") { + var res = await apollo.query( + ` query { - products(where: {business_partner: "9"}) - { + products(where: { categories: "atv" }) { id name - description price - img{ + img { url } - business_partner - { - name + } + }`, + token + ); + return res; +} + +async function GetProductPowerProduct(token = "") { + var res = await apollo.query( + ` + query { + products(where: { categories: "powerproduct" }) { + id + name + price + img { + url } - overview - specification - film - stock } }`, - token - ); - return res; + token + ); + return res; } module.exports = { - // GetProduct: GetProduct, - GetDetailProduct:GetDetailProduct, - GetProductYamaha:GetProductYamaha, - GetProductSuzuki:GetProductSuzuki, - GetProductHonda:GetProductHonda, - GetProductHino:GetProductHino, - GetProductMercedes:GetProductMercedes, - GetProductBPR:GetProductBPR, - GetProductEmilia:GetProductEmilia, - GetProductHomes:GetProductHomes, + GetDetailProduct: GetDetailProduct, + GetProductMatic: GetProductMatic, + GetProductMaxi: GetProductMaxi, + GetProductNaked: GetProductNaked, + GetProductSport: GetProductSport, + GetProductOffRoad: GetProductOffRoad, + GetProductMoped: GetProductMoped, + GetProductMonsterEnergy: GetProductMonsterEnergy, + GetProductCBU: GetProductCBU, + GetProductATV: GetProductATV, + GetProductPowerProduct: GetProductPowerProduct, }; \ No newline at end of file diff --git a/components/Footer/Footer.js b/components/Footer/Footer.js index 1a59a2a..2c1c83f 100644 --- a/components/Footer/Footer.js +++ b/components/Footer/Footer.js @@ -11,6 +11,10 @@ import { makeStyles } from "@material-ui/core/styles"; // @material-ui/icons import Favorite from "@material-ui/icons/Favorite"; +import GridContainer from "components/Grid/GridContainer.js"; +import Grid from '@material-ui/core/Grid'; +import Paper from '@material-ui/core/Paper'; +import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/components/footerStyle.js"; const useStyles = makeStyles(styles); @@ -27,60 +31,72 @@ export default function Footer(props) { [classes.footerWhiteFont]: whiteFont }); return ( - + + + ); } diff --git a/components/Header/HeaderLinks.js b/components/Header/HeaderLinks.js index 2d687a9..f798b68 100644 --- a/components/Header/HeaderLinks.js +++ b/components/Header/HeaderLinks.js @@ -24,19 +24,22 @@ export default function HeaderLinks(props) { return ( - + + + - - + Service , + + Dealers + , ]} /> - - - - - - + - + - + - + - + - {/* + - */} + ); } \ No newline at end of file diff --git a/pages-sections/dealers/dealers.js b/pages-sections/dealers/dealers.js index 6726d89..6a0abc7 100644 --- a/pages-sections/dealers/dealers.js +++ b/pages-sections/dealers/dealers.js @@ -13,15 +13,9 @@ import Button from "components/CustomButtons/Button.js"; import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; const useStyles = makeStyles(styles); -const DataDealer = function ({ backend, dealers, ...props }) { +const DataDealer = function ({ selected, handleName, backend, dealers, ...props }) { const classes = useStyles(); - - // const handleKotaDealer = value => { - // console.log(value) - // } - const handleName = values => { - console.log(values) - } + const Dealers = dealers.map((data) => { return (
@@ -49,32 +43,29 @@ const DataDealer = function ({ backend, dealers, ...props }) { ); }) return ( -
-
-

Dealers & Service

-
- `${option.kota_dealer} ${option.kota_dealer}`} - getOptionValue={option => option.id} - options={dealers} - instanceId="kota_dealer" - placeholder="filter by Kota Dealer" - onChange={value => handleKotaDealer(value.map(kota_dealer => kota_dealer.id))} - /> */} -
- - {Dealers} - -
+
+ + +
+

Yamaha Dealers

+ -
-
- ); -} - -export default DataSnackbarContent; \ No newline at end of file diff --git a/pages-sections/home/carousel.js b/pages-sections/home/carousel.js index 2260c57..f0fc7f0 100644 --- a/pages-sections/home/carousel.js +++ b/pages-sections/home/carousel.js @@ -6,6 +6,7 @@ import GridItem from "components/Grid/GridItem.js"; import Card from "components/Card/Card.js"; import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; import Carousel from "react-slick"; +import Grid from '@material-ui/core/Grid'; const useStyles = makeStyles(styles); const DataCarousel = function ({ backend, carousel, ...props }) { @@ -39,6 +40,18 @@ const DataCarousel = function ({ backend, carousel, ...props }) { + + + +