Skip to content

Commit

Permalink
Wrapped all admin portal pages with PrivatePage component (except login)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennymar committed May 16, 2024
1 parent 5043662 commit 8884655
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
59 changes: 28 additions & 31 deletions frontend/src/app/admin/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,36 @@
import styles from "./page.module.css";

import DashboardCard from "@/components/DashboardCard";
import PrivatePage from "@/components/admin/PrivatePage";

export default function Dashboard() {
return (
<PrivatePage>
<main className={styles.page}>
<div className={styles.gridContainer}>
<DashboardCard
imageURI="/dashboard_eventcreator.png"
url="/event-creator"
title="Event Creator"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_pageeditor.png"
url="/page-editor"
title="Page Editor"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_newsletter.png"
url="/newsletter-creator"
title="Newsletter"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_mailinglist.png"
url="/mailing-list"
title="Mailing List"
last_updated="Month XX, XXXX, XX:XX"
/>
</div>
</main>
</PrivatePage>
<main className={styles.page}>
<div className={styles.gridContainer}>
<DashboardCard
imageURI="/dashboard_eventcreator.png"
url="/event-creator"
title="Event Creator"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_pageeditor.png"
url="/page-editor"
title="Page Editor"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_newsletter.png"
url="/newsletter-creator"
title="Newsletter"
last_updated="Month XX, XXXX, XX:XX"
/>
<DashboardCard
imageURI="/dashboard_mailinglist.png"
url="/mailing-list"
title="Mailing List"
last_updated="Month XX, XXXX, XX:XX"
/>
</div>
</main>
);
}
3 changes: 2 additions & 1 deletion frontend/src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HeaderBarSpace from "@/components/HeaderBarSpace";
import NavigationBar from "@/components/NavigationBar";

Check warning on line 8 in frontend/src/app/admin/layout.tsx

View workflow job for this annotation

GitHub Actions / Frontend check

There should be no empty line within import group

import "../globals.css";
import PrivatePage from "@/components/admin/PrivatePage";

export default function AdminLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
Expand All @@ -18,7 +19,7 @@ export default function AdminLayout({ children }: { children: React.ReactNode })
<section>
{!isLoginPage && <NavigationBar />}
{!isLoginPage && <HeaderBarSpace />}
{children}
{!isLoginPage ? <PrivatePage>{children}</PrivatePage> : children}
</section>
</ReactFireProvider>
);
Expand Down

0 comments on commit 8884655

Please sign in to comment.