@@ -6,8 +6,18 @@ import { Component, Form } from "effect-fc"
|
||||
import { useContext, useFork } from "effect-fc/hooks"
|
||||
|
||||
|
||||
const email = Schema.pattern<typeof Schema.String>(
|
||||
/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i,
|
||||
|
||||
{
|
||||
identifier: "email",
|
||||
title: "email",
|
||||
message: () => "Not an email address",
|
||||
},
|
||||
)
|
||||
|
||||
const RegisterFormSchema = Schema.Struct({
|
||||
email: Schema.String,
|
||||
email: Schema.String.pipe(email),
|
||||
password: Schema.String.pipe(Schema.minLength(3)),
|
||||
})
|
||||
|
||||
@@ -24,6 +34,7 @@ class RegisterPage extends Component.makeUntraced(function* RegisterPage() {
|
||||
const passwordInput = yield* Form.useInput(form, ["password"], { debounce: "200 millis" })
|
||||
|
||||
yield* useFork(() => Stream.runForEach(form.valueRef.changes, Console.log), [])
|
||||
// yield* useFork(() => Stream.runForEach(form.errorRef.changes, Console.log), [])
|
||||
|
||||
return (
|
||||
<Container>
|
||||
|
||||
Reference in New Issue
Block a user