25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
1.8 KiB

  1. import React from "react";
  2. import classNames from "classnames";
  3. import { makeStyles } from "@material-ui/core/styles";
  4. import Header from "components/Header/Header.js";
  5. import HeaderLinks from "components/Header/HeaderLinks.js";
  6. import Footer from "components/Footer/Footer.js";
  7. import Parallax from "components/Parallax/Parallax.js";
  8. import styles from "assets/jss/nextjs-material-kit/pages/components.js";
  9. import SectionCarrer from "pages-sections/yamaha/carrer/carrer.js";
  10. import Getcarrer from "../../../api/carrer/carrer.js"
  11. const useStyles = makeStyles(styles);
  12. const Carrer = function ({ backend, s1, d3, sma, ...props }) {
  13. const classes = useStyles();
  14. const { ...rest } = props;
  15. return (
  16. <div>
  17. <Header
  18. rightLinks={<HeaderLinks />}
  19. fixed
  20. color="info"
  21. changeColorOnScroll={{
  22. height: 400,
  23. color: "white"
  24. }}
  25. {...rest}
  26. />
  27. <Parallax image={require("assets/img/carrer.png")} height="50px"/>
  28. <div className={classNames(classes.main, classes.mainRaised)}>
  29. <SectionCarrer s1={s1} d3={d3} sma={sma} backend={backend}/>
  30. </div>
  31. <Footer />
  32. </div>
  33. );
  34. }
  35. export default Carrer;
  36. export async function getServerSideProps(context) {
  37. var s1 = [];
  38. var d3 = [];
  39. var sma = [];
  40. const backend = process.env.BACKEND_SERVER_URI;
  41. var res = await Getcarrer.GetCarrerS1Yamaha();
  42. if (res["STATUS"] === 1) {
  43. s1 = res["DATA"]["carrers"];
  44. }
  45. var res = await Getcarrer.GetCarrerD3Yamaha();
  46. if (res["STATUS"] === 1) {
  47. d3 = res["DATA"]["carrers"];
  48. }
  49. var res = await Getcarrer.GetCarrerSMAYamaha();
  50. if (res["STATUS"] === 1) {
  51. sma = res["DATA"]["carrers"];
  52. }
  53. return {
  54. props: { s1, d3, sma, backend }, // will be passed to the page component as props
  55. };
  56. }