-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navbar + CMS Fetching #13
Conversation
YB-BigSwan
commented
Aug 5, 2024
- Nav now properly fetches data from the CMS
- Nav links set according to text_en lowercase with spaces replaces with - (e.g. text_en = Nation Info : href="nation-info")
- Nav link classnames set dynamically because Next and TS don't allow the usage of activeClassName
- Initial nation info age setup
- Nav is not totally done, but making a PR so we can merge and stay up-to-date
- this is just an initial commit - ran into a few possible issues while trying to fetch from CMS, just want to do a sanity check before going further
…s upset about comes directly from the docs and should be fine. Additionally addresses one linter warning for Navbar.tsx
- nav styling including active classes for active nav link styling - start of nation-info page - stopping for today due to CMS CORS issues
- Nav now properly fetches navlink text from cms - Nav link routes are set based on text_en lowercase, with whitespace replaced by - - Nav link classname dynamically set because Next and TS do not like activeClassName - Types added for CMS data
Visit the preview URL for this PR (updated for commit 5410051): https://satakuntalainenosakunta--pr13-next-site-tr3acsym.web.app (expires Mon, 12 Aug 2024 15:57:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1ec35f964edce5d08911a93688b4dc7a051b997f |
components/Navbar.tsx
Outdated
const router = useRouter(); | ||
const currentRoute = router.pathname; | ||
const navGeneral = cmsData.data.slice(0, 4); | ||
const navFormembers = cmsData.data.slice(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo navForMembers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, both issues fixed. 👍
hooks/types.ts
Outdated
@@ -0,0 +1,14 @@ | |||
type CMSItem = { | |||
id: number; | |||
user_created: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue that we should hide the item's metadata just in case. At least for the user IDs user_created
and user_updated