diff --git a/.env-sample b/.env-sample new file mode 100644 index 0000000..c888f22 --- /dev/null +++ b/.env-sample @@ -0,0 +1,2 @@ +API_URL=http://127.0.0.1:1337 +graphql_uri=http://127.0.0.1:1337/graphql \ No newline at end of file diff --git a/api/home.js b/api/home.js deleted file mode 100644 index 3a3759d..0000000 --- a/api/home.js +++ /dev/null @@ -1,20 +0,0 @@ -import apollo from "../lib/apollo.js"; - -async function GET(token="") { - var res = await apollo.query( - ` - query{ - businessPartners - { - name - } - } - `, - token - ); - return res; -} - -module.exports = { - GET: GET, -}; \ No newline at end of file diff --git a/api/home/businessPartner.js b/api/home/businessPartner.js new file mode 100644 index 0000000..012a280 --- /dev/null +++ b/api/home/businessPartner.js @@ -0,0 +1,23 @@ +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/home/carousel.js b/api/home/carousel.js new file mode 100644 index 0000000..31330e8 --- /dev/null +++ b/api/home/carousel.js @@ -0,0 +1,22 @@ +import apollo from "../../lib/apollo.js"; + +async function GetCarousels(token="") { + var res = await apollo.query( + ` + query{ + carousels + { + img{ + url + } + } + } + `, + token + ); + return res; +} + +module.exports = { + GetCarousels: GetCarousels, +}; \ No newline at end of file diff --git a/api/home/service.js b/api/home/service.js new file mode 100644 index 0000000..0f0d3e5 --- /dev/null +++ b/api/home/service.js @@ -0,0 +1,23 @@ +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/latest_news/news.js b/api/latest_news/news.js new file mode 100644 index 0000000..459e949 --- /dev/null +++ b/api/latest_news/news.js @@ -0,0 +1,24 @@ +import apollo from "../../lib/apollo.js"; + +async function GetNews(token="") { + var res = await apollo.query( + ` + query{ + latestNews + { + title + description + img{ + url + } + } + } + `, + token + ); + return res; +} + +module.exports = { + GetNews: GetNews, +}; \ No newline at end of file diff --git a/api/product/product.js b/api/product/product.js new file mode 100644 index 0000000..bd5e2e2 --- /dev/null +++ b/api/product/product.js @@ -0,0 +1,23 @@ +import apollo from "../../lib/apollo.js"; + +async function GetProduct(token="") { + var res = await apollo.query( + ` + query{ + products + { + name + description + img{ + id + } + } + } `, + token + ); + return res; +} + +module.exports = { + GetProduct: GetProduct, +}; \ No newline at end of file diff --git a/lib/apollo.js b/lib/apollo.js index 0054245..b20900f 100644 --- a/lib/apollo.js +++ b/lib/apollo.js @@ -7,10 +7,12 @@ import { } from "@apollo/client"; import { createUploadLink } from "apollo-upload-client"; import ApolloConfig from "../config/apollo-config"; +import fetch from "cross-fetch"; function initApollo(token) { const httpLink = createUploadLink({ uri: ApolloConfig.graphql_uri, + fetch: fetch, headers: token != "" ? { diff --git a/package.json b/package.json index ab9f810..daf80b1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "dev": "next", + "dev": "next dev", "build": "next build", "start": "next start", "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && rm -rf .next/ && npm install && npm run dev" @@ -37,8 +37,11 @@ "@material-ui/icons": "4.9.1", "@zeit/next-sass": "1.0.1", "apollo": "^2.32.1", + "apollo-upload-client": "^14.1.3", "classnames": "2.2.6", + "cross-fetch": "^3.0.6", "dotenv": "^8.2.0", + "graphql": "^15.3.0", "mdbreact": "^5.0.1", "moment": "2.25.3", "next": "9.3.6", @@ -56,8 +59,6 @@ "react-swipeable-views": "0.13.9", "rsuite": "^4.8.6", "styled-components": "5.1.0", - "webpack": "4.43.0", - "apollo-upload-client": "^14.1.3", - "graphql": "^15.3.0" + "webpack": "4.43.0" } } diff --git a/pages-sections/Components-Sections/SectionBasics.js b/pages-sections/Components-Sections/SectionBasics.js deleted file mode 100644 index 595b27c..0000000 --- a/pages-sections/Components-Sections/SectionBasics.js +++ /dev/null @@ -1,613 +0,0 @@ -import React from "react"; -// plugin that creates slider -import Slider from "nouislider"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -import InputAdornment from "@material-ui/core/InputAdornment"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; -import Radio from "@material-ui/core/Radio"; -import Switch from "@material-ui/core/Switch"; -// @material-ui/icons -import Favorite from "@material-ui/icons/Favorite"; -import People from "@material-ui/icons/People"; -import Check from "@material-ui/icons/Check"; -import FiberManualRecord from "@material-ui/icons/FiberManualRecord"; -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Button from "components/CustomButtons/Button.js"; -import CustomInput from "components/CustomInput/CustomInput.js"; -import CustomLinearProgress from "components/CustomLinearProgress/CustomLinearProgress.js"; -import Paginations from "components/Pagination/Pagination.js"; -import Badge from "components/Badge/Badge.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/basicsStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionBasics() { - const classes = useStyles(); - const [checked, setChecked] = React.useState([24, 22]); - const [selectedEnabled, setSelectedEnabled] = React.useState("b"); - const [checkedA, setCheckedA] = React.useState(true); - const [checkedB, setCheckedB] = React.useState(false); - React.useEffect(() => { - if ( - !document - .getElementById("sliderRegular") - .classList.contains("noUi-target") - ) { - Slider.create(document.getElementById("sliderRegular"), { - start: [40], - connect: [true, false], - step: 1, - range: { min: 0, max: 100 } - }); - } - if ( - !document.getElementById("sliderDouble").classList.contains("noUi-target") - ) { - Slider.create(document.getElementById("sliderDouble"), { - start: [20, 60], - connect: [false, true, false], - step: 1, - range: { min: 0, max: 100 } - }); - } - return function cleanup() {}; - }); - const handleToggle = value => { - const currentIndex = checked.indexOf(value); - const newChecked = [...checked]; - - if (currentIndex === -1) { - newChecked.push(value); - } else { - newChecked.splice(currentIndex, 1); - } - setChecked(newChecked); - }; - return ( -
-
-
-

