diff --git a/app/_components/account-email-form.tsx b/app/_components/account-email-form.tsx index b9fd4af7..b0ac9fb5 100644 --- a/app/_components/account-email-form.tsx +++ b/app/_components/account-email-form.tsx @@ -28,6 +28,7 @@ const AccountEmailForm = ({ user }: AccountEmailFormProps) => { return (
startTransition(async () => { const supabase = createBrowserSupabaseClient(); @@ -47,20 +48,16 @@ const AccountEmailForm = ({ user }: AccountEmailFormProps) => { }), )} > -
- -
+ {form.formState.errors.root && ( -
- {form.formState.errors.root.message} -
+
{form.formState.errors.root.message}
)} -
+
Close diff --git a/app/_components/account-password-form.tsx b/app/_components/account-password-form.tsx index f2703c1e..e44dd812 100644 --- a/app/_components/account-password-form.tsx +++ b/app/_components/account-password-form.tsx @@ -23,6 +23,7 @@ const AccountPasswordForm = () => { return ( startTransition(async () => { const supabase = createBrowserSupabaseClient(); @@ -44,21 +45,17 @@ const AccountPasswordForm = () => { }), )} > -
- -
+ {form.formState.errors.root && ( -
- {form.formState.errors.root.message} -
+
{form.formState.errors.root.message}
)} -
+
Close diff --git a/app/_components/account-profile-form.tsx b/app/_components/account-profile-form.tsx index 7ccb0a76..889c45fa 100644 --- a/app/_components/account-profile-form.tsx +++ b/app/_components/account-profile-form.tsx @@ -35,6 +35,7 @@ const AccountProfileForm = ({ user }: AccountProfileFormProps) => { return ( startTransition(async () => { const supabase = createBrowserSupabaseClient(); @@ -71,37 +72,33 @@ const AccountProfileForm = ({ user }: AccountProfileFormProps) => { }), )} > -
-
- - -
-
- - {form.watch('avatar') && ( - - )} -
+
+ + +
+
+ + {form.watch('avatar') && ( + + )}
{form.formState.errors.root && ( -
- {form.formState.errors.root.message} -
+
{form.formState.errors.root.message}
)} -
+
Close diff --git a/app/_components/change-password-form.tsx b/app/_components/change-password-form.tsx index 208d352f..cec779c7 100644 --- a/app/_components/change-password-form.tsx +++ b/app/_components/change-password-form.tsx @@ -9,7 +9,7 @@ const ChangePasswordForm = () => { const [state, action] = useActionState(updatePassword, null); return ( - + {}} - className={twMerge('flex flex-col gap-6 px-4 sm:px-8', className)} + className={twMerge('flex flex-col gap-8 px-4 sm:px-8', className)} onSubmit={form.handleSubmit((values) => startTransition(async () => { pendingComment.current = values.comment; @@ -299,12 +299,10 @@ const EventForm = ({ /> )} {form.formState.errors.root && ( -
- {form.formState.errors.root.message} -
+
{form.formState.errors.root.message}
)} {!isPublic && !isArchived && (!event || form.formState.isDirty) && ( -
+
{!event && !isMission && ( Close diff --git a/app/_components/event-type-form.tsx b/app/_components/event-type-form.tsx index 465ed2bd..707ad464 100644 --- a/app/_components/event-type-form.tsx +++ b/app/_components/event-type-form.tsx @@ -128,7 +128,7 @@ const EventTypeForm = ({ )} /> {form.formState.errors.root && ( -
+
{form.formState.errors.root.message}
)} diff --git a/app/_components/forgot-password-form.tsx b/app/_components/forgot-password-form.tsx index 46781a2c..f6bf8ce8 100644 --- a/app/_components/forgot-password-form.tsx +++ b/app/_components/forgot-password-form.tsx @@ -12,7 +12,7 @@ const ForgotPasswordForm = () => { }); return ( - + +
Module {(eventType.order as number) + 1} {eventType.name ? `: ${eventType.name}` : ''} diff --git a/app/_components/sign-in-form.tsx b/app/_components/sign-in-form.tsx index 9303e929..3b38056a 100644 --- a/app/_components/sign-in-form.tsx +++ b/app/_components/sign-in-form.tsx @@ -16,7 +16,7 @@ const SignInForm = ({ next }: SignInFormProps) => { }); return ( - + { }); return ( - +
{ return ( startTransition(async () => { const res = await upsertSubject( @@ -84,117 +85,113 @@ const SubjectForm = ({ subject }: SubjectFormProps) => { }), )} > -
- -
- - {form.watch('avatar') && ( - - )} + +
+ + {form.watch('avatar') && ( + + )} +
+ ( + + An optional note displayed at the top of the subject’s + profile. + + } + {...field} + /> + )} + /> +
+
+ Links + + Optional links displayed at the top of the subject’s + profile. +
- ( - - An optional note displayed at the top of the subject’s - profile. - - } - {...field} - /> +
+ {!!linkArray.fields.length && ( +
    + {linkArray.fields.map((link, linkIndex) => ( +
  • + ( + } + label="Delete link" + onClick={() => linkArray.remove(linkIndex)} + tabIndex={-1} + /> + } + {...field} + /> + )} + /> + ( + + )} + /> +
  • + ))} +
)} - /> -
-
- Links - - Optional links displayed at the top of the subject’s - profile. - -
-
- {!!linkArray.fields.length && ( -
    - {linkArray.fields.map((link, linkIndex) => ( -
  • - ( - } - label="Delete link" - onClick={() => linkArray.remove(linkIndex)} - tabIndex={-1} - /> - } - {...field} - /> - )} - /> - ( - - )} - /> -
  • - ))} -
- )} - -
-
-
- {form.formState.errors.root && ( -
- {form.formState.errors.root.message} +
+
+ {form.formState.errors.root && ( +
{form.formState.errors.root.message}
)} -
+
Close diff --git a/app/_components/subject-page.tsx b/app/_components/subject-page.tsx index 1c6f82be..1c139224 100644 --- a/app/_components/subject-page.tsx +++ b/app/_components/subject-page.tsx @@ -42,14 +42,13 @@ const SubjectPage = async ({ }: SubjectPageProps) => { const f = formatEventFilters({ from, limit, to }); - const [{ data: subject }, { data: events, error }, user] = await Promise.all([ + const [{ data: subject }, { data: events }, user] = await Promise.all([ isPublic ? getPublicSubject(subjectId) : getSubject(subjectId), isPublic ? await listPublicEvents(subjectId, f) : await listEvents(subjectId, f), getCurrentUser(), ]); - console.log(error); if (!subject) return null; const isTeamMember = !!user && subject.team_id === user.id; diff --git a/app/_components/template-form.tsx b/app/_components/template-form.tsx index edf5d0ef..87d469e8 100644 --- a/app/_components/template-form.tsx +++ b/app/_components/template-form.tsx @@ -132,7 +132,7 @@ const TemplateForm = ({ )} /> {form.formState.errors.root && ( -
+
{form.formState.errors.root.message}
)} diff --git a/app/_components/training-plan-form.tsx b/app/_components/training-plan-form.tsx index 7aee1286..270416a3 100644 --- a/app/_components/training-plan-form.tsx +++ b/app/_components/training-plan-form.tsx @@ -29,6 +29,7 @@ const TrainingPlanForm = ({ mission, subjectId }: TrainingPlanFormProps) => { return ( startTransition(async () => { const res = await upsertTrainingPlan( @@ -53,21 +54,17 @@ const TrainingPlanForm = ({ mission, subjectId }: TrainingPlanFormProps) => { }), )} > -
- -
+ {form.formState.errors.root && ( -
- {form.formState.errors.root.message} -
+
{form.formState.errors.root.message}
)} -
+
Close diff --git a/bun.lockb b/bun.lockb index 79b80469..96445c19 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index bc846fef..728876a6 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "lodash": "^4.17.21", "nanoid": "^5.0.7", "next": "canary", - "prettier": "^3.3.2", + "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^3.2.4", "prettier-plugin-tailwindcss": "^0.6.5", "react": "canary",