diff --git a/api/product/accessories.js b/api/product/accessories.js
index 3806975..00222d9 100644
--- a/api/product/accessories.js
+++ b/api/product/accessories.js
@@ -40,7 +40,70 @@ async function GetYamalube(token="") {
return res;
}
+async function GetHelmet(token="") {
+ var res = await apollo.query(
+ `
+ query {
+ accessories(where: { category: "Helmet" }) {
+ id
+ name
+ description
+ price
+ part_code
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetApparel(token="") {
+ var res = await apollo.query(
+ `
+ query {
+ accessories(where: { category: "Apparel" }) {
+ id
+ name
+ description
+ price
+ part_code
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
+async function GetAccessories(token="") {
+ var res = await apollo.query(
+ `
+ query {
+ accessories(where: { category: "Accessories" }) {
+ id
+ name
+ description
+ price
+ part_code
+ img {
+ url
+ }
+ }
+ }`,
+ token
+ );
+ return res;
+}
+
module.exports = {
GetYGP:GetYGP,
GetYamalube:GetYamalube,
+ GetHelmet:GetHelmet,
+ GetApparel:GetApparel,
+ GetAccessories:GetAccessories,
};
\ No newline at end of file
diff --git a/api/product/product.js b/api/product/product.js
index 15e446e..2bd8e03 100644
--- a/api/product/product.js
+++ b/api/product/product.js
@@ -45,9 +45,7 @@ async function GetDetailProduct(id, token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
} `,
@@ -78,9 +76,7 @@ async function GetProductYamaha(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -108,9 +104,7 @@ async function GetProductSuzuki(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -138,9 +132,7 @@ async function GetProductHonda(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -168,9 +160,7 @@ async function GetProductHino(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -198,9 +188,7 @@ async function GetProductMercedes(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -228,9 +216,7 @@ async function GetProductBPR(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -258,9 +244,7 @@ async function GetProductEmilia(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
@@ -288,9 +272,7 @@ async function GetProductHomes(token="") {
}
overview
specification
- film{
- url
- }
+ film
stock
}
}`,
diff --git a/assets/img/yamalube.jpg b/assets/img/yamalube.jpg
new file mode 100644
index 0000000..ef83fb7
Binary files /dev/null and b/assets/img/yamalube.jpg differ
diff --git a/assets/img/ygp.jpg b/assets/img/ygp.jpg
new file mode 100644
index 0000000..f5a1528
Binary files /dev/null and b/assets/img/ygp.jpg differ
diff --git a/components/Header/HeaderLinks.js b/components/Header/HeaderLinks.js
index 128d076..80f8dae 100644
--- a/components/Header/HeaderLinks.js
+++ b/components/Header/HeaderLinks.js
@@ -15,7 +15,6 @@ import { Apps, ShareTwoTone } from "@material-ui/icons";
// core components
import CustomDropdown from "components/CustomDropdown/CustomDropdown.js";
import Button from "components/CustomButtons/Button.js";
-
import styles from "assets/jss/nextjs-material-kit/components/headerLinksStyle.js";
const useStyles = makeStyles(styles);
@@ -54,16 +53,16 @@ export default function HeaderLinks(props) {
YGP
,
-
+
Yamalube
,
-
+
Helmet
,
-
+
Apparel
,
-
+
Accessories
,
@@ -154,4 +153,4 @@ export default function HeaderLinks(props) {
);
-}
+}
\ No newline at end of file
diff --git a/pages-sections/product/accessories.js b/pages-sections/product/accessories.js
new file mode 100644
index 0000000..af79655
--- /dev/null
+++ b/pages-sections/product/accessories.js
@@ -0,0 +1,64 @@
+import React from "react";
+import classNames from "classnames";
+import { makeStyles } from "@material-ui/core/styles";
+
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
+import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
+import Card from "components/Card/Card.js";
+import CardBody from "components/Card/CardBody.js";
+import GridContainer from "components/Grid/GridContainer.js";
+import GridItem from "components/Grid/GridItem.js";
+
+const useStyles = makeStyles(styles);
+
+const DataAccessories = function ({ backend, accessories, ...props }) {
+ const classes = useStyles();
+ const { ...rest } = props;
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const ProductAccessories = accessories.map((data) => {
+ console.log(data);
+ return (
+
+
+
+
{data.name}
+ Rp.{data.price}
+
+ open_in_new Detail Product
+
+
+
+ );
+ })
+ return (
+
+
+
+
+
Yamaha Accessories
+
+ {ProductAccessories}
+ {ProductAccessories}
+
+
+
+
+
+ );
+}
+
+export default DataAccessories;
\ No newline at end of file
diff --git a/pages-sections/product/accessories_details.js b/pages-sections/product/accessories_details.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages-sections/product/apparel.js b/pages-sections/product/apparel.js
new file mode 100644
index 0000000..c7ecb05
--- /dev/null
+++ b/pages-sections/product/apparel.js
@@ -0,0 +1,64 @@
+import React from "react";
+import classNames from "classnames";
+import { makeStyles } from "@material-ui/core/styles";
+
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
+import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
+import Card from "components/Card/Card.js";
+import CardBody from "components/Card/CardBody.js";
+import GridContainer from "components/Grid/GridContainer.js";
+import GridItem from "components/Grid/GridItem.js";
+
+const useStyles = makeStyles(styles);
+
+const DataApparel = function ({ backend, apparel, ...props }) {
+ const classes = useStyles();
+ const { ...rest } = props;
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const ProductApparel = apparel.map((data) => {
+ return (
+
+
+
+
{data.name}
+ Rp.{data.price}
+
+ open_in_new Detail Product
+
+
+
+ );
+ })
+ return (
+
+
+
+
+
Yamaha Apparel
+
+ {ProductApparel}
+ {ProductApparel}
+ {ProductApparel}
+
+
+
+
+
+ );
+}
+
+export default DataApparel;
\ No newline at end of file
diff --git a/pages-sections/product/apparel_details.js b/pages-sections/product/apparel_details.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages-sections/product/helmet.js b/pages-sections/product/helmet.js
new file mode 100644
index 0000000..22f0b3a
--- /dev/null
+++ b/pages-sections/product/helmet.js
@@ -0,0 +1,62 @@
+import React from "react";
+import classNames from "classnames";
+import { makeStyles } from "@material-ui/core/styles";
+
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
+import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
+import Card from "components/Card/Card.js";
+import CardBody from "components/Card/CardBody.js";
+import GridContainer from "components/Grid/GridContainer.js";
+import GridItem from "components/Grid/GridItem.js";
+
+const useStyles = makeStyles(styles);
+
+const DataHelmet = function ({ backend, helmet, ...props }) {
+ const classes = useStyles();
+ const { ...rest } = props;
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const ProductHelmet = helmet.map((data) => {
+ return (
+
+
+
+
{data.name}
+ Rp.{data.price}
+
+ open_in_new Detail Product
+
+
+
+ );
+ })
+ return (
+
+
+
+
+
Yamaha Helmet
+
+ {ProductHelmet}{ProductHelmet}{ProductHelmet}
+
+
+
+
+
+ );
+}
+
+export default DataHelmet;
\ No newline at end of file
diff --git a/pages-sections/product/helmet_details.js b/pages-sections/product/helmet_details.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages-sections/product/product.js b/pages-sections/product/product.js
index 01baf04..b583e67 100644
--- a/pages-sections/product/product.js
+++ b/pages-sections/product/product.js
@@ -39,7 +39,7 @@ const DataProduct = function ({ backend, yamaha, suzuki, honda, hino, mercedes,
Rp.{data.price}
open_in_new Detail Product
diff --git a/pages-sections/product/yamalube.js b/pages-sections/product/yamalube.js
new file mode 100644
index 0000000..74e032d
--- /dev/null
+++ b/pages-sections/product/yamalube.js
@@ -0,0 +1,62 @@
+import React from "react";
+import classNames from "classnames";
+import { makeStyles } from "@material-ui/core/styles";
+
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
+import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
+import Card from "components/Card/Card.js";
+import CardBody from "components/Card/CardBody.js";
+import GridContainer from "components/Grid/GridContainer.js";
+import GridItem from "components/Grid/GridItem.js";
+
+const useStyles = makeStyles(styles);
+
+const DataYamalube = function ({ backend, yamalube, ...props }) {
+ const classes = useStyles();
+ const { ...rest } = props;
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const ProductYamalube = yamalube.map((data) => {
+ return (
+
+
+
+
{data.name}
+ Rp.{data.price}
+
+ open_in_new Detail Product
+
+
+
+ );
+ })
+ return (
+
+
+
+
+
Yamalube Oil
+
+ {ProductYamalube}
+
+
+
+
+
+ );
+}
+
+export default DataYamalube;
\ No newline at end of file
diff --git a/pages-sections/product/yamalube_details.js b/pages-sections/product/yamalube_details.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages-sections/product/ygp.js b/pages-sections/product/ygp.js
index a9916fc5..f1d7774 100644
--- a/pages-sections/product/ygp.js
+++ b/pages-sections/product/ygp.js
@@ -1,25 +1,58 @@
import React from "react";
+import classNames from "classnames";
import { makeStyles } from "@material-ui/core/styles";
+import Button from "components/CustomButtons/Button.js";
+import Icon from "@material-ui/core/Icon";
import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js";
import Card from "components/Card/Card.js";
import CardBody from "components/Card/CardBody.js";
-import CardHeader from "components/Card/CardHeader.js";
+import GridContainer from "components/Grid/GridContainer.js";
+import GridItem from "components/Grid/GridItem.js";
const useStyles = makeStyles(styles);
const DataYGP = function ({ backend, ygp, ...props }) {
const classes = useStyles();
+ const { ...rest } = props;
+ const imageClasses = classNames(
+ classes.imgRaised,
+ classes.imgRoundedCircle,
+ classes.imgFluid
+ );
+ const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
+ const ProductYGP = ygp.map((data) => {
+ return (
+
+
+
+
{data.name}
+ Rp.{data.price}
+
+ open_in_new Detail Product
+
+
+
+ );
+ })
return (
-
-
- Yamaha Geniue Part
-
-
+
Yamaha Geniue Part
+
+ {ProductYGP}{ProductYGP}
+
+
diff --git a/pages-sections/product/ygp_details.js b/pages-sections/product/ygp_details.js
new file mode 100644
index 0000000..e69de29
diff --git a/pages/product/accessories.js b/pages/product/accessories.js
new file mode 100644
index 0000000..d5a75bc
--- /dev/null
+++ b/pages/product/accessories.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 GetDataAccessories from "../../api/product/accessories.js";
+import DataAccessories from "../../pages-sections/product/accessories.js";
+import DataSnackbarContent from "../../pages-sections/snackbar.js";
+
+const useStyles = makeStyles(styles);
+
+const Accessories = function ({ 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 = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ var res = await GetDataAccessories.GetAccessories();
+ if (res["STATUS"] === 1) {
+ accessories = res["DATA"]["accessories"];
+ }
+
+ return {
+ props: { accessories, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/product/apparel.js b/pages/product/apparel.js
new file mode 100644
index 0000000..46e26c8
--- /dev/null
+++ b/pages/product/apparel.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 GetDataApparel from "../../api/product/accessories.js";
+import DataApparel from "../../pages-sections/product/apparel.js";
+import DataSnackbarContent from "../../pages-sections/snackbar.js";
+
+const useStyles = makeStyles(styles);
+
+const Apparel = function ({ apparel, 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 = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ var res = await GetDataApparel.GetApparel();
+ if (res["STATUS"] === 1) {
+ apparel = res["DATA"]["accessories"];
+ }
+
+ return {
+ props: { apparel, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/product/helmet.js b/pages/product/helmet.js
new file mode 100644
index 0000000..4006029
--- /dev/null
+++ b/pages/product/helmet.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 GetDataHelmet from "../../api/product/accessories.js";
+import DataHelmet from "../../pages-sections/product/helmet.js";
+import DataSnackbarContent from "../../pages-sections/snackbar.js";
+
+const useStyles = makeStyles(styles);
+
+const Helmet = function ({ helmet, backend, ...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 = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ var res = await GetDataHelmet.GetHelmet();
+ if (res["STATUS"] === 1) {
+ helmet = res["DATA"]["accessories"];
+ }
+
+ return {
+ props: { helmet, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/product/yamalube.js b/pages/product/yamalube.js
new file mode 100644
index 0000000..8110ed6
--- /dev/null
+++ b/pages/product/yamalube.js
@@ -0,0 +1,58 @@
+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 GetDataYamalube from "../../api/product/accessories.js";
+import DataYamalube from "../../pages-sections/product/yamalube.js";
+import DataSnackbarContent from "../../pages-sections/snackbar.js";
+
+const useStyles = makeStyles(styles);
+
+const Yamalube = function ({ 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 = [];
+ const backend = process.env.BACKEND_SERVER_URI;
+
+ var res = await GetDataYamalube.GetYamalube();
+ console.log(res);
+
+ if (res["STATUS"] === 1) {
+ yamalube = res["DATA"]["accessories"];
+ }
+
+ return {
+ props: { yamalube, backend }, // will be passed to the page component as props
+ };
+}
\ No newline at end of file
diff --git a/pages/product/ygp.js b/pages/product/ygp.js
index b624e6e..1428a79 100644
--- a/pages/product/ygp.js
+++ b/pages/product/ygp.js
@@ -5,15 +5,16 @@ 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 DataYGP from "pages-sections/product/ygp.js";
import Parallax from "components/Parallax/Parallax.js";
import styles from "assets/jss/nextjs-material-kit/pages/components.js";
-import GetAccessories from "../../api/product/accessories.js";
+import GetDataYGP from "../../api/product/accessories.js";
+import DataYGP from "../../pages-sections/product/ygp.js";
+import DataSnackbarContent from "../../pages-sections/snackbar.js";
const useStyles = makeStyles(styles);
-const Product = function ({ backend, ygp, ...props }) {
+const YGP = function ({ ygp, backend, ...props }) {
const classes = useStyles();
const { ...rest } = props;
return (
@@ -28,27 +29,30 @@ const Product = function ({ backend, ygp, ...props }) {
}}
{...rest}
/>
-
+
-
+
+
);
};
-export default Product;
+export default YGP;
export async function getServerSideProps(context) {
var ygp = [];
const backend = process.env.BACKEND_SERVER_URI;
- var res = await GetAccessories.GetYGP();
+ var res = await GetDataYGP.GetYGP();
+ console.log(res);
+
if (res["STATUS"] === 1) {
ygp = res["DATA"]["accessories"];
}
return {
- props: { backend, ygp, }, // will be passed to the page component as props
+ props: { ygp, backend }, // will be passed to the page component as props
};
-}
+}
\ No newline at end of file