Basic Elements

-
-
-
-

- Buttons -
- Pick your style -

-
- - - - - - - - - -
-

- Pick your size -

-
- - - - - - - -
-

- Pick your color -

-
- - - - - - - - - - - -
-
-
-
-

Inputs

-
- - - - - - - - - - - - - - - - - - ) - }} - /> - - - - - - ) - }} - /> - - -
-
-
- - -
-

Checkboxes

-
-
- handleToggle(21)} - checkedIcon={} - icon={} - classes={{ - checked: classes.checked, - root: classes.checkRoot - }} - /> - } - classes={{ label: classes.label, root: classes.labelRoot }} - label="Unchecked" - /> -
-
- handleToggle(22)} - checked={checked.indexOf(22) !== -1 ? true : false} - checkedIcon={} - icon={} - classes={{ - checked: classes.checked, - root: classes.checkRoot - }} - /> - } - classes={{ label: classes.label, root: classes.labelRoot }} - label="Checked" - /> -
-
- } - icon={} - classes={{ - checked: classes.checked, - root: classes.checkRoot - }} - /> - } - classes={{ - label: classes.label, - disabled: classes.disabledCheckboxAndRadio, - root: classes.labelRoot - }} - label="Disabled Unchecked" - /> -
-
- } - icon={} - classes={{ - checked: classes.checked, - root: classes.checkRoot - }} - /> - } - classes={{ - label: classes.label, - disabled: classes.disabledCheckboxAndRadio, - root: classes.labelRoot - }} - label="Disabled Checked" - /> -
-
- -
-

Radio Buttons

-
-
- setSelectedEnabled("a")} - value="a" - name="radio button enabled" - aria-label="A" - icon={ - - } - checkedIcon={ - - } - classes={{ - checked: classes.radio, - root: classes.radioRoot - }} - /> - } - classes={{ - label: classes.label, - root: classes.labelRoot - }} - label="First Radio" - /> -
-
- setSelectedEnabled("b")} - value="b" - name="radio button enabled" - aria-label="B" - icon={ - - } - checkedIcon={ - - } - classes={{ - checked: classes.radio, - root: classes.radioRoot - }} - /> - } - classes={{ - label: classes.label, - root: classes.labelRoot - }} - label="Second Radio" - /> -
-
- - } - checkedIcon={ - - } - classes={{ - checked: classes.radio, - disabled: classes.disabledCheckboxAndRadio, - root: classes.radioRoot - }} - /> - } - classes={{ - label: classes.label, - root: classes.labelRoot - }} - label="Disabled Unchecked Radio" - /> -
-
- - } - checkedIcon={ - - } - classes={{ - checked: classes.radio, - disabled: classes.disabledCheckboxAndRadio, - root: classes.radioRoot - }} - /> - } - classes={{ label: classes.label, root: classes.labelRoot }} - label="Disabled Checked Radio" - /> -
-
- -
-

Toggle Buttons

-
-
- setCheckedA(event.target.checked)} - value="checkedA" - classes={{ - switchBase: classes.switchBase, - checked: classes.switchChecked, - thumb: classes.switchIcon, - track: classes.switchBar - }} - /> - } - classes={{ - label: classes.label - }} - label="Toggle is on" - /> -
-
- setCheckedB(event.target.checked)} - value="checkedB" - classes={{ - switchBase: classes.switchBase, - checked: classes.switchChecked, - thumb: classes.switchIcon, - track: classes.switchBar - }} - /> - } - classes={{ - label: classes.label - }} - label="Toggle is off" - /> -
-
-
-
-
-
- - -
-

Progress Bars

-
- - - - - -
- -
-

Pagination

-
- - -
-
-
-
- - -
-

Sliders

-
-
-
-
- - -
-

Badges

-
- default - primary - info - success - warning - danger - rose -
- -
-
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionChart.js b/pages-sections/Components-Sections/SectionChart.js deleted file mode 100644 index 4eeeecf..0000000 --- a/pages-sections/Components-Sections/SectionChart.js +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -// nodejs library that concatenates classes -import classNames from "classnames"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons -import Dashboard from "@material-ui/icons/Dashboard"; -import LocalGroceryStoreIcon from "@material-ui/icons/LocalGroceryStore"; - -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import NavPills from "components/NavPills/NavPills.js"; -import Card from "components/Card/Card.js"; -import CardBody from "components/Card/CardBody.js"; -import CardHeader from "components/Card/CardHeader.js"; -import CardFooter from "components/Card/CardFooter.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js"; - -const useStyles = makeStyles(styles); - -export default function ProfilePage(props) { - const classes = useStyles(); - const { ...rest } = props; - const imageClasses = classNames( - classes.imgRaised, - classes.imgRoundedCircle, - classes.imgFluid - ); - const navImageClasses = classNames(classes.imgRounded, classes.imgGallery); - return ( - -
- Home -
- -
-

