added prettierrc.yaml and reformatted the code
This commit is contained in:
parent
308ae6ab88
commit
f8be8ba9a3
3
.prettierrc.yaml
Normal file
3
.prettierrc.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
trailingComma: "es5"
|
||||
tabWidth: 4
|
||||
arrowParens: "avoid"
|
@ -1,11 +1,10 @@
|
||||
import React from 'react'
|
||||
import Login from "@components/Login"
|
||||
import ForgotPassword from "@components/ForgotPassword"
|
||||
import variables from "@scss/variables.module.scss"
|
||||
// import variables from "@scss/variables.module.scss"
|
||||
import "@scss/style.scss"
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<ForgotPassword />
|
||||
<Login />
|
||||
);
|
||||
}
|
20
src/components/ErrorPage.tsx
Normal file
20
src/components/ErrorPage.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import * as React from "react";
|
||||
import { useRouteError } from "react-router-dom";
|
||||
import "@scss/error.scss"
|
||||
|
||||
export default function ErrorPage() {
|
||||
const error: any = useRouteError();
|
||||
console.error(error);
|
||||
|
||||
return (
|
||||
<main id="root">
|
||||
<div id="error-page">
|
||||
<h1>Oops!</h1>
|
||||
<p>Sorry, an unexpected error has occurred.</p>
|
||||
<p>
|
||||
<i>{error.statusText || error.message}</i>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import React, { useState, ChangeEvent, MouseEvent } from "react";
|
||||
import { Card, Button, TextField } from "@mui/material"
|
||||
import "@scss/forgot_password.scss"
|
||||
import { Card, Button, TextField } from "@mui/material";
|
||||
import "@scss/forgot_password.scss";
|
||||
|
||||
export default function ForgotPassword() {
|
||||
const [email, setEmail] = useState("");
|
||||
@ -12,20 +12,41 @@ export default function ForgotPassword() {
|
||||
|
||||
function buttonSubmit(e: MouseEvent<HTMLButtonElement>) {
|
||||
e.preventDefault();
|
||||
console.log(`Sumbitting email "${email}" to which send a link.`)
|
||||
console.log(`Sumbitting email "${email}" to which send a link.`);
|
||||
}
|
||||
|
||||
return (
|
||||
<main id="root">
|
||||
<Card className="card">
|
||||
<h3>Forgot Passowrd</h3>
|
||||
<p>If you have forgot your password, we can send you an email with a link to reset it.</p>
|
||||
<TextField id="email" label="Email" value={email} onChange={handleEmail} />
|
||||
<p>
|
||||
If you have forgot your password, we can send you an email
|
||||
with a link to reset it.
|
||||
</p>
|
||||
<TextField
|
||||
className="textfield"
|
||||
id="email"
|
||||
label="Email"
|
||||
value={email}
|
||||
onChange={handleEmail}
|
||||
/>
|
||||
<div className="buttons">
|
||||
<Button id="cancel" variant="outlined" onClick={buttonSubmit}>Cancel</Button>
|
||||
<Button id="submit" variant="contained" onClick={buttonSubmit}>Login</Button>
|
||||
<Button
|
||||
id="cancel"
|
||||
variant="outlined"
|
||||
onClick={buttonSubmit}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
id="submit"
|
||||
variant="contained"
|
||||
onClick={buttonSubmit}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</main>
|
||||
)
|
||||
);
|
||||
}
|
@ -29,8 +29,8 @@ export default function Login() {
|
||||
<main id="root">
|
||||
<Card className="card">
|
||||
<h3>Login</h3>
|
||||
<TextField id="email" label="Email" value={email} onChange={handleEmail} />
|
||||
<TextField id="password" label="Password" type="password" value={password} onChange={handlePassword}/>
|
||||
<TextField className="textfield" id="email" label="Email" value={email} onChange={handleEmail} />
|
||||
<TextField className="textfield" id="password" label="Password" type="password" value={password} onChange={handlePassword}/>
|
||||
<Button id="submit" variant="contained" onClick={buttonSubmit}>Login</Button>
|
||||
<p>Forgot your <a href="/">password</a>?</p>
|
||||
</Card>
|
||||
|
Loading…
Reference in New Issue
Block a user