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.
 
 

1 rivi
5.2 KiB

  1. {"ast":null,"code":"import _regeneratorRuntime from \"@babel/runtime/regenerator\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"username\"];\nvar __jsx = React.createElement;\n\n/*eslint-disable*/\nimport React from \"react\";\nimport Link from \"next/link\"; // @material-ui/core components\n\nimport { makeStyles } from \"@material-ui/core/styles\";\nimport List from \"@material-ui/core/List\";\nimport ListItem from \"@material-ui/core/ListItem\";\nimport Icon from \"@material-ui/core/Icon\";\nimport Chart from \"@material-ui/icons/LocalGroceryStore\"; // @material-ui/icons\n\nimport { Apps, ShareTwoTone, Person } from \"@material-ui/icons\"; // core components\n\nimport CustomDropdown from \"components/CustomDropdown/CustomDropdown.js\";\nimport Button from \"components/CustomButtons/Button.js\";\nimport styles from \"assets/jss/nextjs-material-kit/components/headerLinksStyle.js\";\nimport Logo from \"assets/img/hino.png\";\nvar useStyles = makeStyles(styles);\nexport default function HeaderLinks(_ref) {\n var username = _ref.username,\n props = _objectWithoutProperties(_ref, _excluded);\n\n var classes = useStyles();\n return __jsx(List, {\n className: classes.list\n }, __jsx(ListItem, {\n className: classes.listItem\n }, __jsx(Link, {\n href: \"/hino/home\"\n }, __jsx(Button, {\n color: \"transparent\",\n className: classes.navLink\n }, __jsx(\"img\", {\n src: Logo,\n width: \"205px\"\n })))), __jsx(ListItem, {\n className: classes.listItem\n }, __jsx(Link, {\n href: \"/hino/home\"\n }, __jsx(Button, {\n color: \"transparent\",\n className: classes.navLink,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Icon, {\n className: classes.icons\n }, \"home\"), \" Home\"))), __jsx(ListItem, {\n className: classes.listItem\n }, __jsx(Link, {\n href: \"/hino/product/product\"\n }, __jsx(Button, {\n color: \"transparent\",\n className: classes.navLink,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Icon, {\n className: classes.icons\n }, \"home\"), \" Product\"))), __jsx(ListItem, {\n className: classes.listItem,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Link, {\n href: \"/hino/latest_news/latestnews\"\n }, __jsx(Button, {\n color: \"transparent\",\n className: classes.navLink\n }, __jsx(Icon, {\n className: classes.icons\n }, \"event\"), \" Latest News\"))), __jsx(ListItem, {\n className: classes.listItem,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Button, {\n href: \"/hino/carrer/carrer\",\n color: \"transparent\",\n className: classes.navLink\n }, __jsx(Icon, {\n className: classes.icons\n }, \"wallet_travel\"), \" Career\")), __jsx(ListItem, {\n className: classes.listItem,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Button, {\n href: \"/hino/about_us/about_us\",\n color: \"transparent\",\n className: classes.navLink\n }, __jsx(Icon, {\n className: classes.icons\n }, \"account_balance\"), \" About Us\")), __jsx(ListItem, {\n className: classes.listItem,\n style: {\n marginTop: \"10px\"\n }\n }, __jsx(Button, {\n href: \"/hino/profile/profile\" // href=\"#\"\n ,\n color: \"transparent\",\n className: classes.navLink\n }, __jsx(Icon, {\n className: classes.icons\n }, \"people\"), \" Profile\")), __jsx(ListItem, {\n className: classes.listItem,\n style: {\n marginTop: \"10px\"\n }\n }, !username || username == \"\" ? __jsx(Button, {\n href: \"/hino/login\",\n className: classes.registerNavLink,\n color: \"info\",\n round: true\n }, __jsx(Icon, {\n className: classes.icons\n }, \"input\"), \" Login\") : __jsx(CustomDropdown, {\n noLiPadding: true,\n navDropdown: true,\n buttonText: username.length > 12 ? username.substring(0, 9) + \"..\" : username,\n buttonProps: {\n className: classes.navLink,\n color: \"transparent\"\n },\n buttonIcon: Person,\n dropdownList: [__jsx(\"div\", {\n onClick: function _callee(e) {\n return _regeneratorRuntime.async(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n e.preventDefault();\n fetch(\"/api/auth/logout\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n p: \"SUZUKI\"\n })\n }).then(function (res) {\n //if (res.ok) {\n window.location.href = \"../hino/home\";\n /*}\r\n else{\r\n }*/\n });\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, null, null, null, Promise);\n }\n }, __jsx(\"a\", {\n className: classes.dropdownLink\n }, __jsx(Icon, {\n className: classes.icons\n }, \"exit_to_app\"), \" \", \"Logout\"))]\n })));\n}","map":null,"metadata":{},"sourceType":"module"}