Skip to content

Commit

Permalink
feat: add page headers to site
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonMeade committed Jun 21, 2024
1 parent 485337c commit 29b88ee
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/classic/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import AuthenticationGuard from "../components/Authentication/AuthenticationGuar
import LeaveClassic from "../components/Classic/LeaveClassic";
import LogoutClassic from "../components/Classic/LogoutClassic";
import ViewGuard from "../components/General/ViewGuard";
import PageHeader from "@/utils/head";

export default function ClassicLayout(props: React.PropsWithChildren) {
return (
<div>
<ViewGuard />
<AuthenticationGuard redirectTo="/login" savePath />
<PageHeader title = "Classic Site" />
<nav style={{ display: "flex", justifyContent: "space-around" }}>
<Link href="/classic/catalog">Access the Card Catalog</Link>
<Link href="/classic/flowsheet">Visit the Flowsheet</Link>
Expand Down
2 changes: 2 additions & 0 deletions app/dashboard/catalog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Box, Typography } from "@mui/joy";
import CatalogSearchTable from "@/app/components/Catalog/CatalogSearchTable";
import PageHeader from "@/utils/head";

/**
* CatalogPage component represents a page that displays a catalog search table.
Expand All @@ -13,6 +14,7 @@ const CatalogPage = (): JSX.Element => {

return (
<>
<PageHeader title = "Card Catalog" />
<Box
sx={{
display: 'flex',
Expand Down
5 changes: 4 additions & 1 deletion app/login/classic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { login, needsNewPassword, useDispatch, useSelector } from "@/lib/redux";
import AuthenticationGuard from "../components/Authentication/AuthenticationGuard";
import LeaveClassic from "../components/Classic/LeaveClassic";
import { prefix } from "@/utils/prefix";
import PageHeader from "@/utils/head";

export default function ClassicLogin() {
const dispatch = useDispatch();
Expand Down Expand Up @@ -34,6 +35,7 @@ export default function ClassicLogin() {
}}
>
<AuthenticationGuard redirectTo="/login" savePath />
<PageHeader title="Login" />
<LeaveClassic />
<form name="userpw" onSubmit={handlePasswordUpdate}>
<div>
Expand Down Expand Up @@ -112,7 +114,8 @@ export default function ClassicLogin() {
flexDirection: "column",
}}
>
<AuthenticationGuard redirectTo="/login" savePath />
<AuthenticationGuard redirectTo="/login" savePath />\
<PageHeader title="Login" />
<div style={{ marginBottom: 20 }}>
<LeaveClassic />
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { ColorSchemeToggle } from "../components/General/Theme/ColorSchemeToggle
import { ViewStyleToggle } from "../components/General/Theme/ViewStyleToggle";
import ClassicLogin from "./classic";
import { prefix } from "@/utils/prefix";
import PageHeader from "@/utils/head";

/**
* @page
Expand Down Expand Up @@ -154,6 +155,7 @@ export default function LoginPage(): JSX.Element {
return (
<Box sx={{ height: "100%" }}>
<AuthenticationGuard redirectTo="/login" savePath />
<PageHeader title="Login" />
<Box
sx={(theme) => ({
width:
Expand Down
19 changes: 19 additions & 0 deletions utils/head.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client";

import Head from "next/head";

const SITE_TITLE = "WXYC Chapel Hill";

interface DJSitePageProps {
title: string;
}

const PageHeader = (props: DJSitePageProps): JSX.Element => {
return (
<Head>
<title>{props.title}</title>
</Head>
);
};

export default PageHeader;

0 comments on commit 29b88ee

Please sign in to comment.