mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init sign up page
This commit is contained in:
parent
920339b5fd
commit
67ce2e7371
5 changed files with 84 additions and 17 deletions
|
|
@ -5,7 +5,7 @@ import Layout from "../components/ui/layout";
|
|||
const Home: NextPage = () => {
|
||||
return (
|
||||
<div>
|
||||
<Layout>
|
||||
<Layout title="Index">
|
||||
<Title>Home</Title>
|
||||
</Layout>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ const Login = () => {
|
|||
|
||||
const handleSubmit = (e: any) => {
|
||||
e.preventDefault();
|
||||
console.log(email, password);
|
||||
console.log({ email, password });
|
||||
alert(JSON.stringify({ email, password }));
|
||||
};
|
||||
|
||||
const handleEmailChange = (e: any) => {
|
||||
|
|
@ -21,7 +22,7 @@ const Login = () => {
|
|||
|
||||
return (
|
||||
<div>
|
||||
<Layout>
|
||||
<Layout title="Login">
|
||||
<Title>Login</Title>
|
||||
|
||||
<form>
|
||||
|
|
|
|||
|
|
@ -3,10 +3,43 @@ import Layout from "../components/ui/layout";
|
|||
import { Title } from "../components/ui/styles/title";
|
||||
|
||||
const SignUp = () => {
|
||||
return <div>
|
||||
<Layout>
|
||||
<Title>Sign up </Title>
|
||||
</Layout>
|
||||
</div>;
|
||||
const [email, setEmail] = React.useState("");
|
||||
const [password, setPassword] = React.useState("");
|
||||
const [username, setUsername] = React.useState("");
|
||||
|
||||
const handleSubmit = (e: any) => {
|
||||
e.preventDefault();
|
||||
console.log({ email, password, username });
|
||||
alert(JSON.stringify({ email, password, username }));
|
||||
};
|
||||
|
||||
const handleEmailChange = (e: any) => {
|
||||
setEmail(e.target.value);
|
||||
};
|
||||
|
||||
const handlePasswordChange = (e: any) => {
|
||||
setPassword(e.target.value);
|
||||
};
|
||||
|
||||
const handleUsernameChange = (e: any) => {
|
||||
setUsername(e.target.value);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Layout title="Sign up">
|
||||
<Title>Sign up </Title>
|
||||
|
||||
<form>
|
||||
<input onChange={handleUsernameChange} type="text" placeholder="username" />
|
||||
<input onChange={handleEmailChange} type="text" placeholder="email" />
|
||||
<input onChange={handlePasswordChange} type="password" placeholder="password" />
|
||||
<button onClick={handleSubmit} type="submit">
|
||||
Sign up
|
||||
</button>
|
||||
</form>
|
||||
</Layout>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default SignUp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue