This commit is contained in:
Elijah Lucian
2021-04-11 15:52:48 -07:00
parent 0df8bf9445
commit c3d1017419
10 changed files with 52 additions and 24 deletions
-3
View File
@@ -1,3 +0,0 @@
export const Dashboard = () => {
return <p>a dashboard</p>
}
-31
View File
@@ -1,31 +0,0 @@
import { FormEvent, useState } from 'react'
import { useUserContext } from '../contexts/UserContext'
export const Login = () => {
const { handleLogin } = useUserContext()
const [username, setUsername] = useState('')
const [password, setPassword] = useState('')
const handleSubmit = (e: FormEvent) => {
e.preventDefault()
handleLogin(username, password)
}
return (
<form onSubmit={handleSubmit}>
<input
onChange={(e) => setUsername(e.target.value)}
type="text"
value={username}
/>
<input
onChange={(e) => setPassword(e.target.value)}
type="text"
value={password}
/>
<button type="submit">Login!</button>
</form>
)
}
-3
View File
@@ -1,3 +0,0 @@
export const Profile = () => {
return <p>Look, A user profile!</p>
}
-14
View File
@@ -1,14 +0,0 @@
import { Form, Input, Layout } from 'antd'
import { User } from '../../types'
export const NewUser = () => {
const [form] = Form.useForm<User>()
return (
<Form form={form}>
<Form.Item label="username" name="name">
<Input></Input>
</Form.Item>
</Form>
)
}