Dashboard

-
-
- - © 2020 , All Right Reserved by @Thamrin Brother Company - -
- ); -} diff --git a/pages-sections/Components-Sections/SectionCompletedExamples.js b/pages-sections/Components-Sections/SectionCompletedExamples.js deleted file mode 100644 index 0e7c12a..0000000 --- a/pages-sections/Components-Sections/SectionCompletedExamples.js +++ /dev/null @@ -1,33 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons - -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/completedStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionCompletedExamples() { - const classes = useStyles(); - return ( -
-
- - -

Completed with examples

-

- The kit comes with three pre-built pages to help you get started - faster. You can change the text and images and you{"'"}re good to - go. More importantly, looking at them will give you a picture of - what you can build with this powerful kit. -

-
-
-
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionContent.js b/pages-sections/Components-Sections/SectionContent.js deleted file mode 100644 index 98610cb..0000000 --- a/pages-sections/Components-Sections/SectionContent.js +++ /dev/null @@ -1,250 +0,0 @@ -import React from "react"; - -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// Component -import SnackbarContent from "components/Snackbar/SnackbarContent.js"; -import Clearfix from "components/Clearfix/Clearfix.js"; -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Grid from '@material-ui/core/Grid'; -import Paper from '@material-ui/core/Paper'; -import CardBody from "components/Card/CardBody.js"; -import Card from "components/Card/Card.js"; -import Button from "components/CustomButtons/Button.js"; - -// react component for creating beautiful carousel -import Carousel from "react-slick"; - -// @material-ui/icons -import LocationOn from "@material-ui/icons/LocationOn"; - -import image1 from "assets/img/bg.jpg"; -import image2 from "assets/img/bg2.png"; -import image3 from "assets/img/bg3.jpg"; -// import "assets/css/hover.css"; - -// import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/carouselStyle.js"; - - -const useStyles = makeStyles(styles); - -function SectionNotifications(props) { - const classes = useStyles(); - const settings = { - dots: true, - infinite: true, - speed: 500, - slidesToShow: 1, - slidesToScroll: 1, - autoplay: false - }; - return ( -
- - Thamrin Group bersama Anda melawan COVID-19. Untuk informasi silakan klik di sini. - - } - align="center" - color="danger" - icon="info_outline" - /> - -
-
- - - - -
- First slide -
-
- Second slide -
-
- Third slide -
-
-
-
-
-
-
-
-

Our Service

-
- - - - - - - - - - - - Card-img-cap - - - - - - - Card-img-cap - - - - -
-

Our Business Partner

-
- - - - -
- -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- Card-img-cap -
-
-
-
- - - -
- -
-
-
-
-
-
- ); -} - -export default SectionNotifications; \ No newline at end of file diff --git a/pages-sections/Components-Sections/SectionDownload.js b/pages-sections/Components-Sections/SectionDownload.js deleted file mode 100644 index 55710f1..0000000 --- a/pages-sections/Components-Sections/SectionDownload.js +++ /dev/null @@ -1,95 +0,0 @@ -/*eslint-disable*/ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Button from "components/CustomButtons/Button.js"; -// core components -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/downloadStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionDownload() { - const classes = useStyles(); - return ( -
-
- - -

Our Service

- {/*

- Cause if you do, it can be yours for FREE. Hit the buttons below - to navigate to our website where you can find the kit. We also - have the Bootstrap 4 version on plain HTML. Start a new project or - give an old Bootstrap project a new look! -

*/} -
- - - -
-
-
- {/* - -

Want more?

-

- We've just launched{" "} - e.preventDefault()}> - NextJS Material Kit PRO{" "} - - .It has a huge number of components, sections and example pages. - Start Your Development With A Badass Material-UI and NexJS Kit - inspired by Material Design. -

-
- - - - -
-
- -

Thank you for supporting us!

-
- - - - -
*/} -
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionExamples.js b/pages-sections/Components-Sections/SectionExamples.js deleted file mode 100644 index 0957b07..0000000 --- a/pages-sections/Components-Sections/SectionExamples.js +++ /dev/null @@ -1,70 +0,0 @@ -import React from "react"; -// 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 GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Button from "components/CustomButtons/Button.js"; - -import landing from "assets/img/landing.jpg"; -import profile from "assets/img/profile.jpg"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/exampleStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionExamples() { - const classes = useStyles(); - return ( - - ); -} diff --git a/pages-sections/Components-Sections/SectionJavascript.js b/pages-sections/Components-Sections/SectionJavascript.js deleted file mode 100644 index 6566c0f..0000000 --- a/pages-sections/Components-Sections/SectionJavascript.js +++ /dev/null @@ -1,288 +0,0 @@ -import React from "react"; -// react plugin for creating date-time-picker -import Datetime from "react-datetime"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -import Slide from "@material-ui/core/Slide"; -import IconButton from "@material-ui/core/IconButton"; -import Dialog from "@material-ui/core/Dialog"; -import DialogTitle from "@material-ui/core/DialogTitle"; -import DialogContent from "@material-ui/core/DialogContent"; -import DialogActions from "@material-ui/core/DialogActions"; -import InputLabel from "@material-ui/core/InputLabel"; -import FormControl from "@material-ui/core/FormControl"; -import Tooltip from "@material-ui/core/Tooltip"; -import Popover from "@material-ui/core/Popover"; -// @material-ui/icons -import LibraryBooks from "@material-ui/icons/LibraryBooks"; -import Close from "@material-ui/icons/Close"; -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Button from "components/CustomButtons/Button.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/javascriptStyles.js"; - -const useStyles = makeStyles(styles); - -const Transition = React.forwardRef(function Transition(props, ref) { - return ; -}); - -Transition.displayName = "Transition"; - -export default function SectionJavascript() { - const classes = useStyles(); - const [anchorElLeft, setAnchorElLeft] = React.useState(null); - const [anchorElTop, setAnchorElTop] = React.useState(null); - const [anchorElBottom, setAnchorElBottom] = React.useState(null); - const [anchorElRight, setAnchorElRight] = React.useState(null); - const [classicModal, setClassicModal] = React.useState(false); - return ( -
-
-
-

