From 91d811e289ac6e46fc9be50e360f2de27dfb841a Mon Sep 17 00:00:00 2001 From: nocnico Date: Thu, 5 Jun 2025 23:36:11 +0200 Subject: [PATCH] Fix som Bugs #33 --- apps/hub/app/(app)/events/_components/modalBtn.tsx | 2 ++ apps/hub/app/(app)/layout.tsx | 6 ++++++ apps/hub/app/(app)/page.tsx | 4 ---- apps/hub/app/(app)/settings/_components/forms.tsx | 6 +++--- apps/hub/app/_components/ui/DateInput.tsx | 9 ++------- apps/hub/app/_components/ui/PageAlert.tsx | 12 ++++++------ apps/hub/app/globals.css | 8 ++++++++ 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/apps/hub/app/(app)/events/_components/modalBtn.tsx b/apps/hub/app/(app)/events/_components/modalBtn.tsx index 0be4ce18..230b81fa 100644 --- a/apps/hub/app/(app)/events/_components/modalBtn.tsx +++ b/apps/hub/app/(app)/events/_components/modalBtn.tsx @@ -96,6 +96,7 @@ const ModalBtn = ({ eventCompleted(event, participant) && "btn-success", )} onClick={openModal} + disabled={eventCompleted(event, participant)} > {participant && !eventCompleted(event, participant) && ( <> @@ -234,6 +235,7 @@ const ModalBtn = ({ router.refresh(); closeModal(); }} + disabled={!selectAppointmentForm.watch("eventAppointmentId")} > Anmelden diff --git a/apps/hub/app/(app)/layout.tsx b/apps/hub/app/(app)/layout.tsx index e23f6456..8fa9bd16 100644 --- a/apps/hub/app/(app)/layout.tsx +++ b/apps/hub/app/(app)/layout.tsx @@ -5,6 +5,7 @@ import { Toaster } from "react-hot-toast"; import { redirect } from "next/navigation"; import { getServerSession } from "../api/auth/[...nextauth]/auth"; import { Error } from "_components/Error"; +import { EmailVerification } from "_components/EmailVerification"; export const metadata: Metadata = { title: "VAR: Hub", @@ -47,6 +48,11 @@ export default async function RootLayout({ {/* Scrollbarer Content-Bereich */}
+ {!session?.user.emailVerified && ( +
+ +
+ )} {children}
diff --git a/apps/hub/app/(app)/page.tsx b/apps/hub/app/(app)/page.tsx index aa784251..94a30521 100644 --- a/apps/hub/app/(app)/page.tsx +++ b/apps/hub/app/(app)/page.tsx @@ -1,8 +1,6 @@ import Events from "./_components/Events"; import { Stats } from "./_components/Stats"; import { Badges } from "./_components/Badges"; -import { getServerSession } from "api/auth/[...nextauth]/auth"; -import { EmailVerification } from "_components/EmailVerification"; import { RecentFlights } from "(app)/_components/RecentFlights"; export default async function Home({ @@ -10,12 +8,10 @@ export default async function Home({ }: { searchParams: Promise<{ stats?: "pilot" | "dispo" }>; }) { - const session = await getServerSession(); const { stats } = await searchParams; const view = stats || "pilot"; return (
- {!session?.user.emailVerified && }
diff --git a/apps/hub/app/(app)/settings/_components/forms.tsx b/apps/hub/app/(app)/settings/_components/forms.tsx index 3ee59233..9e79d5ad 100644 --- a/apps/hub/app/(app)/settings/_components/forms.tsx +++ b/apps/hub/app/(app)/settings/_components/forms.tsx @@ -289,7 +289,7 @@ export const PasswordForm = (): React.JSX.Element => { @@ -303,7 +303,7 @@ export const PasswordForm = (): React.JSX.Element => { @@ -317,7 +317,7 @@ export const PasswordForm = (): React.JSX.Element => { diff --git a/apps/hub/app/_components/ui/DateInput.tsx b/apps/hub/app/_components/ui/DateInput.tsx index a479bd65..6558d627 100644 --- a/apps/hub/app/_components/ui/DateInput.tsx +++ b/apps/hub/app/_components/ui/DateInput.tsx @@ -1,11 +1,5 @@ import DatePicker, { DatePickerProps, registerLocale } from "react-datepicker"; -import { - Control, - Controller, - FieldValues, - Path, - PathValue, -} from "react-hook-form"; +import { Control, Controller, FieldValues, Path } from "react-hook-form"; import { de } from "date-fns/locale"; registerLocale("de", de); @@ -26,6 +20,7 @@ export const DateInput = ({ name={name} render={({ field }) => ( field.onChange(date)} selected={field.value} diff --git a/apps/hub/app/_components/ui/PageAlert.tsx b/apps/hub/app/_components/ui/PageAlert.tsx index 2eae1bf1..827449e1 100644 --- a/apps/hub/app/_components/ui/PageAlert.tsx +++ b/apps/hub/app/_components/ui/PageAlert.tsx @@ -15,19 +15,19 @@ export const WarningAlert = async () => { let msgColor; switch (mainMessage?.color) { case "WARNING": - msgColor = "alert alert-warning ml-3"; + msgColor = "alert alert-soft alert-warning ml-3 py-2"; break; case "INFO": - msgColor = "alert alert-info ml-3"; + msgColor = "alert alert-soft alert-info ml-3 py-2"; break; case "SUCCESS": - msgColor = "alert alert-success ml-3"; + msgColor = "alert alert-soft alert-success ml-3 py-2"; break; case "ERROR": - msgColor = "alert alert-error ml-3"; + msgColor = "alert alert-error ml-3 py-2"; break; default: - msgColor = "alert ml-3"; + msgColor = "alert alert-soft ml-3 py-2"; } if (mainMessage?.message == "" || !mainMessage) { @@ -36,7 +36,7 @@ export const WarningAlert = async () => { return (
- {mainMessage?.message} + {mainMessage?.message}
); } diff --git a/apps/hub/app/globals.css b/apps/hub/app/globals.css index b5c34389..b83e488c 100644 --- a/apps/hub/app/globals.css +++ b/apps/hub/app/globals.css @@ -19,6 +19,14 @@ } } +:root:has(:is(.modal-open, .modal:target, .modal-toggle:checked + .modal, .modal[open])) { + scrollbar-gutter: unset; +} + +.react-datepicker-popper { + z-index: 9999 !important; +} + :root { --background: #ffffff; --foreground: #171717;