Skip to content
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

Merged
merged 8 commits into from
Aug 6, 2024
Merged

Navbar + CMS Fetching #13

merged 8 commits into from
Aug 6, 2024

Conversation

YB-BigSwan
Copy link
Collaborator

  • 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
    Screenshot 2024-08-05 at 17 31 44

Stephen Swanson added 7 commits July 27, 2024 09:12
- 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
Copy link

github-actions bot commented Aug 5, 2024

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

const router = useRouter();
const currentRoute = router.pathname;
const navGeneral = cmsData.data.slice(0, 4);
const navFormembers = cmsData.data.slice(4);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo navForMembers

Copy link
Collaborator Author

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;
Copy link
Member

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

@YB-BigSwan YB-BigSwan merged commit f41afac into main Aug 6, 2024
2 checks passed
@YB-BigSwan YB-BigSwan deleted the next-site branch August 6, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants