You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

85 regels
2.5 KiB

  1. import React from "react";
  2. // nodejs library that concatenates classes
  3. import classNames from "classnames";
  4. // react components for routing our app without refresh
  5. import Link from "next/link";
  6. // @material-ui/core components
  7. import { makeStyles } from "@material-ui/core/styles";
  8. // @material-ui/icons
  9. // core components
  10. import Header from "components/Header/Header.js";
  11. import HeaderLinks from "components/Header/HeaderLinks.js";
  12. import Footer from "components/Footer/Footer.js";
  13. import GridContainer from "components/Grid/GridContainer.js";
  14. import GridItem from "components/Grid/GridItem.js";
  15. import SectionCarrer from "pages-sections/carrer/carrer.js";
  16. import Parallax from "components/Parallax/Parallax.js";
  17. import styles from "assets/jss/nextjs-material-kit/pages/components.js";
  18. import Getcarrer from "../api/carrer/carrer.js"
  19. const useStyles = makeStyles(styles);
  20. const Carrer = function ({ backend, s1, d3, sma, ...props }) {
  21. const classes = useStyles();
  22. const { ...rest } = props;
  23. return (
  24. <div>
  25. <Header
  26. rightLinks={<HeaderLinks />}
  27. fixed
  28. color="info"
  29. changeColorOnScroll={{
  30. height: 400,
  31. color: "white"
  32. }}
  33. {...rest}
  34. />
  35. <Parallax image={require("assets/img/carrer.png")} height="50px">
  36. <div className={classes.container}>
  37. <GridContainer>
  38. <GridItem>
  39. {/* <div className={classes.brand}>
  40. <h1 className={classes.title}>NextJS Material Kit.</h1>
  41. <h3 className={classes.subtitle}>
  42. A Badass Material Kit based on Material-UI and NextJS.
  43. </h3>
  44. </div> */}
  45. </GridItem>
  46. </GridContainer>
  47. </div>
  48. </Parallax>
  49. <div className={classNames(classes.main, classes.mainRaised)}>
  50. <SectionCarrer s1={s1} d3={d3} sma={sma} backend={backend}/>
  51. </div>
  52. <Footer />
  53. </div>
  54. );
  55. }
  56. export default Carrer;
  57. export async function getServerSideProps(context) {
  58. var s1 = [];
  59. var d3 = [];
  60. var sma = [];
  61. const backend = process.env.BACKEND_SERVER_URI;
  62. var res = await Getcarrer.GetCarrerS1();
  63. if (res["STATUS"] === 1) {
  64. s1 = res["DATA"]["carrers"];
  65. }
  66. var res = await Getcarrer.GetCarrerD3();
  67. if (res["STATUS"] === 1) {
  68. d3 = res["DATA"]["carrers"];
  69. }
  70. var res = await Getcarrer.GetCarrerSMA();
  71. if (res["STATUS"] === 1) {
  72. sma = res["DATA"]["carrers"];
  73. }
  74. return {
  75. props: { s1, d3, sma, backend }, // will be passed to the page component as props
  76. };
  77. }