Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/app/chart/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Bar Chart",
};

export default function ChartLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
4 changes: 4 additions & 0 deletions src/app/chart/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export default function ChartPage() {
[setChartType],
);

useEffect(() => {
document.title = `${chartType === "bar" ? "Bar Chart" : "Line Chart"} | MHD`;
}, [chartType]);

// Keyboard shortcuts for chart type
useHotkey("b", () => handleChartTypeChange("bar"));
useHotkey("l", () => handleChartTypeChange("line"));
Expand Down
8 changes: 6 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ import { Suspense } from "react";
import InvalidURLHandler from "@/components/InvalidURLHandler";

export const metadata: Metadata = {
title: "MHD",
description: "MHD",
title: {
template: "%s | MHD",
default: "MHD",
},
description:
"Data visualization dashboard for Massachusetts History Society's annual contest, Massachusetts History Day.",
icons: { icon: "/favicon.png" },
};

Expand Down
9 changes: 9 additions & 0 deletions src/app/map/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Heatmap",
};

export default function MapLayout({ children }: { children: React.ReactNode }) {
return children;
}
9 changes: 1 addition & 8 deletions src/app/map/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function HeatMapPage() {
);
const regionView = rawRegionView.toLowerCase();

const [showSchools, setShowSchools] = useQueryState(
const [showSchools] = useQueryState(
"showSchools",
parseAsBoolean.withDefault(true),
);
Expand Down Expand Up @@ -440,13 +440,6 @@ function HeatMapPage() {
</div>
</div>
</div>

<Button
onClick={() => setShowSchools(!showSchools)}
className="w-32 py-2"
>
{showSchools ? "Hide Schools" : "Show Schools"}
</Button>
</div>
<div className="flex-1 rounded-2xl overflow-hidden border border-slate-200 relative">
{schoolDataError ? (
Expand Down
5 changes: 5 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import type { Metadata } from "next";
import { Suspense } from "react";
import Dashboard from "@/components/Dashboard";
import { DashboardSkeleton } from "@/components/skeletons/DashboardSkeleton";

export const metadata: Metadata = {
title: "Dashboard | MHD",
};

export default function Home() {
return (
<Suspense fallback={<DashboardSkeleton />}>
Expand Down
19 changes: 19 additions & 0 deletions src/app/schools/[name]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export async function generateMetadata({
params,
}: {
params: Promise<{ name: string }>;
}) {
const { name } = await params;
const decoded = decodeURIComponent(name)
.replace(/-/g, " ")
.replace(/\b\w/g, (c) => c.toUpperCase());
return { title: decoded };
}

export default function SchoolProfileLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
18 changes: 10 additions & 8 deletions src/app/schools/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,17 @@ export default function SchoolProfilePage() {
</Link>

{/* Project type distribution — same 3-col grid as stats; spans 2 cells */}
<div className="grid grid-cols-3 gap-8">
<div className="col-span-2 min-w-0">
<PieChart
slices={projectCategoryDistribution(projects)}
legendTitle="Project Type Distribution"
emptyMessage="No project data"
/>
{projects.length !== 0 && (
<div className="grid grid-cols-3 gap-8">
<div className="col-span-2 min-w-0">
<PieChart
slices={projectCategoryDistribution(projects)}
legendTitle="Project Type Distribution"
emptyMessage="No project data"
/>
</div>
</div>
</div>
)}

{/* School location map */}
<div className="rounded-lg space-y-4">
Expand Down
16 changes: 16 additions & 0 deletions src/app/schools/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: {
template: "%s | MHD",
default: "Schools",
},
};

export default function SchoolsLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
13 changes: 13 additions & 0 deletions src/app/settings/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Settings",
};

export default function SettingsLayout({
children,
}: {
children: React.ReactNode;
}) {
return children;
}
5 changes: 5 additions & 0 deletions src/app/signin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { Metadata } from "next";
import AuthForm from "@/components/AuthForm";
import WarpShader from "@/components/WarpShader";

export const metadata: Metadata = {
title: "Sign In",
};

export default async function SignInPage({
searchParams,
}: {
Expand Down
5 changes: 5 additions & 0 deletions src/app/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
*
**************************************************************/

import type { Metadata } from "next";
import SpreadsheetState from "@/components/SpreadsheetState";

export const metadata: Metadata = {
title: "Upload",
};

export default function UploadPage() {
return <SpreadsheetState />;
}