Skip to content

Commit

Permalink
Try again to enable dynamic page titles alongside SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiramTadepalli committed Nov 20, 2024
1 parent 9557009 commit 0bdbf6c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,11 @@ export async function getServerSideProps(
pageTitle += term + ', ';
});
pageTitle = pageTitle.slice(0, -2) + (pageTitle.length > 0 ? ' - ' : '');
document.title = pageTitle;
return { props: { pageTitle: pageTitle } };
}

export const Dashboard: NextPage<{ pageTitle: string }> = ({
pageTitle,
}: {
pageTitle: string;
}): React.ReactNode => {
export const Dashboard: NextPage = () => {
const router = useRouter();

//Searches seperated into courses and professors to create combos
Expand Down Expand Up @@ -817,7 +814,7 @@ export const Dashboard: NextPage<{ pageTitle: string }> = ({
);
}

pageTitle = '';
let pageTitle = '';
courses.map((term) => {
pageTitle += searchQueryLabel(term) + ', ';
});
Expand Down

0 comments on commit 0bdbf6c

Please sign in to comment.