Javascript components

-
- - -
-

Modal

-
- - - - setClassicModal(false)} - aria-labelledby="classic-modal-slide-title" - aria-describedby="classic-modal-slide-description" - > - - setClassicModal(false)} - > - - -

Modal title

-
- -

- Far far away, behind the word mountains, far from the - countries Vokalia and Consonantia, there live the blind - texts. Separated they live in Bookmarksgrove right at the - coast of the Semantics, a large language ocean. A small - river named Duden flows by their place and supplies it - with the necessary regelialia. It is a paradisematic - country, in which roasted parts of sentences fly into your - mouth. Even the all-powerful Pointing has no control about - the blind texts it is an almost unorthographic life One - day however a small line of blind text by the name of - Lorem Ipsum decided to leave for the far World of Grammar. -

-
- - - - -
-
-
- -
-

Datetime Picker

-
- - - - Datetime Picker - -
- - - -
-
-
-
- -
-

Popovers

-
- - setAnchorElLeft(null)} - anchorOrigin={{ - vertical: "center", - horizontal: "left" - }} - transformOrigin={{ - vertical: "center", - horizontal: "right" - }} - > -

Popover on left

-
- Here will be some very useful information about his popover. - Here will be some very useful information about his popover. -
-
- - setAnchorElTop(null)} - anchorOrigin={{ - vertical: "top", - horizontal: "center" - }} - transformOrigin={{ - vertical: "bottom", - horizontal: "center" - }} - > -

Popover on top

-
- Here will be some very useful information about his popover. -
-
- - setAnchorElBottom(null)} - anchorOrigin={{ - vertical: "bottom", - horizontal: "center" - }} - transformOrigin={{ - vertical: "top", - horizontal: "center" - }} - > -

Popover on bottom

-
- Here will be some very useful information about his popover. -
-
- - setAnchorElRight(null)} - anchorOrigin={{ - vertical: "center", - horizontal: "right" - }} - transformOrigin={{ - vertical: "center", - horizontal: "left" - }} - > -

Popover on right

-
- Here will be some very useful information about his popover. -
-
-
-
-
-

Tooltips

-
- - - - - - - - - - - - -
-
-
-

Carousel

-
-
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionNavbars.js b/pages-sections/Components-Sections/SectionNavbars.js deleted file mode 100644 index 3f7d104..0000000 --- a/pages-sections/Components-Sections/SectionNavbars.js +++ /dev/null @@ -1,436 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -import List from "@material-ui/core/List"; -import ListItem from "@material-ui/core/ListItem"; -import Icon from "@material-ui/core/Icon"; -// @material-ui/icons -import Search from "@material-ui/icons/Search"; -import Email from "@material-ui/icons/Email"; -import Face from "@material-ui/icons/Face"; -import AccountCircle from "@material-ui/icons/AccountCircle"; -import Explore from "@material-ui/icons/Explore"; -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Header from "components/Header/Header.js"; -import CustomInput from "components/CustomInput/CustomInput.js"; -import CustomDropdown from "components/CustomDropdown/CustomDropdown.js"; -import Button from "components/CustomButtons/Button.js"; - -import image from "assets/img/bg.jpg"; -import profileImage from "assets/img/faces/avatar.jpg"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/navbarsStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionNavbars() { - const classes = useStyles(); - return ( -
-
- - -
-

Menu

-
-
- - - - - - - - - - - } - /> - - -
-

Menu with Icons

-
-
- - - - - - - - - - - } - /> - - -
-

Navigation

-
-
- -
- ); -} diff --git a/pages-sections/Components-Sections/SectionNotifications.js b/pages-sections/Components-Sections/SectionNotifications.js deleted file mode 100644 index ca716d9..0000000 --- a/pages-sections/Components-Sections/SectionNotifications.js +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; -// @material-ui/icons -import Check from "@material-ui/icons/Check"; -import Warning from "@material-ui/icons/Warning"; -// core components -import SnackbarContent from "components/Snackbar/SnackbarContent.js"; -import Clearfix from "components/Clearfix/Clearfix.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; - -const useStyles = makeStyles(styles); - -export default function SectionNotifications() { - const classes = useStyles(); - return ( -
-
-
-

Notifications

