Skip to content

Commit

Permalink
Add dodgy hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Willemsen committed Oct 4, 2024
1 parent 54e6f55 commit 8b4993d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 3 additions & 0 deletions app/components/InstrumentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function InstrumentData({ instrumentName }: { instrumentName: string }) {
process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:8080/pvws/pv";

const instName = instrumentName;
if (document != undefined) {
document.title = instName.toUpperCase() + " | IBEX Web Dashboard";
}

const {
sendJsonMessage,
Expand Down
11 changes: 11 additions & 0 deletions app/instrument/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ReactNode } from "react";
import type { Metadata, ResolvingMetadata } from "next";

export const metadata = {
// Default title, overridden later.
title: "Instrument Details | IBEX Web Dashboard",
};

export default function ClientLayout({ children }: { children: ReactNode }) {
return children;
}
16 changes: 0 additions & 16 deletions app/instrument/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@ const inter = Inter({ subsets: ["latin"] });
import { Suspense } from "react";
import type { Metadata, ResolvingMetadata } from "next";

type Props = {
params: { id: string };
searchParams: { [key: string]: string | string[] | undefined };
};

export async function generateMetadata(
{ params, searchParams }: Props,
parent: ResolvingMetadata,
): Promise<Metadata> {
const instrument = searchParams!["name"];

return {
title: instrument + " | IBEX Web Dashboard",
};
}

export default function Instrument() {
return (
<main
Expand Down

0 comments on commit 8b4993d

Please sign in to comment.