| @@ -18,7 +18,7 @@ import CardBody from "components/Card/CardBody.js"; | |||||
| import CardHeader from "components/Card/CardHeader.js"; | import CardHeader from "components/Card/CardHeader.js"; | ||||
| import CardFooter from "components/Card/CardFooter.js"; | import CardFooter from "components/Card/CardFooter.js"; | ||||
| import CustomInput from "components/CustomInput/CustomInput.js"; | import CustomInput from "components/CustomInput/CustomInput.js"; | ||||
| import Grid from '@material-ui/core/Grid'; | |||||
| import Grid from "@material-ui/core/Grid"; | |||||
| import styles from "assets/jss/nextjs-material-kit/pages/loginPage.js"; | import styles from "assets/jss/nextjs-material-kit/pages/loginPage.js"; | ||||
| @@ -47,6 +47,8 @@ export default function LoginPage(props) { | |||||
| const submitHandler = async (event) => { | const submitHandler = async (event) => { | ||||
| event.preventDefault(); | event.preventDefault(); | ||||
| setEmail(event.target.email.value); | |||||
| setPass(event.target.pass.value); | |||||
| const res = await fetch("../api/auth/login", { | const res = await fetch("../api/auth/login", { | ||||
| body: JSON.stringify({ | body: JSON.stringify({ | ||||
| partner: "yamaha", | partner: "yamaha", | ||||
| @@ -98,67 +100,73 @@ export default function LoginPage(props) { | |||||
| }} | }} | ||||
| > | > | ||||
| <div className={classes.container}> | <div className={classes.container}> | ||||
| <Grid container> | |||||
| <GridItem className={classes.marginAuto}> | |||||
| <Grid container> | |||||
| <GridItem className={classes.marginAuto}> | |||||
| <Carousel> | <Carousel> | ||||
| <Card className={classes[cardAnimaton]}> | |||||
| <form onSubmit={submitHandler} className={classes.form}> | |||||
| <CardHeader color="info" className={classes.cardHeader}> | |||||
| <h4><b>Login</b></h4> | |||||
| </CardHeader> | |||||
| <h4 className={classes.divider}><b>Selamat Datang di Halaman Login Thamrin Brothers</b></h4> | |||||
| <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="/yamaha/register" color="info" size="lg"> | |||||
| Register | |||||
| </Button> | |||||
| </CardFooter> | |||||
| </form> | |||||
| </Card> | |||||
| </Carousel> | |||||
| </GridItem> | |||||
| </Grid> | |||||
| <Card className={classes[cardAnimaton]}> | |||||
| <form onSubmit={submitHandler} className={classes.form}> | |||||
| <CardHeader color="info" className={classes.cardHeader}> | |||||
| <h4> | |||||
| <b>Login</b> | |||||
| </h4> | |||||
| </CardHeader> | |||||
| <h4 className={classes.divider}> | |||||
| <b>Selamat Datang di Halaman Login Thamrin Brothers</b> | |||||
| </h4> | |||||
| <CardBody> | |||||
| <CustomInput | |||||
| labelText="Email..." | |||||
| id="email" | |||||
| value={email} | |||||
| formControlProps={{ | |||||
| fullWidth: true, | |||||
| }} | |||||
| inputProps={{ | |||||
| type: "email", | |||||
| name: "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={{ | |||||
| name: "pass", | |||||
| 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="/yamaha/register" color="info" size="lg"> | |||||
| Register | |||||
| </Button> | |||||
| </CardFooter> | |||||
| </form> | |||||
| </Card> | |||||
| </Carousel> | |||||
| </GridItem> | |||||
| </Grid> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||