-
-
- - INFO ALERT: You{"'"}ve got some friends nearby, stop looking - at your phone and find them... - - } - close - color="info" - icon="info_outline" - /> - - SUCCESS ALERT: You{"'"}ve got some friends nearby, stop - looking at your phone and find them... - - } - close - color="success" - icon={Check} - /> - - WARNING ALERT: You{"'"}ve got some friends nearby, stop - looking at your phone and find them... - - } - close - color="warning" - icon={Warning} - /> - - DANGER ALERT: You{"'"}ve got some friends nearby, stop - looking at your phone and find them... - - } - close - color="danger" - icon="info_outline" - /> - -
- ); -} diff --git a/pages-sections/Components-Sections/SectionPills.js b/pages-sections/Components-Sections/SectionPills.js deleted file mode 100644 index 82eee99..0000000 --- a/pages-sections/Components-Sections/SectionPills.js +++ /dev/null @@ -1,188 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons -import Dashboard from "@material-ui/icons/Dashboard"; -import Schedule from "@material-ui/icons/Schedule"; -import List from "@material-ui/icons/List"; - -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import NavPills from "components/NavPills/NavPills.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/pillsStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionPills() { - const classes = useStyles(); - return ( -
-
- -
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionTabs.js b/pages-sections/Components-Sections/SectionTabs.js deleted file mode 100644 index f9a8132..0000000 --- a/pages-sections/Components-Sections/SectionTabs.js +++ /dev/null @@ -1,145 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons -import Face from "@material-ui/icons/Face"; -import Chat from "@material-ui/icons/Chat"; -import Build from "@material-ui/icons/Build"; -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import CustomTabs from "components/CustomTabs/CustomTabs.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/tabsStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionTabs() { - const classes = useStyles(); - return ( -
-
- -
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionTypography.js b/pages-sections/Components-Sections/SectionTypography.js deleted file mode 100644 index efa01a3..0000000 --- a/pages-sections/Components-Sections/SectionTypography.js +++ /dev/null @@ -1,202 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons - -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import Small from "components/Typography/Small.js"; -import Danger from "components/Typography/Danger.js"; -import Warning from "components/Typography/Warning.js"; -import Success from "components/Typography/Success.js"; -import Info from "components/Typography/Info.js"; -import Primary from "components/Typography/Primary.js"; -import Muted from "components/Typography/Muted.js"; -import Quote from "components/Typography/Quote.js"; - -import image from "assets/img/faces/avatar.jpg"; - -import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/typographyStyle.js"; - -const useStyles = makeStyles(styles); - -export default function SectionTypography() { - const classes = useStyles(); - return ( -
-
-
-
-

Typography

-
- -
-
Header 1
-

The Life of Material Kit

-
-
-
Header 2
-

The Life of Material Kit

-
-
-
Header 3
-

The Life of Material Kit

-
-
-
Header 4
-

The Life of Material Kit

-
-
-
Header 5
-
The Life of Material Kit
-
-
-
Header 6
-
The Life of Material Kit
-
-
-
Header 1
-

The Life of Material Kit

-
-
-
Header 2
-

The Life of Material Kit

-
-
-
Header 3
-

The Life of Material Kit

-
-
-
Header 4
-

The Life of Material Kit

-
-
-
Paragraph
-

- I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers. I understand - culture. I am the nucleus. I think that’s a responsibility that - I have, to push possibilities, to show people, this is the level - that things could be at. -

-
-
-
Quote
- -
-
-
Muted Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Primary Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Info Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Success Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Warning Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Danger Text
- - I will be the leader of a company that ends up being worth - billions of dollars, because I got the answers... - -
-
-
Small Tag
-

- Header with small subtitle -
- Use {'"Small"'} tag for the headers -

-
-
-
-
-
-
-

Images

-
-
- - -

Rounded Image

- ... -
- -

Circle Image

- ... -
- -

Rounded Raised

- ... -
- -

Circle Raised

- ... -
-
- -
-
-
-
- ); -} diff --git a/pages-sections/LandingPage-Sections/ProductSection.js b/pages-sections/LandingPage-Sections/ProductSection.js deleted file mode 100644 index bbae83c..0000000 --- a/pages-sections/LandingPage-Sections/ProductSection.js +++ /dev/null @@ -1,67 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons -import Chat from "@material-ui/icons/Chat"; -import VerifiedUser from "@material-ui/icons/VerifiedUser"; -import Fingerprint from "@material-ui/icons/Fingerprint"; -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import InfoArea from "components/InfoArea/InfoArea.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/landingPageSections/productStyle.js"; - -const useStyles = makeStyles(styles); - -export default function ProductSection() { - const classes = useStyles(); - return ( -
- - -

Let{"'"}s talk product

-
- This is the paragraph where you can write more details about your - product. Keep you user engaged by providing meaningful information. - Remember that by this time, the user is curious, otherwise he wouldn - {"'"}t scroll to get here. Add a button if you want the user to see - more. -
-
-
-
- - - - - - - - - - - -
-
- ); -} diff --git a/pages-sections/LandingPage-Sections/TeamSection.js b/pages-sections/LandingPage-Sections/TeamSection.js deleted file mode 100644 index 9e9ab5e..0000000 --- a/pages-sections/LandingPage-Sections/TeamSection.js +++ /dev/null @@ -1,163 +0,0 @@ -import React from "react"; -// nodejs library that concatenates classes -import classNames from "classnames"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons - -// core components -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 CardFooter from "components/Card/CardFooter.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/landingPageSections/teamStyle.js"; - -import team1 from "assets/img/faces/avatar.jpg"; -import team2 from "assets/img/faces/christian.jpg"; -import team3 from "assets/img/faces/kendall.jpg"; - -const useStyles = makeStyles(styles); - -export default function TeamSection() { - const classes = useStyles(); - const imageClasses = classNames( - classes.imgRaised, - classes.imgRoundedCircle, - classes.imgFluid - ); - return ( -
-

