⚡
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user