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

feat: ENG-283 Nav update #638

Open
wants to merge 123 commits into
base: master
Choose a base branch
from
Open

feat: ENG-283 Nav update #638

wants to merge 123 commits into from

Conversation

AndyEPhipps
Copy link
Contributor

@AndyEPhipps AndyEPhipps commented Apr 10, 2024

PR description

What is it doing?

Adds the brand new Nav2024 (name may be changed shortly) organism and associated components to provide extended functionality to the preexisting one, namely the ability to render nav menu content over a certain character threshold.

Small design tweaks to follow from Curtis, but good to get some other eyes on this, although we won't be going live with this before the new year.

Why is this required?

Less limits on what we can display in the header nav

link to Jira ticket:

https://comicrelief.atlassian.net/browse/ENG-2834

Quick Checklist:

  • My PR title follows the Conventional Commit spec.

  • I have filled out the PR description as per the template above.

  • I have added tests to cover new or changed behaviour.

  • I have updated any relevant documentation.

Important! - lastly, make sure to squash merge...

@AndyEPhipps AndyEPhipps changed the title Eng 2834 nav update ENG-2834: Nav update Apr 11, 2024
@AndyEPhipps AndyEPhipps changed the title ENG-2834: Nav update feat: ENG-283 Nav update Apr 11, 2024
@@ -53,3 +53,15 @@ To publish
```
$ yarn publish:npm
```

### Testing
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just adding some missing docs while I'm here

transition: opacity 0.2s;
position: relative;

${({ isHeader }) => isHeader && css`
Copy link
Contributor Author

@AndyEPhipps AndyEPhipps Dec 2, 2024

Choose a reason for hiding this comment

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

Only setting and passing this in the new Header2024, so the pre-existing Header Classic is barely affected

// First level of the navigation (ul tag): Parent
<NavMenu role="menubar">
{/*
****************************
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heavy-handed comments for the sake of sanity; both while developing and reading

@AndyEPhipps AndyEPhipps marked this pull request as ready for review December 3, 2024 09:17
Copy link
Contributor

@michael-odonovan michael-odonovan left a comment

Choose a reason for hiding this comment

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

Possibly break the HeaderNav up into sections? Getting quite long, though can cause props hell so may not be worth it...

Comment on lines 29 to 39
Header2024.propTypes = {
// Check data structure example in src/components/moleculecules/header/data/data
navItems: PropTypes.objectOf(PropTypes.shape),
// NB: metaIcons no longer include the Donate button:
metaIcons: PropTypes.node.isRequired,
// ... and is supplied separately to allow more render control:
donateButton: PropTypes.node,
campaign: PropTypes.string
};

export default Header2024;
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly define the shape?

navItems: PropTypes.shape({
    menuGroups: PropTypes.arrayOf(
      PropTypes.shape({
        id: PropTypes.string.isRequired,
        links: PropTypes.arrayOf(
          PropTypes.shape({
            title: PropTypes.string.isRequired,
            url: PropTypes.string,
          })
        ),
      })
    ),
  }),

Might be handy if we ever want to swap to Typescript, as would be one less yelling error?

Copy link
Contributor Author

@AndyEPhipps AndyEPhipps Dec 3, 2024

Choose a reason for hiding this comment

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

Good shout for sure; I'm not 100% sure if this CMS-defined shape is consistent to this exact pattern (as I think menuGroups accept a few different content types) but this is a big improvement, thanks man; can panelbeat issues as they crop up in-situ.

@AndyEPhipps
Copy link
Contributor Author

Possibly break the HeaderNav up into sections? Getting quite long, though can cause props hell so may not be worth it...

Fair comment though, will give it a go!

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