Here is our team

-
- - - - - ... - -

- Gigi Hadid -
- Model -

- -

- You can write here details about one of your team members. You - can give more details about what they do. Feel free to add - some links for people to be able to - follow them outside the site. -

-
- - - - - -
-
- - - - ... - -

- Christian Louboutin -
- Designer -

- -

- You can write here details about one of your team members. You - can give more details about what they do. Feel free to add - some links for people to be able to - follow them outside the site. -

-
- - - - -
-
- - - - ... - -

- Kendall Jenner -
- Model -

- -

- You can write here details about one of your team members. You - can give more details about what they do. Feel free to add - some links for people to be able to - follow them outside the site. -

-
- - - - - -
-
-
-
-
- ); -} diff --git a/pages-sections/LandingPage-Sections/WorkSection.js b/pages-sections/LandingPage-Sections/WorkSection.js deleted file mode 100644 index 337057c..0000000 --- a/pages-sections/LandingPage-Sections/WorkSection.js +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react"; -// @material-ui/core components -import { makeStyles } from "@material-ui/core/styles"; - -// @material-ui/icons - -// core components -import GridContainer from "components/Grid/GridContainer.js"; -import GridItem from "components/Grid/GridItem.js"; -import CustomInput from "components/CustomInput/CustomInput.js"; -import Button from "components/CustomButtons/Button.js"; - -import styles from "assets/jss/nextjs-material-kit/pages/landingPageSections/workStyle.js"; - -const useStyles = makeStyles(styles); - -export default function WorkSection() { - const classes = useStyles(); - return ( -
- - -

Work with us

-

- Divide details about your product or agency work into parts. Write a - few lines about each one and contact us about any further - collaboration. We will responde get back to you in a couple of - hours. -

