()
| 120 | const MotionHand = motion(HandIcon); |
| 121 | |
| 122 | export default function Page() { |
| 123 | const user = useUser(); |
| 124 | const lastSubmission = useActionData(); |
| 125 | const [enteredEmail, setEnteredEmail] = useState<string>(user.email ?? ""); |
| 126 | const { isManagedCloud } = useFeatures(); |
| 127 | |
| 128 | const [form, { name, email, confirmEmail, referralSource }] = useForm({ |
| 129 | id: "confirm-basic-details", |
| 130 | // TODO: type this |
| 131 | lastSubmission: lastSubmission as any, |
| 132 | onValidate({ formData }) { |
| 133 | return parse(formData, { schema: createSchema() }); |
| 134 | }, |
| 135 | shouldRevalidate: "onSubmit", |
| 136 | }); |
| 137 | |
| 138 | const shouldShowConfirm = user.email !== enteredEmail || user.email === ""; |
| 139 | |
| 140 | return ( |
| 141 | <AppContainer> |
| 142 | <MainCenteredContainer className="max-w-[22rem]"> |
| 143 | <Form method="post" {...form.props}> |
| 144 | <FormTitle |
| 145 | title="Welcome to Trigger.dev" |
| 146 | LeadingIcon={ |
| 147 | <MotionHand |
| 148 | style={{ |
| 149 | originY: 0.75, |
| 150 | }} |
| 151 | initial={{ |
| 152 | rotate: 0, |
| 153 | }} |
| 154 | animate={{ |
| 155 | rotate: [0, -20, 0, 20, 0, -20, 0, 20, 0], |
| 156 | }} |
| 157 | transition={{ |
| 158 | delay: 1, |
| 159 | duration: 1, |
| 160 | repeatDelay: 5, |
| 161 | repeat: Infinity, |
| 162 | ease: "linear", |
| 163 | }} |
| 164 | /> |
| 165 | } |
| 166 | description="We just need you to confirm a couple of details, it'll only take a minute." |
| 167 | /> |
| 168 | <Fieldset> |
| 169 | <InputGroup> |
| 170 | <Label htmlFor={name.id}>Full name</Label> |
| 171 | <Input |
| 172 | {...conform.input(name, { type: "text" })} |
| 173 | defaultValue={user.name ?? ""} |
| 174 | placeholder="Your full name" |
| 175 | icon="user" |
| 176 | autoFocus |
| 177 | /> |
| 178 | <Hint>Your team will see this name and we'll use it if we need to contact you.</Hint> |
| 179 | <FormError id={name.errorId}>{name.error}</FormError> |
nothing calls this directly
no test coverage detected
searching dependent graphs…