|
- import React from "react";
- // nodejs library that concatenates classes
- import classNames from "classnames";
- // react components for routing our app without refresh
- import Link from "next/link";
- // @material-ui/core components
- import { makeStyles } from "@material-ui/core/styles";
- // @material-ui/icons
- // core components
- import Header from "components/Header/Header.js";
- import HeaderLinks from "components/Header/HeaderLinks.js";
- import Footer from "components/Footer/Footer.js";
- import GridContainer from "components/Grid/GridContainer.js";
- import GridItem from "components/Grid/GridItem.js";
- import SectionCarrer from "pages-sections/carrer/carrer.js";
- import Parallax from "components/Parallax/Parallax.js";
- import styles from "assets/jss/nextjs-material-kit/pages/components.js";
- import Getcarrer from "../api/carrer/carrer.js"
-
- const useStyles = makeStyles(styles);
-
- const Carrer = function ({ backend, s1, d3, sma, ...props }) {
- const classes = useStyles();
- const { ...rest } = props;
- return (
- <div>
- <Header
- rightLinks={<HeaderLinks />}
- fixed
- color="info"
- changeColorOnScroll={{
- height: 400,
- color: "white"
- }}
- {...rest}
- />
- <Parallax image={require("assets/img/carrer.png")} height="50px">
- <div className={classes.container}>
- <GridContainer>
- <GridItem>
- {/* <div className={classes.brand}>
- <h1 className={classes.title}>NextJS Material Kit.</h1>
- <h3 className={classes.subtitle}>
- A Badass Material Kit based on Material-UI and NextJS.
- </h3>
- </div> */}
- </GridItem>
- </GridContainer>
- </div>
- </Parallax>
- <div className={classNames(classes.main, classes.mainRaised)}>
- <SectionCarrer s1={s1} d3={d3} sma={sma} backend={backend}/>
- </div>
- <Footer />
- </div>
- );
- }
-
- export default Carrer;
-
- export async function getServerSideProps(context) {
- var s1 = [];
- var d3 = [];
- var sma = [];
- const backend = process.env.BACKEND_SERVER_URI;
-
- var res = await Getcarrer.GetCarrerS1();
- if (res["STATUS"] === 1) {
- s1 = res["DATA"]["carrers"];
- }
-
- var res = await Getcarrer.GetCarrerD3();
- if (res["STATUS"] === 1) {
- d3 = res["DATA"]["carrers"];
- }
-
- var res = await Getcarrer.GetCarrerSMA();
- if (res["STATUS"] === 1) {
- sma = res["DATA"]["carrers"];
- }
-
- return {
- props: { s1, d3, sma, backend }, // will be passed to the page component as props
- };
- }
|