-
- - - - - - - - - - - - -
-
-
-
- ); -} diff --git a/pages-sections/Components-Sections/SectionAboutUs.js b/pages-sections/SectionAboutUs.js similarity index 100% rename from pages-sections/Components-Sections/SectionAboutUs.js rename to pages-sections/SectionAboutUs.js diff --git a/pages-sections/Components-Sections/SectionCarousel.js b/pages-sections/SectionCarousel.js similarity index 100% rename from pages-sections/Components-Sections/SectionCarousel.js rename to pages-sections/SectionCarousel.js diff --git a/pages-sections/Components-Sections/SectionCarrer.js b/pages-sections/SectionCarrer.js similarity index 100% rename from pages-sections/Components-Sections/SectionCarrer.js rename to pages-sections/SectionCarrer.js diff --git a/pages-sections/Components-Sections/SectionLogin.js b/pages-sections/SectionLogin.js similarity index 100% rename from pages-sections/Components-Sections/SectionLogin.js rename to pages-sections/SectionLogin.js diff --git a/pages-sections/Components-Sections/SectionProduct.js b/pages-sections/SectionProduct.js similarity index 99% rename from pages-sections/Components-Sections/SectionProduct.js rename to pages-sections/SectionProduct.js index 1c147b9..5aeaf62 100644 --- a/pages-sections/Components-Sections/SectionProduct.js +++ b/pages-sections/SectionProduct.js @@ -23,7 +23,7 @@ import styles from "assets/jss/nextjs-material-kit/pages/profilePage.js"; const useStyles = makeStyles(styles); -export default function ProfilePage(props) { +const Product = function ({ product, ...props }) { const classes = useStyles(); const { ...rest } = props; const imageClasses = classNames( @@ -489,3 +489,5 @@ export default function ProfilePage(props) { ); } + +export default Product; \ No newline at end of file diff --git a/pages-sections/Components-Sections/SectionProductDetail.js b/pages-sections/SectionProductDetail.js similarity index 100% rename from pages-sections/Components-Sections/SectionProductDetail.js rename to pages-sections/SectionProductDetail.js diff --git a/pages-sections/Components-Sections/SectionService.js b/pages-sections/SectionService.js similarity index 100% rename from pages-sections/Components-Sections/SectionService.js rename to pages-sections/SectionService.js diff --git a/pages-sections/Components-Sections/SectionSimulasiCicilan.js b/pages-sections/SectionSimulasiCicilan.js similarity index 100% rename from pages-sections/Components-Sections/SectionSimulasiCicilan.js rename to pages-sections/SectionSimulasiCicilan.js diff --git a/pages-sections/Components-Sections/SectionTestDrive.js b/pages-sections/SectionTestDrive.js similarity index 100% rename from pages-sections/Components-Sections/SectionTestDrive.js rename to pages-sections/SectionTestDrive.js diff --git a/pages-sections/home/SectionContent.js b/pages-sections/home/SectionContent.js new file mode 100644 index 0000000..5a60e44 --- /dev/null +++ b/pages-sections/home/SectionContent.js @@ -0,0 +1,270 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +// Component +import SnackbarContent from "components/Snackbar/SnackbarContent.js"; +import Clearfix from "components/Clearfix/Clearfix.js"; +import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; +import GridContainer from "components/Grid/GridContainer.js"; +import GridItem from "components/Grid/GridItem.js"; +import Grid from '@material-ui/core/Grid'; +import Paper from '@material-ui/core/Paper'; +import CardBody from "components/Card/CardBody.js"; +import Card from "components/Card/Card.js"; +import Button from "components/CustomButtons/Button.js"; + +// react component for creating beautiful carousel +import Carousel from "react-slick"; + +// @material-ui/icons +import LocationOn from "@material-ui/icons/LocationOn"; + +import image1 from "assets/img/bg.jpg"; +import image2 from "assets/img/bg2.png"; +import image3 from "assets/img/bg3.jpg"; +// import "assets/css/hover.css"; + +// import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/carouselStyle.js"; + + +const useStyles = makeStyles(styles); + +const DataSnackbarContent = function() { + const classes = useStyles(); + return ( +
+ + Thamrin Group bersama Anda melawan COVID-19. Untuk informasi silakan klik di sini. + + } + align="center" + color="danger" + icon="info_outline" + /> +
+ ); +} + +const DataCarousel = function ({ carousel, ...props }) { + const classes = useStyles(); + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + time: 5 + }; + return ( +
+
+
+ + + + +
+ First slide +
+
+ Second slide +
+
+ Third slide +
+
+
+
+
+
+
+
+ ); +} + +const DataService = function ({ service, ...props }) { + const classes = useStyles(); + + const services = service.map((data) => ( + + + + + + + + + + )); + return ( +
+
+

Our Service

+
+
+ {services} +
+
+ ); +} + + const DataBusinessPartner = function ({ businessPartners, ...props }) { + const classes = useStyles(); + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + time: 5 + }; + return ( +
+
+

Our Business Partner

+
+ + + + +
+ +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ Card-img-cap +
+
+
+
+ + + +
+ +
+
+
+
+
+
+ ); +} + +module.exports = { + DataSnackbarContent: DataSnackbarContent, + DataCarousel: DataCarousel, + DataService: DataService, + DataBusinessPartner: DataBusinessPartner, +}; \ No newline at end of file diff --git a/pages-sections/home/business_partner.js b/pages-sections/home/business_partner.js new file mode 100644 index 0000000..79a7b7b --- /dev/null +++ b/pages-sections/home/business_partner.js @@ -0,0 +1,54 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +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/pages/componentsSections/notificationsStyles.js"; + +const useStyles = makeStyles(styles); +const DataBusinessPartner = function ({ backend, businessPartners, ...props }) { + const classes = useStyles(); + const BusinessPartners = businessPartners.map((data) => { + return ( + +
+ +
+ {/* src={`${variablebackenduri}/${data.img[0]["url"]}`} */} +
+ ); + }) + return ( +
+
+

Our Business Partner

+
+
+ + + {BusinessPartners[0]} + {BusinessPartners[3]} + {BusinessPartners[6]} + + + {BusinessPartners[1]} + {BusinessPartners[4]} + {BusinessPartners[7]} + + + {BusinessPartners[2]} + {BusinessPartners[5]} + {BusinessPartners[8]} + + +
+
+ ); +} + +export default DataBusinessPartner; \ No newline at end of file diff --git a/pages-sections/home/carousel.js b/pages-sections/home/carousel.js new file mode 100644 index 0000000..01a83ee --- /dev/null +++ b/pages-sections/home/carousel.js @@ -0,0 +1,53 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +// Component +import GridContainer from "components/Grid/GridContainer.js"; +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"; + +// react component for creating beautiful carousel +import Carousel from "react-slick"; + +const useStyles = makeStyles(styles); +const DataCarousel = function ({ backend, carousel, ...props }) { + const classes = useStyles(); + const settings = { + dots: true, + infinite: true, + speed: 500, + slidesToShow: 1, + slidesToScroll: 1, + autoplay: true, + time: 5 + }; + const Carousels = carousel.map((data) => { + return ( +
+ First slide +
+ ); + }) + return ( +
+
+
+ + + + + {Carousels} + + + + +
+
+
+ ); +} + +export default DataCarousel; \ No newline at end of file diff --git a/pages-sections/home/service.js b/pages-sections/home/service.js new file mode 100644 index 0000000..804314f --- /dev/null +++ b/pages-sections/home/service.js @@ -0,0 +1,45 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +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/pages/componentsSections/notificationsStyles.js"; + +const useStyles = makeStyles(styles); +const DataService = function ({ backend, service, ...props }) { + const classes = useStyles(); + const services = service.map((data, index) => ( + +
+ +
+
+ )); + return ( +
+
+

Our Service

+
+
+ + + {services[0]} + + + {services[1]} + + + {services[2]} + + +
+
+ ); +} + +export default DataService; \ No newline at end of file diff --git a/pages-sections/Components-Sections/SectionLatestNews.js b/pages-sections/latest_news/SectionLatestNews.js similarity index 98% rename from pages-sections/Components-Sections/SectionLatestNews.js rename to pages-sections/latest_news/SectionLatestNews.js index b0626be..4c7067a 100644 --- a/pages-sections/Components-Sections/SectionLatestNews.js +++ b/pages-sections/latest_news/SectionLatestNews.js @@ -17,14 +17,14 @@ import Paginations from "components/Pagination/Pagination.js"; const useStyles = makeStyles(styles); -export default function SectionNotifications() { +const LatestNews = function ({ news, ...props }) { const classes = useStyles(); return (
- Thamrin Group bersama Anda melawan COVID-19. Untuk informasi silakan klik di sini. + Thamrin Group bersama Anda melawan COVID-19. Untuk informasi silakan klik di sini. } align="center" @@ -157,3 +157,5 @@ export default function SectionNotifications() {
); } + +export default LatestNews; \ No newline at end of file diff --git a/pages-sections/latest_news/news.js b/pages-sections/latest_news/news.js new file mode 100644 index 0000000..b2b9ffc --- /dev/null +++ b/pages-sections/latest_news/news.js @@ -0,0 +1,77 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +// component +import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; +import Paper from '@material-ui/core/Paper'; +import Grid from '@material-ui/core/Grid'; +import GridContainer from "components/Grid/GridContainer.js"; +import Card from "components/Card/Card.js"; +import CardBody from "components/Card/CardBody.js"; +import Button from "components/CustomButtons/Button.js"; +import Paginations from "components/Pagination/Pagination.js"; + +const useStyles = makeStyles(styles); + +const DataLatestNews = function ({ backend, news, ...props }) { + const classes = useStyles(); + const latnews = news.map((data) => { + return ( + + + + {/*

{data.title}

*/} +

