From 5d5b2dc91f4fcbac04413aa684eeac2462985f18 Mon Sep 17 00:00:00 2001 From: PxlLoewe <72106766+PxlLoewe@users.noreply.github.com> Date: Tue, 27 May 2025 11:19:18 -0700 Subject: [PATCH] removed static props for PageAlert --- apps/dispatch-server/Dockerfile | 2 +- apps/dispatch/Dockerfile | 2 +- apps/hub-server/Dockerfile | 2 +- apps/hub/Dockerfile | 5 +- .../event/_components/AppointmentModal.tsx | 4 +- apps/hub/app/(app)/admin/event/page.tsx | 68 +++++++++---------- apps/hub/app/(app)/layout.tsx | 11 +-- .../logbook/_components/LogbookTable.tsx | 46 ------------- apps/hub/app/(app)/logbook/page.tsx | 7 +- apps/hub/app/(app)/page.tsx | 10 --- apps/hub/app/_components/ui/PageAlert.tsx | 53 ++++++--------- docker-compose.prod.yml | 2 +- 12 files changed, 70 insertions(+), 142 deletions(-) delete mode 100644 apps/hub/app/(app)/logbook/_components/LogbookTable.tsx diff --git a/apps/dispatch-server/Dockerfile b/apps/dispatch-server/Dockerfile index e25ded30..639fdbfb 100644 --- a/apps/dispatch-server/Dockerfile +++ b/apps/dispatch-server/Dockerfile @@ -25,7 +25,7 @@ RUN apk add --no-cache libc6-compat WORKDIR /usr/app COPY --from=builder /usr/app/out/json/ . -RUN pnpm install --frozen-lockfile +RUN pnpm install # Build the project COPY --from=builder /usr/app/out/full/ . diff --git a/apps/dispatch/Dockerfile b/apps/dispatch/Dockerfile index 378bc68a..a6cc8923 100644 --- a/apps/dispatch/Dockerfile +++ b/apps/dispatch/Dockerfile @@ -23,7 +23,7 @@ RUN apk add --no-cache libc6-compat WORKDIR /usr/app COPY --from=builder /usr/app/out/json/ . -RUN pnpm install --frozen-lockfile +RUN pnpm install # Build the project COPY --from=builder /usr/app/out/full/ . diff --git a/apps/hub-server/Dockerfile b/apps/hub-server/Dockerfile index 41502f8f..3ca061c1 100644 --- a/apps/hub-server/Dockerfile +++ b/apps/hub-server/Dockerfile @@ -25,7 +25,7 @@ RUN apk add --no-cache libc6-compat WORKDIR /usr/app COPY --from=builder /usr/app/out/json/ . -RUN pnpm install --frozen-lockfile +RUN pnpm install # Build the project COPY --from=builder /usr/app/out/full/ . diff --git a/apps/hub/Dockerfile b/apps/hub/Dockerfile index 7c402f9f..edcbefd2 100644 --- a/apps/hub/Dockerfile +++ b/apps/hub/Dockerfile @@ -1,5 +1,8 @@ FROM node:22-alpine AS base +ARG DATABASE_URL +ENV DATABASE_URL=${DATABASE_URL} + ENV PNPM_HOME="/usr/local/pnpm" ENV PATH="${PNPM_HOME}:${PATH}" RUN corepack enable && corepack prepare pnpm@latest --activate @@ -23,7 +26,7 @@ RUN apk add --no-cache libc6-compat WORKDIR /usr/app COPY --from=builder /usr/app/out/json/ . -RUN pnpm install --frozen-lockfile +RUN pnpm install # Build the project COPY --from=builder /usr/app/out/full/ . diff --git a/apps/hub/app/(app)/admin/event/_components/AppointmentModal.tsx b/apps/hub/app/(app)/admin/event/_components/AppointmentModal.tsx index 289cb5e7..869ce82e 100644 --- a/apps/hub/app/(app)/admin/event/_components/AppointmentModal.tsx +++ b/apps/hub/app/(app)/admin/event/_components/AppointmentModal.tsx @@ -15,8 +15,8 @@ interface AppointmentModalProps { ref: RefObject; participantModal: RefObject; appointmentsTableRef: React.RefObject; - appointmentForm: UseFormReturn; - participantForm: UseFormReturn; + appointmentForm: UseFormReturn; + participantForm: UseFormReturn; } export const AppointmentModal = ({ diff --git a/apps/hub/app/(app)/admin/event/page.tsx b/apps/hub/app/(app)/admin/event/page.tsx index f1ac44a5..e3f5cccf 100644 --- a/apps/hub/app/(app)/admin/event/page.tsx +++ b/apps/hub/app/(app)/admin/event/page.tsx @@ -1,36 +1,34 @@ -import { DatabaseBackupIcon, PartyPopperIcon } from 'lucide-react'; -import { PaginatedTable } from '../../../_components/PaginatedTable'; -import Link from 'next/link'; +import { PartyPopperIcon } from "lucide-react"; +import { PaginatedTable } from "../../../_components/PaginatedTable"; +import Link from "next/link"; -export default () => { - return ( - <> - - Events - - } - rightOfSearch={ - - - - } - /> - - ); -}; +export default function Page() { + return ( + <> + + Events + + } + rightOfSearch={ + + + + } + /> + + ); +} diff --git a/apps/hub/app/(app)/layout.tsx b/apps/hub/app/(app)/layout.tsx index 7dd83450..ff348950 100644 --- a/apps/hub/app/(app)/layout.tsx +++ b/apps/hub/app/(app)/layout.tsx @@ -1,14 +1,9 @@ import type { Metadata } from "next"; -import { - DiscordLogoIcon, - InstagramLogoIcon, - ReaderIcon, -} from "@radix-ui/react-icons"; +import { DiscordLogoIcon, InstagramLogoIcon, ReaderIcon } from "@radix-ui/react-icons"; import { HorizontalNav, VerticalNav } from "../_components/Nav"; import { Toaster } from "react-hot-toast"; import { redirect } from "next/navigation"; import { getServerSession } from "../api/auth/[...nextauth]/auth"; -import { headers } from "next/headers"; export const metadata: Metadata = { title: "Create Next App", @@ -65,9 +60,7 @@ export default async function RootLayout({ {/* Center: Copyright */} -

