Skip to content

Commit

Permalink
Added a modal track selection dialog for most use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
n1kPLV committed Sep 19, 2023
1 parent 128ee97 commit ce3e4a3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Website/src/app/@modal/(.)select_track/page.tsx
Original file line number Diff line number Diff line change
@@ -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 <SelectionDialog modal={true} />;
}
6 changes: 6 additions & 0 deletions Website/src/app/@modal/default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* By default, there is no modal present
*/
export default function Default() {
return null;
}
6 changes: 5 additions & 1 deletion Website/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -20,6 +20,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
<body className={inter.className}>
<UsernameProvider username={username}>
<BaseLayout>{children}</BaseLayout>
{
/* Add any modals beneath the page layout. They will need to layer themselves over the content. */
modal
}
</UsernameProvider>
</body>
</html>
Expand Down

0 comments on commit ce3e4a3

Please sign in to comment.