{data.title}

+ +
+
+ ); + }) + return ( +
+
+

Latest News

+
+
+ + + {latnews[0]} + {latnews[1]} + + + {latnews[2]} + {latnews[3]} + + + {latnews[4]} + {latnews[5]} + + +
+
+ +
+
+ ); +} + +export default DataLatestNews; diff --git a/pages-sections/snackbar.js b/pages-sections/snackbar.js new file mode 100644 index 0000000..e2621b4 --- /dev/null +++ b/pages-sections/snackbar.js @@ -0,0 +1,31 @@ +import React from "react"; + +// @material-ui/core components +import { makeStyles } from "@material-ui/core/styles"; + +// Component +import SnackbarContent from "components/Snackbar/SnackbarContent.js"; +import styles from "assets/jss/nextjs-material-kit/pages/componentsSections/notificationsStyles.js"; + +const useStyles = makeStyles(styles); + +const DataSnackbarContent = function() { + const classes = useStyles(); + return ( +
+
+ + Thamrin Group bersama Anda melawan COVID-19. Untuk informasi silakan klik di sini. + + } + align="center" + color="danger" + /> +
+
+ ); +} + +export default DataSnackbarContent; \ No newline at end of file diff --git a/pages/aboutus.js b/pages/aboutus.js index e6bea37..b02de94 100644 --- a/pages/aboutus.js +++ b/pages/aboutus.js @@ -12,7 +12,7 @@ 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 SectionAboutUs from "pages-sections/Components-Sections/SectionAboutUs.js"; +import SectionAboutUs from "pages-sections/SectionAboutUs.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; diff --git a/pages/carrer.js b/pages/carrer.js index 36cae18..0fae9ce 100644 --- a/pages/carrer.js +++ b/pages/carrer.js @@ -12,7 +12,7 @@ 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 SectionCarrer from "pages-sections/Components-Sections/SectionCarrer.js"; +import SectionCarrer from "pages-sections/SectionCarrer.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; diff --git a/pages/components.js b/pages/components.js index 938692f..ffbe07a 100644 --- a/pages/components.js +++ b/pages/components.js @@ -12,17 +12,25 @@ 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 SectionContent from "pages-sections/Components-Sections/SectionContent.js"; import Parallax from "components/Parallax/Parallax.js"; import styles from "assets/jss/nextjs-material-kit/pages/components.js"; import Button from "components/CustomButtons/Button.js"; -import Home from "../api/home.js" -const useStyles = makeStyles(styles); +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/snackbar.js"; +import DataCarousel from "../pages-sections/home/carousel.js"; +import DataService from "../pages-sections/home/service.js"; +import DataBusinessPartner from "../pages-sections/home/business_partner.js"; -export default function Components(props) { +const useStyles = makeStyles(styles); +const Home = function ({ backend, businessPartners, service, carousel, ...props }) { const classes = useStyles(); const { ...rest } = props; + + return (
- + + + +
@@ -66,10 +77,31 @@ export default function Components(props) { } export async function getServerSideProps(context) { - var res=await Home.GET(); - console.log(res); + 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"]; + } + + console.log(carousel); return { - props: { }, // will be passed to the page component as props + props: { businessPartners, service, carousel, backend }, // will be passed to the page component as props }; } + +export default Home; \ No newline at end of file diff --git a/pages/latestnews.js b/pages/latestnews.js index b72c124..9a32b7c 100644 --- a/pages/latestnews.js +++ b/pages/latestnews.js @@ -12,15 +12,19 @@ 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 SectionLatestNews from "pages-sections/Components-Sections/SectionLatestNews.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/snackbar.js"; +import DataLatestNews from "../pages-sections/latest_news/news.js"; + const useStyles = makeStyles(styles); -export default function Components(props) { +const LatestNews = function ({ backend, news, ...props }) { const classes = useStyles(); const { ...rest } = props; + return (
- + +
); } + +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/product.js b/pages/product.js index 8de1c97..8de635d 100644 --- a/pages/product.js +++ b/pages/product.js @@ -12,10 +12,12 @@ 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 SectionProduct from "pages-sections/Components-Sections/SectionProduct.js"; +import SectionProduct from "pages-sections/SectionProduct.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); export default function Components(props) { @@ -54,3 +56,16 @@ export default function Components(props) {
); } + +export async function getServerSideProps(context) { + var product = []; + + var res = await Getproduct.GetProduct(); + if (res["STATUS"] === 1) { + product = res["DATA"]["products"]; + } + + return { + props: { product }, // will be passed to the page component as props + }; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d7fcf3f..031303f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3150,7 +3150,7 @@ create-react-context@^0.3.0: gud "^1.0.0" warning "^4.0.3" -cross-fetch@3.0.6: +cross-fetch@3.0.6, cross-fetch@^3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==