This commit is contained in:
Elijah
2021-03-07 18:18:51 -07:00
parent 8f35bf735d
commit 11cf67b594
29 changed files with 27700 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
import React from 'react'
import { useState } from 'react'
import { useHistory } from 'react-router-dom'
import { createClient } from '../api'
export const Dashboard = () => {
const history = useHistory()
const [name, setName] = useState('')
const [email, setEmail] = useState('')
const [phone, setPhone] = useState('')
const handleReset = () => {
//
}
const handleSubmit = async () => {
// phone number is stripped for numbers
await createClient({ name, email, phone })
history.push(`/sessions/${phone}`)
}
return (
<div>
<h1>Dashboard</h1>
<form onSubmit={handleSubmit}>
<label htmlFor="name">
Name:
<input type="text" name="name" />
</label>
<label htmlFor="email">
Email:
<input type="email" name="email" />
</label>
<label htmlFor="phone">
Phone:
<input type="phone" name="phone" />
</label>
<button type="submit">Start Session</button>
<button onClick={handleReset}>Reset</button>
</form>
<div>TODO: List of past sessions for review?</div>
</div>
)
}

View File

@@ -0,0 +1,15 @@
import React from 'react'
import { useEffect } from 'react'
import { RouteComponentProps } from 'react-router-dom'
type Props = RouteComponentProps<{ clientId: string }>
export const Session = (props: Props) => {
const { clientId } = props.match.params
const [submitted, setSubmitted] = useState(false)
useEffect(() => {})
return <div>Session {clientId}</div>
}