Skip to content

Commit

Permalink
feat(#426): Add blank admin pages and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-nowicki committed Jul 17, 2024
1 parent 25ffe5f commit 8d0ad1e
Show file tree
Hide file tree
Showing 45 changed files with 181 additions and 42 deletions.
2 changes: 1 addition & 1 deletion api/apiFunctions.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { IEntry } from '@/app/league/[leagueId]/entry/Entries.interface';
import { IEntry } from '@/app/(main)/league/[leagueId]/entry/Entries.interface';

export interface IAccountData {
email: string;
Expand Down
2 changes: 1 addition & 1 deletion api/apiFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Query } from 'appwrite';
import {
IEntry,
IEntryProps,
} from '@/app/league/[leagueId]/entry/Entries.interface';
} from '@/app/(main)/league/[leagueId]/entry/Entries.interface';

/**
* Register a new account
Expand Down
14 changes: 14 additions & 0 deletions app/(admin)/admin/leagues/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { JSX } from 'react';

/**
* Renders the admin page.
* @returns {JSX.Element} - The rendered login page.
*/
const AdminLeagues = (): JSX.Element => {
return <div>Admin Leagues</div>;
};

export default AdminLeagues;
14 changes: 14 additions & 0 deletions app/(admin)/admin/notifications/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { JSX } from 'react';

/**
* Renders the admin page.
* @returns {JSX.Element} - The rendered login page.
*/
const AdminNotifications = (): JSX.Element => {
return <div>Admin Notifications</div>;
};

export default AdminNotifications;
14 changes: 14 additions & 0 deletions app/(admin)/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { JSX } from 'react';

/**
* Renders the admin page.
* @returns {JSX.Element} - The rendered login page.
*/
const AdminHome = (): JSX.Element => {
return <div>Admin Home</div>;
};

export default AdminHome;
14 changes: 14 additions & 0 deletions app/(admin)/admin/players/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { JSX } from 'react';

/**
* Renders the admin page.
* @returns {JSX.Element} - The rendered login page.
*/
const AdminPlayers = (): JSX.Element => {
return <div>Admin Players</div>;
};

export default AdminPlayers;
46 changes: 46 additions & 0 deletions app/(admin)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import React, { JSX } from 'react';
import { GeistSans } from 'geist/font/sans';
import '../globals.css';
import { AuthContextProvider } from '@/context/AuthContextProvider';
// import ErrorBoundary from '../error';
import { Toaster } from 'react-hot-toast';

const defaultUrl = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: 'http://localhost:3000';

export const metadata = {
metadataBase: new URL(defaultUrl),
title: 'GridIron Survivor',
description: 'Fantasy Football Survivor Pool',
};

/**
* The root layout for the application.
* @param props - The props
* @param props.children - The children
* @returns The rendered root layout.
*/
const RootLayout = ({
children,
}: {
children: React.ReactNode;
}): JSX.Element => {
return (
<html lang="en" className={GeistSans.className}>
<body className="dark:dark bg-background pb-8 px-4 text-foreground xl:pb-0">
{/* <ErrorBoundary> */}
<AuthContextProvider>
<main>{children}</main>
<Toaster />
</AuthContextProvider>
{/* </ErrorBoundary> */}
</body>
</html>
);
};

export default RootLayout;
4 changes: 2 additions & 2 deletions app/layout.tsx → app/(main)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import React, { JSX } from 'react';
import { GeistSans } from 'geist/font/sans';
import './globals.css';
import '../globals.css';
import Nav from '@/components/Nav/Nav';
import { AuthContextProvider } from '@/context/AuthContextProvider';
import ErrorBoundary from './error';
import ErrorBoundary from '../error';
import { Toaster } from 'react-hot-toast';

const defaultUrl = process.env.VERCEL_URL
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/login/page.tsx → app/(main)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
FormField,
FormItem,
FormMessage,
} from '../../components/Form/Form';
} from '../../../components/Form/Form';

const LoginUserSchema = z.object({
email: z
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/register/page.tsx → app/(main)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
FormField,
FormItem,
FormMessage,
} from '../../components/Form/Form';
} from '../../../components/Form/Form';
import { toast } from 'react-hot-toast';
import Alert from '@/components/AlertNotification/AlertNotification';
import { AlertVariants } from '@/components/AlertNotification/Alerts.enum';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion components/Nav/Nav.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import Nav from './Nav';
import Login from '@/app/login/page';
import Login from '@/app/(main)/login/page';

const mockPush = jest.fn();
const mockUsePathname = jest.fn();
Expand Down
101 changes: 69 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d0ad1e

Please sign in to comment.