add routes
This commit is contained in:
@@ -2,7 +2,8 @@ import type { Route } from '../+types'
|
||||
|
||||
import { PatternFormat } from 'react-number-format'
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { useState, createContext, type ReactNode, use } from 'react'
|
||||
import { useState } from 'react'
|
||||
import { CheckCircle2Icon } from 'lucide-react'
|
||||
import { useForm } from 'react-hook-form'
|
||||
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
@@ -20,6 +21,11 @@ import { Label } from '@repo/ui/components/ui/label'
|
||||
|
||||
import { Cpf } from './cpf'
|
||||
import { formSchema, type Schema, RegisterContext, type User } from './data'
|
||||
import {
|
||||
Alert,
|
||||
AlertDescription,
|
||||
AlertTitle
|
||||
} from '@repo/ui/components/ui/alert'
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: 'Criar conta · EDUSEG®' }]
|
||||
@@ -44,6 +50,17 @@ export default function Signup({}: Route.ComponentProps) {
|
||||
{user ? (
|
||||
<Form {...form}>
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="grid gap-6">
|
||||
{user?.never_logged && (
|
||||
<Alert>
|
||||
<CheckCircle2Icon />
|
||||
<AlertTitle>Confirme seus dados</AlertTitle>
|
||||
<AlertDescription>
|
||||
Revise suas informações e edite o que precisar antes de
|
||||
continuar.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<FormField
|
||||
control={control}
|
||||
name="name"
|
||||
@@ -109,7 +126,25 @@ export default function Signup({}: Route.ComponentProps) {
|
||||
<FormControl>
|
||||
<Input
|
||||
type={show ? 'text' : 'password'}
|
||||
placeholder="••••••••"
|
||||
autoComplete="false"
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={control}
|
||||
name="password"
|
||||
defaultValue=""
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Confirmar senha</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type={show ? 'text' : 'password'}
|
||||
autoComplete="false"
|
||||
{...field}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user