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.
 
 

56 rivejä
1.7 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 CarrerDetail from "pages-sections/yamaha/carrer/carrer_details.js";
  8. import Parallax from "components/Parallax/Parallax.js";
  9. import styles from "assets/jss/nextjs-material-kit/pages/components.js";
  10. import GetDetailcarrer from "../../../api/carrer/carrer.js.js"
  11. const useStyles = makeStyles(styles);
  12. const CarrerDetails = function ({ backend, detailcarrer, ...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. <CarrerDetail detailcarrer={detailcarrer} backend={backend}/>
  30. </div>
  31. <Footer />
  32. </div>
  33. );
  34. }
  35. export default CarrerDetails;
  36. export async function getServerSideProps(context) {
  37. var {query} = context;
  38. var detailcarrer = [];
  39. const backend = process.env.BACKEND_SERVER_URI;
  40. var res = await GetDetailcarrer.GetDetailCarrer(query.s||0);
  41. if (res["STATUS"] === 1) {
  42. detailcarrer = res["DATA"]["carrers"];
  43. }
  44. console.log(res);
  45. return {
  46. props: { detailcarrer, backend }, // will be passed to the page component as props
  47. };
  48. }