From ce3e4a30c91c18cb4ba10c923736a732cb5d32f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=A4ckelmann?= <6890706+n1kPLV@users.noreply.github.com> Date: Tue, 19 Sep 2023 23:40:21 +0200 Subject: [PATCH] Added a modal track selection dialog for most use cases --- Website/src/app/@modal/(.)select_track/page.tsx | 13 +++++++++++++ Website/src/app/@modal/default.tsx | 6 ++++++ Website/src/app/layout.tsx | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Website/src/app/@modal/(.)select_track/page.tsx create mode 100644 Website/src/app/@modal/default.tsx diff --git a/Website/src/app/@modal/(.)select_track/page.tsx b/Website/src/app/@modal/(.)select_track/page.tsx new file mode 100644 index 00000000..a804254f --- /dev/null +++ b/Website/src/app/@modal/(.)select_track/page.tsx @@ -0,0 +1,13 @@ +"use client"; + +import { SelectionDialog } from "@/app/components/track_selection"; + +/** + * The stand-alone track selection page + */ +export default function SelectTrackModal() { + // obtain a "completed" state + // const [completed, setCompleted] = useState(false); + + return ; +} diff --git a/Website/src/app/@modal/default.tsx b/Website/src/app/@modal/default.tsx new file mode 100644 index 00000000..1c7818bf --- /dev/null +++ b/Website/src/app/@modal/default.tsx @@ -0,0 +1,6 @@ +/** + * By default, there is no modal present + */ +export default function Default() { + return null; +} diff --git a/Website/src/app/layout.tsx b/Website/src/app/layout.tsx index 4812dc29..384e4f63 100644 --- a/Website/src/app/layout.tsx +++ b/Website/src/app/layout.tsx @@ -11,7 +11,7 @@ export const metadata = meta_info; * The Layout to use on all pages in the app-directory. * Effectively defers to BaseLayout with minimal adjustments. */ -export default function RootLayout({ children }: { children: React.ReactNode }) { +export default function RootLayout({ children, modal }: { children: React.ReactNode; modal: React.ReactNode }) { const token = cookies().get("token")?.value; const username = token ? inlineTry(() => getUsername(token)) : undefined; @@ -20,6 +20,10 @@ export default function RootLayout({ children }: { children: React.ReactNode }) {children} + { + /* Add any modals beneath the page layout. They will need to layer themselves over the content. */ + modal + }