| @@ -1,36 +0,0 @@ | |||||
| { | |||||
| "devFiles": [ | |||||
| "static/runtime/react-refresh.js", | |||||
| "static/runtime/react-refresh.js.map", | |||||
| "static/development/dll/dll_dc8ac110ce5d8530b237.js", | |||||
| "static/development/dll/dll_dc8ac110ce5d8530b237.js.map" | |||||
| ], | |||||
| "lowPriorityFiles": [ | |||||
| "static/development/_buildManifest.js", | |||||
| "static/development/_ssgManifest.js" | |||||
| ], | |||||
| "pages": { | |||||
| "/_app": [ | |||||
| "static/runtime/webpack.js", | |||||
| "static/css/styles.chunk.css", | |||||
| "static/chunks/styles.js", | |||||
| "static/runtime/main.js" | |||||
| ], | |||||
| "/_error": [ | |||||
| "static/runtime/webpack.js", | |||||
| "static/runtime/main.js" | |||||
| ], | |||||
| "/_polyfills": [ | |||||
| "static/runtime/polyfills.js", | |||||
| "static/runtime/polyfills.js.map" | |||||
| ], | |||||
| "/yamaha/login": [ | |||||
| "static/runtime/webpack.js", | |||||
| "static/runtime/main.js" | |||||
| ], | |||||
| "/yamaha/product/product": [ | |||||
| "static/runtime/webpack.js", | |||||
| "static/runtime/main.js" | |||||
| ] | |||||
| } | |||||
| } | |||||
| @@ -1,10 +0,0 @@ | |||||
| { | |||||
| "./dev/noop": [ | |||||
| { | |||||
| "id": "./node_modules/next/dist/client/dev/noop.js", | |||||
| "name": "./node_modules/next/dist/client/dev/noop.js", | |||||
| "file": "static/chunks/0.js", | |||||
| "publicPath": "static/chunks/0.js" | |||||
| } | |||||
| ] | |||||
| } | |||||
| @@ -1,116 +0,0 @@ | |||||
| module.exports = | |||||
| /******/ (function(modules) { // webpackBootstrap | |||||
| /******/ // The module cache | |||||
| /******/ var installedModules = {}; | |||||
| /******/ | |||||
| /******/ // The require function | |||||
| /******/ function __webpack_require__(moduleId) { | |||||
| /******/ | |||||
| /******/ // Check if module is in cache | |||||
| /******/ if(installedModules[moduleId]) { | |||||
| /******/ return installedModules[moduleId].exports; | |||||
| /******/ } | |||||
| /******/ // Create a new module (and put it into the cache) | |||||
| /******/ var module = installedModules[moduleId] = { | |||||
| /******/ i: moduleId, | |||||
| /******/ l: false, | |||||
| /******/ exports: {} | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // Execute the module function | |||||
| /******/ var threw = true; | |||||
| /******/ try { | |||||
| /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |||||
| /******/ threw = false; | |||||
| /******/ } finally { | |||||
| /******/ if(threw) delete installedModules[moduleId]; | |||||
| /******/ } | |||||
| /******/ | |||||
| /******/ // Flag the module as loaded | |||||
| /******/ module.l = true; | |||||
| /******/ | |||||
| /******/ // Return the exports of the module | |||||
| /******/ return module.exports; | |||||
| /******/ } | |||||
| /******/ | |||||
| /******/ | |||||
| /******/ // expose the modules object (__webpack_modules__) | |||||
| /******/ __webpack_require__.m = modules; | |||||
| /******/ | |||||
| /******/ // expose the module cache | |||||
| /******/ __webpack_require__.c = installedModules; | |||||
| /******/ | |||||
| /******/ // define getter function for harmony exports | |||||
| /******/ __webpack_require__.d = function(exports, name, getter) { | |||||
| /******/ if(!__webpack_require__.o(exports, name)) { | |||||
| /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | |||||
| /******/ } | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // define __esModule on exports | |||||
| /******/ __webpack_require__.r = function(exports) { | |||||
| /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |||||
| /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |||||
| /******/ } | |||||
| /******/ Object.defineProperty(exports, '__esModule', { value: true }); | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // create a fake namespace object | |||||
| /******/ // mode & 1: value is a module id, require it | |||||
| /******/ // mode & 2: merge all properties of value into the ns | |||||
| /******/ // mode & 4: return value when already ns object | |||||
| /******/ // mode & 8|1: behave like require | |||||
| /******/ __webpack_require__.t = function(value, mode) { | |||||
| /******/ if(mode & 1) value = __webpack_require__(value); | |||||
| /******/ if(mode & 8) return value; | |||||
| /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | |||||
| /******/ var ns = Object.create(null); | |||||
| /******/ __webpack_require__.r(ns); | |||||
| /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | |||||
| /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | |||||
| /******/ return ns; | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // getDefaultExport function for compatibility with non-harmony modules | |||||
| /******/ __webpack_require__.n = function(module) { | |||||
| /******/ var getter = module && module.__esModule ? | |||||
| /******/ function getDefault() { return module['default']; } : | |||||
| /******/ function getModuleExports() { return module; }; | |||||
| /******/ __webpack_require__.d(getter, 'a', getter); | |||||
| /******/ return getter; | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // Object.prototype.hasOwnProperty.call | |||||
| /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | |||||
| /******/ | |||||
| /******/ // __webpack_public_path__ | |||||
| /******/ __webpack_require__.p = ""; | |||||
| /******/ | |||||
| /******/ | |||||
| /******/ // Load entry module and return exports | |||||
| /******/ return __webpack_require__(__webpack_require__.s = "./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-init-server!./"); | |||||
| /******/ }) | |||||
| /************************************************************************/ | |||||
| /******/ ({ | |||||
| /***/ "./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-init-server!./": | |||||
| /*!******************************************************************************************************!*\ | |||||
| !*** ./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-init-server ***! | |||||
| \******************************************************************************************************/ | |||||
| /*! exports provided: default */ | |||||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||||
| "use strict"; | |||||
| __webpack_require__.r(__webpack_exports__); | |||||
| /* harmony default export */ __webpack_exports__["default"] = (function (ctx) { | |||||
| return Promise.all([]) | |||||
| }); | |||||
| /***/ }) | |||||
| /******/ }); | |||||
| //# sourceMappingURL=init-server.js.map | |||||
| @@ -1,116 +0,0 @@ | |||||
| module.exports = | |||||
| /******/ (function(modules) { // webpackBootstrap | |||||
| /******/ // The module cache | |||||
| /******/ var installedModules = {}; | |||||
| /******/ | |||||
| /******/ // The require function | |||||
| /******/ function __webpack_require__(moduleId) { | |||||
| /******/ | |||||
| /******/ // Check if module is in cache | |||||
| /******/ if(installedModules[moduleId]) { | |||||
| /******/ return installedModules[moduleId].exports; | |||||
| /******/ } | |||||
| /******/ // Create a new module (and put it into the cache) | |||||
| /******/ var module = installedModules[moduleId] = { | |||||
| /******/ i: moduleId, | |||||
| /******/ l: false, | |||||
| /******/ exports: {} | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // Execute the module function | |||||
| /******/ var threw = true; | |||||
| /******/ try { | |||||
| /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |||||
| /******/ threw = false; | |||||
| /******/ } finally { | |||||
| /******/ if(threw) delete installedModules[moduleId]; | |||||
| /******/ } | |||||
| /******/ | |||||
| /******/ // Flag the module as loaded | |||||
| /******/ module.l = true; | |||||
| /******/ | |||||
| /******/ // Return the exports of the module | |||||
| /******/ return module.exports; | |||||
| /******/ } | |||||
| /******/ | |||||
| /******/ | |||||
| /******/ // expose the modules object (__webpack_modules__) | |||||
| /******/ __webpack_require__.m = modules; | |||||
| /******/ | |||||
| /******/ // expose the module cache | |||||
| /******/ __webpack_require__.c = installedModules; | |||||
| /******/ | |||||
| /******/ // define getter function for harmony exports | |||||
| /******/ __webpack_require__.d = function(exports, name, getter) { | |||||
| /******/ if(!__webpack_require__.o(exports, name)) { | |||||
| /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); | |||||
| /******/ } | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // define __esModule on exports | |||||
| /******/ __webpack_require__.r = function(exports) { | |||||
| /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |||||
| /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |||||
| /******/ } | |||||
| /******/ Object.defineProperty(exports, '__esModule', { value: true }); | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // create a fake namespace object | |||||
| /******/ // mode & 1: value is a module id, require it | |||||
| /******/ // mode & 2: merge all properties of value into the ns | |||||
| /******/ // mode & 4: return value when already ns object | |||||
| /******/ // mode & 8|1: behave like require | |||||
| /******/ __webpack_require__.t = function(value, mode) { | |||||
| /******/ if(mode & 1) value = __webpack_require__(value); | |||||
| /******/ if(mode & 8) return value; | |||||
| /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; | |||||
| /******/ var ns = Object.create(null); | |||||
| /******/ __webpack_require__.r(ns); | |||||
| /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); | |||||
| /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); | |||||
| /******/ return ns; | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // getDefaultExport function for compatibility with non-harmony modules | |||||
| /******/ __webpack_require__.n = function(module) { | |||||
| /******/ var getter = module && module.__esModule ? | |||||
| /******/ function getDefault() { return module['default']; } : | |||||
| /******/ function getModuleExports() { return module; }; | |||||
| /******/ __webpack_require__.d(getter, 'a', getter); | |||||
| /******/ return getter; | |||||
| /******/ }; | |||||
| /******/ | |||||
| /******/ // Object.prototype.hasOwnProperty.call | |||||
| /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | |||||
| /******/ | |||||
| /******/ // __webpack_public_path__ | |||||
| /******/ __webpack_require__.p = ""; | |||||
| /******/ | |||||
| /******/ | |||||
| /******/ // Load entry module and return exports | |||||
| /******/ return __webpack_require__(__webpack_require__.s = "./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-error-server!./"); | |||||
| /******/ }) | |||||
| /************************************************************************/ | |||||
| /******/ ({ | |||||
| /***/ "./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-error-server!./": | |||||
| /*!*******************************************************************************************************!*\ | |||||
| !*** ./node_modules/next/dist/build/webpack/loaders/next-plugin-loader.js?middleware=on-error-server ***! | |||||
| \*******************************************************************************************************/ | |||||
| /*! exports provided: default */ | |||||
| /***/ (function(module, __webpack_exports__, __webpack_require__) { | |||||
| "use strict"; | |||||
| __webpack_require__.r(__webpack_exports__); | |||||
| /* harmony default export */ __webpack_exports__["default"] = (function (ctx) { | |||||
| return Promise.all([]) | |||||
| }); | |||||
| /***/ }) | |||||
| /******/ }); | |||||
| //# sourceMappingURL=on-error-server.js.map | |||||
| @@ -1 +0,0 @@ | |||||
| {"/_app":"static/development/pages/_app.js","/_document":"static/development/pages/_document.js","/_error":"static/development/pages/_error.js","/yamaha/login":"static/development/pages/yamaha/login.js","/yamaha/product/product":"static/development/pages/yamaha/product/product.js"} | |||||
| @@ -1,4 +0,0 @@ | |||||
| /* This cache is used by webpack for instantiated modules */ | |||||
| module.exports = {} | |||||
| @@ -159,7 +159,7 @@ export default function HeaderLinks({ username, ...props }) { | |||||
| <ListItem className={classes.listItem} style={{ marginTop: "10px" }}> | <ListItem className={classes.listItem} style={{ marginTop: "10px" }}> | ||||
| {!username || username == "" ? ( | {!username || username == "" ? ( | ||||
| <Button | <Button | ||||
| href="/suzuki/login" | |||||
| href="/yamaha/login" | |||||
| className={classes.registerNavLink} | className={classes.registerNavLink} | ||||
| color="info" | color="info" | ||||
| round | round | ||||
| @@ -2,10 +2,6 @@ import React from "react"; | |||||
| // @material-ui/core components | // @material-ui/core components | ||||
| import { makeStyles } from "@material-ui/core/styles"; | import { makeStyles } from "@material-ui/core/styles"; | ||||
| import InputAdornment from "@material-ui/core/InputAdornment"; | import InputAdornment from "@material-ui/core/InputAdornment"; | ||||
| import Collapse from "@material-ui/core/Collapse"; | |||||
| import Alert from "@material-ui/lab/Alert"; | |||||
| import IconButton from "@material-ui/core/IconButton"; | |||||
| import CloseIcon from "@material-ui/icons/Close"; | |||||
| import Icon from "@material-ui/core/Icon"; | import Icon from "@material-ui/core/Icon"; | ||||
| // @material-ui/icons | // @material-ui/icons | ||||
| import Email from "@material-ui/icons/Email"; | import Email from "@material-ui/icons/Email"; | ||||
| @@ -27,8 +23,11 @@ import styles from "assets/jss/nextjs-material-kit/pages/loginPage.js"; | |||||
| import image from "assets/img/bgtbg.jpg"; | import image from "assets/img/bgtbg.jpg"; | ||||
| import Collapse from "@material-ui/core/Collapse"; | |||||
| import Alert from "@material-ui/lab/Alert"; | |||||
| import IconButton from "@material-ui/core/IconButton"; | |||||
| import CloseIcon from "@material-ui/icons/Close"; | |||||
| import { useRouter } from "next/router"; | import { useRouter } from "next/router"; | ||||
| const useStyles = makeStyles(styles); | const useStyles = makeStyles(styles); | ||||
| export default function LoginPage(props) { | export default function LoginPage(props) { | ||||
| @@ -67,7 +66,7 @@ export default function LoginPage(props) { | |||||
| }; | }; | ||||
| return ( | return ( | ||||
| <> | |||||
| <div> | |||||
| <Collapse className={classes.collapsible} in={open}> | <Collapse className={classes.collapsible} in={open}> | ||||
| <Alert | <Alert | ||||
| severity="error" | severity="error" | ||||
| @@ -87,109 +86,77 @@ export default function LoginPage(props) { | |||||
| {error} | {error} | ||||
| </Alert> | </Alert> | ||||
| </Collapse> | </Collapse> | ||||
| <div> | |||||
| <Header absolute color="info" rightLinks={<HeaderLinks />} {...rest} /> | |||||
| <div | |||||
| className={classes.pageHeader} | |||||
| style={{ | |||||
| backgroundImage: "url(" + image + ")", | |||||
| backgroundSize: "cover", | |||||
| backgroundPosition: "top center", | |||||
| }} | |||||
| > | |||||
| <div className={classes.container}> | |||||
| <GridContainer justify="center"> | |||||
| <GridItem xs={12} sm={6} md={4}> | |||||
| <Card className={classes[cardAnimaton]}> | |||||
| <form onSubmit={submitHandler} className={classes.form}> | |||||
| <CardHeader color="info" className={classes.cardHeader}> | |||||
| <h4>Login</h4> | |||||
| <div className={classes.socialLine}> | |||||
| <Button | |||||
| justIcon | |||||
| href="#pablo" | |||||
| target="_blank" | |||||
| color="transparent" | |||||
| onClick={(e) => e.preventDefault()} | |||||
| > | |||||
| <i className={"fab fa-twitter"} /> | |||||
| </Button> | |||||
| <Button | |||||
| justIcon | |||||
| href="#pablo" | |||||
| target="_blank" | |||||
| color="transparent" | |||||
| onClick={(e) => e.preventDefault()} | |||||
| > | |||||
| <i className={"fab fa-facebook"} /> | |||||
| </Button> | |||||
| <Button | |||||
| justIcon | |||||
| href="#pablo" | |||||
| target="_blank" | |||||
| color="transparent" | |||||
| onClick={(e) => e.preventDefault()} | |||||
| > | |||||
| <i className={"fab fa-google-plus-g"} /> | |||||
| </Button> | |||||
| </div> | |||||
| </CardHeader> | |||||
| <p className={classes.divider}> | |||||
| Welcome to Thamrin Brothers | |||||
| </p> | |||||
| <CardBody> | |||||
| <input type="hidden" name="partner" value="YAMAHA" /> | |||||
| <CustomInput | |||||
| labelText="Email..." | |||||
| id="email" | |||||
| value={email} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "email", | |||||
| onChange: (event) => setEmail(event.target.value), | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Email className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Password" | |||||
| id="pass" | |||||
| value={pass} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| onChange: (event) => setPass(event.target.value), | |||||
| type: "password", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Icon className={classes.inputIconsColor}> | |||||
| lock_outline | |||||
| </Icon> | |||||
| </InputAdornment> | |||||
| ), | |||||
| autoComplete: "off", | |||||
| }} | |||||
| /> | |||||
| </CardBody> | |||||
| <CardFooter className={classes.cardFooter}> | |||||
| <Button type="submit" color="info" size="lg"> | |||||
| Login | |||||
| </Button> | |||||
| </CardFooter> | |||||
| </form> | |||||
| </Card> | |||||
| </GridItem> | |||||
| </GridContainer> | |||||
| </div> | |||||
| <Footer whiteFont /> | |||||
| {/* <Header absolute color="info" rightLinks={<HeaderLinks />} {...rest} /> */} | |||||
| <div | |||||
| className={classes.pageHeader} | |||||
| style={{ | |||||
| backgroundImage: "url(" + image + ")", | |||||
| backgroundSize: "cover", | |||||
| backgroundPosition: "top center", | |||||
| }} | |||||
| > | |||||
| <div className={classes.container}> | |||||
| <GridContainer justify="center"> | |||||
| <GridItem xs={6}> | |||||
| <Card className={classes[cardAnimaton]}> | |||||
| <form onSubmit={submitHandler} className={classes.form}> | |||||
| <CardHeader color="info" className={classes.cardHeader}> | |||||
| <h4>Login</h4> | |||||
| </CardHeader> | |||||
| <p className={classes.divider}>Selamat Datang di Halaman Login Thamrin Brothers</p> | |||||
| <CardBody> | |||||
| <CustomInput | |||||
| labelText="Email..." | |||||
| id="email" | |||||
| value={email} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "email", | |||||
| onChange: (event) => setEmail(event.target.value), | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Email className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Password" | |||||
| id="pass" | |||||
| value={pass} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| onChange: (event) => setPass(event.target.value), | |||||
| type: "password", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Icon className={classes.inputIconsColor}> | |||||
| lock_outline | |||||
| </Icon> | |||||
| </InputAdornment> | |||||
| ), | |||||
| autoComplete: "off", | |||||
| }} | |||||
| /> | |||||
| </CardBody> | |||||
| <CardFooter className={classes.cardFooter}> | |||||
| <Button type="submit" color="info" size="lg"> | |||||
| Login | |||||
| </Button> | |||||
| <Button href="/suzuki/register" color="info" size="lg"> | |||||
| Register | |||||
| </Button> | |||||
| </CardFooter> | |||||
| </form> | |||||
| </Card> | |||||
| </GridItem> | |||||
| </GridContainer> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </> | |||||
| </div> | |||||
| ); | ); | ||||
| } | } | ||||
| @@ -0,0 +1,213 @@ | |||||
| import React from "react"; | |||||
| // @material-ui/core components | |||||
| import { makeStyles } from "@material-ui/core/styles"; | |||||
| import InputAdornment from "@material-ui/core/InputAdornment"; | |||||
| import Icon from "@material-ui/core/Icon"; | |||||
| // @material-ui/icons | |||||
| import Email from "@material-ui/icons/Email"; | |||||
| import People from "@material-ui/icons/People"; | |||||
| // core components | |||||
| import GridContainer from "components/Grid/GridContainer.js"; | |||||
| import GridItem from "components/Grid/GridItem.js"; | |||||
| import Button from "components/CustomButtons/Button.js"; | |||||
| import Card from "components/Card/Card.js"; | |||||
| import CardBody from "components/Card/CardBody.js"; | |||||
| import CardHeader from "components/Card/CardHeader.js"; | |||||
| import CardFooter from "components/Card/CardFooter.js"; | |||||
| import CustomInput from "components/CustomInput/CustomInput.js"; | |||||
| import styles from "assets/jss/nextjs-material-kit/pages/loginPage.js"; | |||||
| import image from "assets/img/bgtbg.jpg"; | |||||
| import Collapse from "@material-ui/core/Collapse"; | |||||
| import Alert from "@material-ui/lab/Alert"; | |||||
| import IconButton from "@material-ui/core/IconButton"; | |||||
| import CloseIcon from "@material-ui/icons/Close"; | |||||
| import { useRouter } from "next/router"; | |||||
| const useStyles = makeStyles(styles); | |||||
| export default function RegisterPage(props) { | |||||
| const [cardAnimaton, setCardAnimation] = React.useState("cardHidden"); | |||||
| const [first_name] = React.useState(""); | |||||
| const [last_name] = React.useState(""); | |||||
| const [username] = React.useState(""); | |||||
| const [email, setEmail] = React.useState(""); | |||||
| const [pass, setPass] = React.useState(""); | |||||
| const [open, setOpen] = React.useState(false); | |||||
| const [error, setError] = React.useState(""); | |||||
| const router = useRouter(); | |||||
| setTimeout(function () { | |||||
| setCardAnimation(""); | |||||
| }, 700); | |||||
| const classes = useStyles(); | |||||
| const { ...rest } = props; | |||||
| const submitHandler = async (event) => { | |||||
| event.preventDefault(); | |||||
| const res = await fetch("../api/auth/login", { | |||||
| body: JSON.stringify({ | |||||
| partner: "yamaha", | |||||
| first_name: first_name, | |||||
| last_name: last_name, | |||||
| username: username, | |||||
| email: email, | |||||
| pass: pass, | |||||
| }), | |||||
| headers: { | |||||
| "Content-Type": "application/json", | |||||
| }, | |||||
| method: "POST", | |||||
| }); | |||||
| // console.log("res", res.S); | |||||
| if (res.ok) { | |||||
| router.push("/yamaha/home"); | |||||
| } else { | |||||
| setError(await res.text()); | |||||
| setOpen(true); | |||||
| } | |||||
| }; | |||||
| return ( | |||||
| <div> | |||||
| <Collapse className={classes.collapsible} in={open}> | |||||
| <Alert | |||||
| severity="error" | |||||
| action={ | |||||
| <IconButton | |||||
| aria-label="close" | |||||
| color="inherit" | |||||
| size="small" | |||||
| onClick={() => { | |||||
| setOpen(false); | |||||
| }} | |||||
| > | |||||
| <CloseIcon fontSize="inherit" /> | |||||
| </IconButton> | |||||
| } | |||||
| > | |||||
| {error} | |||||
| </Alert> | |||||
| </Collapse> | |||||
| {/* <Header absolute color="info" rightLinks={<HeaderLinks />} {...rest} /> */} | |||||
| <div | |||||
| className={classes.pageHeader} | |||||
| style={{ | |||||
| backgroundImage: "url(" + image + ")", | |||||
| backgroundSize: "cover", | |||||
| backgroundPosition: "top center", | |||||
| }} | |||||
| > | |||||
| <div className={classes.container}> | |||||
| <GridContainer justify="center"> | |||||
| <GridItem xs={6}> | |||||
| <Card className={classes[cardAnimaton]}> | |||||
| <form onSubmit={submitHandler} className={classes.form}> | |||||
| <CardHeader color="info" className={classes.cardHeader}> | |||||
| <h4>Register</h4> | |||||
| </CardHeader> | |||||
| <p className={classes.divider}>Selamat Datang di Halaman Register Thamrin Brothers</p> | |||||
| <CardBody> | |||||
| <CustomInput | |||||
| labelText="Nama Depan" | |||||
| id="first_name" | |||||
| value={first_name} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "text", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <People className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Nama Belakang" | |||||
| id="last_name" | |||||
| value={last_name} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "text", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <People className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Username" | |||||
| id="username" | |||||
| value={username} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "text", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <People className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Email..." | |||||
| id="email" | |||||
| value={email} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "email", | |||||
| onChange: (event) => setEmail(event.target.value), | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Email className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | |||||
| ), | |||||
| }} | |||||
| /> | |||||
| <CustomInput | |||||
| labelText="Password" | |||||
| id="pass" | |||||
| value={pass} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| onChange: (event) => setPass(event.target.value), | |||||
| type: "password", | |||||
| endAdornment: ( | |||||
| <InputAdornment position="end"> | |||||
| <Icon className={classes.inputIconsColor}> | |||||
| lock_outline | |||||
| </Icon> | |||||
| </InputAdornment> | |||||
| ), | |||||
| autoComplete: "off", | |||||
| }} | |||||
| /> | |||||
| </CardBody> | |||||
| <div align="center"> | |||||
| <a href="/yamaha/login">Sudah Punya Akun ? Silahkan Login</a> | |||||
| </div><br></br> | |||||
| <CardFooter className={classes.cardFooter}> | |||||
| <Button type="submit" color="info" size="lg"> | |||||
| Register | |||||
| </Button> | |||||
| </CardFooter> | |||||
| </form> | |||||
| </Card> | |||||
| </GridItem> | |||||
| </GridContainer> | |||||
| </div> | |||||
| </div> | |||||
| </div> | |||||
| ); | |||||
| } | |||||
| @@ -5,12 +5,8 @@ import InputAdornment from "@material-ui/core/InputAdornment"; | |||||
| import Icon from "@material-ui/core/Icon"; | import Icon from "@material-ui/core/Icon"; | ||||
| // @material-ui/icons | // @material-ui/icons | ||||
| import Email from "@material-ui/icons/Email"; | import Email from "@material-ui/icons/Email"; | ||||
| import Event from "@material-ui/icons/Event"; | |||||
| import People from "@material-ui/icons/People"; | import People from "@material-ui/icons/People"; | ||||
| // core components | // core components | ||||
| import Header from "components/Header/Header.js"; | |||||
| import HeaderLinks from "components/Header/HeaderLinks.js"; | |||||
| import Footer from "components/Footer/Footer.js"; | |||||
| import GridContainer from "components/Grid/GridContainer.js"; | import GridContainer from "components/Grid/GridContainer.js"; | ||||
| import GridItem from "components/Grid/GridItem.js"; | import GridItem from "components/Grid/GridItem.js"; | ||||
| import Button from "components/CustomButtons/Button.js"; | import Button from "components/CustomButtons/Button.js"; | ||||
| @@ -35,7 +31,7 @@ export default function RegisterPage(props) { | |||||
| const [cardAnimaton, setCardAnimation] = React.useState("cardHidden"); | const [cardAnimaton, setCardAnimation] = React.useState("cardHidden"); | ||||
| const [first_name] = React.useState(""); | const [first_name] = React.useState(""); | ||||
| const [last_name] = React.useState(""); | const [last_name] = React.useState(""); | ||||
| const [date_birth, setDate] = React.useState(""); | |||||
| const [username] = React.useState(""); | |||||
| const [email, setEmail] = React.useState(""); | const [email, setEmail] = React.useState(""); | ||||
| const [pass, setPass] = React.useState(""); | const [pass, setPass] = React.useState(""); | ||||
| const [open, setOpen] = React.useState(false); | const [open, setOpen] = React.useState(false); | ||||
| @@ -54,7 +50,7 @@ export default function RegisterPage(props) { | |||||
| partner: "yamaha", | partner: "yamaha", | ||||
| first_name: first_name, | first_name: first_name, | ||||
| last_name: last_name, | last_name: last_name, | ||||
| date_birth: date_birth, | |||||
| username: username, | |||||
| email: email, | email: email, | ||||
| pass: pass, | pass: pass, | ||||
| }), | }), | ||||
| @@ -144,23 +140,22 @@ export default function RegisterPage(props) { | |||||
| ), | ), | ||||
| }} | }} | ||||
| /> | /> | ||||
| {/* <CustomInput | |||||
| labelText="Tanggal Lahir" | |||||
| id="date_birth" | |||||
| value={date_birth} | |||||
| <CustomInput | |||||
| labelText="Username" | |||||
| id="username" | |||||
| value={username} | |||||
| formControlProps={{ | formControlProps={{ | ||||
| fullWidth: true, | fullWidth: true, | ||||
| }} | }} | ||||
| inputProps={{ | inputProps={{ | ||||
| type: "date", | |||||
| onChange: (event) => setDate(event.target.value), | |||||
| type: "text", | |||||
| endAdornment: ( | endAdornment: ( | ||||
| <InputAdornment position="end"> | <InputAdornment position="end"> | ||||
| <Event className={classes.inputIconsColor} /> | |||||
| <People className={classes.inputIconsColor} /> | |||||
| </InputAdornment> | </InputAdornment> | ||||
| ), | ), | ||||
| }} | }} | ||||
| /> */} | |||||
| /> | |||||
| <CustomInput | <CustomInput | ||||
| labelText="Email..." | labelText="Email..." | ||||
| id="email" | id="email" | ||||