This commit is contained in:
E
2021-03-07 20:08:18 -07:00
parent 963939d511
commit 181a2bbb74
10 changed files with 1958 additions and 18 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ import settings from '../settings'
export const Dashboard = () => {
const history = useHistory()
const [error, setError] = useState<string | null>(null)
const [name, setName] = useState('')
const [email, setEmail] = useState('')
const [phone, setPhone] = useState('')
@@ -20,6 +21,12 @@ export const Dashboard = () => {
const handleSubmit = async (e: FormEvent) => {
e.preventDefault()
if (phone.length < 10) {
// helpful message
setError('Phone number needs to be a length of at least 10')
return
}
if (settings.env === 'jank') {
history.push(`/sessions/${phone}`)
return
@@ -63,8 +70,8 @@ export const Dashboard = () => {
<button type="button" onClick={handleReset}>
Reset
</button>
{error && <p className="error">{error}</p>}
</form>
<div>TODO: List of past sessions for review?</div>
</div>
)
}