From 18e7bf2c6f6c11a3b4f550a5fcbea9b19ad9c29d Mon Sep 17 00:00:00 2001 From: marcellmueller Date: Tue, 4 Feb 2025 10:49:46 -0800 Subject: [PATCH] refactor: rename page section vars --- frontend/src/components/layout/PageMenu.tsx | 20 ++++++++-------- .../rec-resource/RecResourcePage.tsx | 24 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/layout/PageMenu.tsx b/frontend/src/components/layout/PageMenu.tsx index a5318e68..86ec991a 100644 --- a/frontend/src/components/layout/PageMenu.tsx +++ b/frontend/src/components/layout/PageMenu.tsx @@ -2,8 +2,8 @@ import '@/components/layout/PageMenu.scss'; type PageSection = { sectionIndex: number; - link: string; - display: string; + href: string; + title: string; }; type PageMenuProps = { @@ -25,17 +25,17 @@ const PageMenu: React.FC = ({ className="navbar" > {pageSections.map((section) => { - const { display, link, sectionIndex } = section; + const { href, sectionIndex, title } = section; return ( - {display} + {title} ); })} @@ -50,7 +50,7 @@ const PageMenu: React.FC = ({ (section) => section.sectionIndex === Number(index), ); if (selectedSection) { - window.location.hash = selectedSection.link; + window.location.hash = selectedSection.href; } }; @@ -66,10 +66,10 @@ const PageMenu: React.FC = ({ Table of Contents {pageSections.map((section) => { - const { display, sectionIndex } = section; + const { title, sectionIndex } = section; return ( - ); })} diff --git a/frontend/src/components/rec-resource/RecResourcePage.tsx b/frontend/src/components/rec-resource/RecResourcePage.tsx index 108718e0..757cc358 100644 --- a/frontend/src/components/rec-resource/RecResourcePage.tsx +++ b/frontend/src/components/rec-resource/RecResourcePage.tsx @@ -113,28 +113,28 @@ const RecResourcePage = () => { () => [ isClosures && { - link: '#closures', - display: 'Closures', + href: '#closures', + title: 'Closures', }, description && { - link: '#site-description', - display: 'Site Description', + href: '#site-description', + title: 'Site Description', }, { - link: '#maps-and-location', - display: 'Maps and Location', + href: '#maps-and-location', + title: 'Maps and Location', }, { - link: '#camping', - display: 'Camping', + href: '#camping', + title: 'Camping', }, isThingsToDo && { - link: '#things-to-do', - display: 'Things to Do', + href: '#things-to-do', + title: 'Things to Do', }, { - link: '#contact', - display: 'Contact', + href: '#contact', + title: 'Contact', }, ] .filter((section) => !!section)