🍲
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import React from 'react'
|
||||
import { RouteChildrenProps } from 'react-router'
|
||||
|
||||
type Props = RouteChildrenProps & {}
|
||||
|
||||
export const Dashboard = (_: Props) => {
|
||||
return <p>a dashboard</p>
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import React, { 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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
type Props = {}
|
||||
|
||||
export const Profile = (props: Props) => {
|
||||
return <p>Look, A user profile!</p>
|
||||
}
|
||||
Reference in New Issue
Block a user