- Copyright © {new Date().getFullYear()} - Virtual Air Rescue -

+

Copyright © {new Date().getFullYear()} - Virtual Air Rescue

{/* Right: Social Icons */}
diff --git a/apps/hub/app/(app)/logbook/_components/LogbookTable.tsx b/apps/hub/app/(app)/logbook/_components/LogbookTable.tsx deleted file mode 100644 index d64a932e..00000000 --- a/apps/hub/app/(app)/logbook/_components/LogbookTable.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { PaginatedTable } from "../../../_components/PaginatedTable"; - -export default async () => { - return ( - <> - - - ); -}; diff --git a/apps/hub/app/(app)/logbook/page.tsx b/apps/hub/app/(app)/logbook/page.tsx index cf63ed7d..0fac7a44 100644 --- a/apps/hub/app/(app)/logbook/page.tsx +++ b/apps/hub/app/(app)/logbook/page.tsx @@ -1,7 +1,6 @@ import { NotebookText } from "lucide-react"; -import LogbookTable from "./_components/LogbookTable"; -export default () => { +const page = () => { return (
@@ -10,8 +9,10 @@ export default () => {

- +

W.I.P.

); }; + +export default page; diff --git a/apps/hub/app/(app)/page.tsx b/apps/hub/app/(app)/page.tsx index 4e7f3dd9..f5c4a930 100644 --- a/apps/hub/app/(app)/page.tsx +++ b/apps/hub/app/(app)/page.tsx @@ -5,16 +5,6 @@ import Events from "./_components/Events"; import { Stats } from "./_components/Stats"; import { Badges } from "./_components/Badges"; -/* -✔️ Einlog-Zeit -✔️ Stats -✔️ Pilot / Disponent TODO: Selection persistent machen -Map - I dont know man, passt hier vielleicht nicht rein -Logbuch / Einsatzhistorie -Badges -Aktive Events / Mandatory Events -*/ - export default async function Home({ searchParams, }: { diff --git a/apps/hub/app/_components/ui/PageAlert.tsx b/apps/hub/app/_components/ui/PageAlert.tsx index 2148320d..2eae1bf1 100644 --- a/apps/hub/app/_components/ui/PageAlert.tsx +++ b/apps/hub/app/_components/ui/PageAlert.tsx @@ -1,4 +1,5 @@ import { prisma } from "@repo/db"; +import { MessageCircleWarning } from "lucide-react"; const fetchMainMessage = async () => { return await prisma.notam.findFirst({ where: { @@ -8,45 +9,33 @@ const fetchMainMessage = async () => { }); }; -const mainMessage = await fetchMainMessage(); +export const WarningAlert = async () => { + const mainMessage = await fetchMainMessage(); -let msgColor; -switch (mainMessage?.color) { - case "WARNING": - msgColor = "alert alert-warning ml-3"; - break; - case "INFO": - msgColor = "alert alert-info ml-3"; - break; - case "SUCCESS": - msgColor = "alert alert-success ml-3"; - break; - case "ERROR": - msgColor = "alert alert-error ml-3"; - break; - default: - msgColor = "alert ml-3"; -} + let msgColor; + switch (mainMessage?.color) { + case "WARNING": + msgColor = "alert alert-warning ml-3"; + break; + case "INFO": + msgColor = "alert alert-info ml-3"; + break; + case "SUCCESS": + msgColor = "alert alert-success ml-3"; + break; + case "ERROR": + msgColor = "alert alert-error ml-3"; + break; + default: + msgColor = "alert ml-3"; + } -export const WarningAlert = () => { if (mainMessage?.message == "" || !mainMessage) { return <>; } else { return (
- - - + {mainMessage?.message}
); diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 06620c99..30426404 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -5,7 +5,7 @@ services: dockerfile: ./apps/dispatch/Dockerfile container_name: dispatch ports: - - "3001:3001" + - "3001:3000" env_file: - .env.prod networks: