Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

1 wiersz
3.0 KiB

  1. {"ast":null,"code":"var __jsx = React.createElement;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\nimport classNames from \"classnames\";\nimport { makeStyles } from \"@material-ui/core/styles\";\nimport Header from \"components/Header/Header.js\";\nimport HeaderHino from \"components/Header/HeaderHino.js\";\nimport FooterHino from \"components/Footer/FooterHino.js\";\nimport Parallax from \"components/Parallax/Parallax.js\";\nimport styles from \"assets/jss/nextjs-material-kit/pages/components.js\";\nimport GetLatestNews from \"api/latest_news/news.js\";\nimport DataSnackbarContent from \"pages-sections/suzuki/snackbar.js\";\nimport DataLatestNews from \"pages-sections/hino/latest_news/news.js\";\nconst useStyles = makeStyles(styles);\n\nconst LatestNews = function (_ref) {\n let {\n backend,\n news\n } = _ref,\n props = _objectWithoutProperties(_ref, [\"backend\", \"news\"]);\n\n const classes = useStyles();\n const rest = Object.assign({}, props);\n\n __jsx(DataLatestNews, {\n news: props.news\n });\n\n return __jsx(\"div\", null, __jsx(Header, _extends({\n rightLinks: __jsx(HeaderHino, null),\n fixed: true,\n color: \"dark\",\n changeColorOnScroll: {\n height: 400,\n color: \"white\"\n }\n }, rest)), __jsx(Parallax, {\n image: require(\"assets/img/hino.jpg\"),\n width: \"200px\"\n }), __jsx(\"div\", {\n className: classNames(classes.main, classes.mainRaised)\n }, __jsx(DataLatestNews, {\n news: news,\n backend: backend\n })), __jsx(FooterHino, null));\n};\n\nexport default LatestNews;\nexport async function getServerSideProps(context) {\n var news = [];\n const backend = process.env.BACKEND_SERVER_URI;\n var res = await GetLatestNews.GetNewsHino();\n\n if (res[\"STATUS\"] === 1) {\n news = res[\"DATA\"][\"latestNews\"];\n }\n\n return {\n props: {\n news,\n backend\n } // will be passed to the page component as props\n\n };\n}","map":null,"metadata":{},"sourceType":"module"}