-
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
update to match exposed uswds pageheader #20
Conversation
✅ Deploy Preview for veda-ui-next-test ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
NOTE: Still need to build library package and update version to see preview.... |
app/components/nav.tsx
Outdated
</div> | ||
</nav> | ||
</div> | ||
<nav id='nav'> |
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 am wondering if this nav element isn't conflicting with the one created by the header component? What is it's purpose here?
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.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav - it came with the template nextJs setup, could probably just remove it
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 think we should remove the unnecessary elements, <nav>
and <aside>
, as we have those implemented with the <PageHeader>
component itself.
**Related Ticket:** Close #1137 Related PR: NextJs PR developmentseed/next-veda-ui#20 ### Description of Changes This change implements the page header with the USWDS ui components ### Notes & Questions About Changes The new header will have some design inconsistencies with the rest of the page, but that is intentional as we go through the revamp of the ui. ### Validation / Testing - [ ] Validate the header contents - [ ] Use the navigation to access different pages - [ ] Use keyboard navigation, making sure the navigation is accessible - [ ] Instances can use the header and customize its content - [x] logo - [x] heading - [x] primary nav items - [x] secondary nav items
…build (#1275) **Related Ticket:** #1191 **Related Next.js PR:** developmentseed/next-veda-ui#20 ### Description of Changes - Bundle USWDS styles and custom styles with our components - Fix USWDS asset paths to work in Next.js via PostCSS URL handling - Rename SCSS files to match component names to prevent namespace conflicts (otherwise they throw `namespace exists` errors when they are imported into one entry SCSS file) - Consolidate styles into a single entry point (`styles.scss`) - Update `yarn.lock` / resolve merge conflicts ### Main problem this PR addresses When our USWDS-styled components were used in Next.js, they appeared unstyled because USWDS assets weren't properly bundled. This PR: 1. Bundles all needed USWDS assets with our components 2. Resolves USWDS asset paths correctly in Next.js 3. Makes styles work automatically in Next.js without the need for manual style imports The third point is interesting because Next.js detects and loads any CSS dependencies that Parcel bundled with our components, which I hope makes the developer experience much smoother. This means we could do this: ``` // Just import the component, styles come automatically once the VEDA UI lib is used import { Header } from '@veda-ui/lib' ``` And the component will be styled with the VEDA UI styles, instead of having to: ``` // Had to manually import styles in Next.js app import '@veda-ui/lib/styles.css' import { Header } from '@veda-ui/lib' ``` ### Notes & Questions About Changes Few things to note (cc @hanbyul-here @sandrahoang686 @AliceR) 1. This approach only includes USWDS styles that we're actively using in our components. These styles are managed through our main `styles.scss` file. This means we're keeping things lightweight by not including styles for USWDS components we don't use (like the stepper component). If a Next.js project needs additional USWDS components later, we can easily add them to `styles.scss` or they could install the USWDS library and get access to it. This keeps our bundle size small and efficient (we only ship what we actually need for VEDA) 2. Style organization: - Main entry point: `app/scripts/styles/styles.scss` - Component styles should be imported in this entry file, not in the components. However, they can be kept in the respective component directory for easier look up - Next.js apps don't need to install USWDS as a dependency, everything comes with our components ### Validation / Testing VEDA UI 1. Check preview deployment 2. Check that USWDS styles work (page header) 3. Check that custom styles work (page header) 4. Confirm icons display correctly (nav chevrons) Next.js 1. Test locally using [symlink](https://github.com/NASA-IMPACT/veda-ui/blob/main/docs/development/REGISTRY.md) with veda-ui branch (`1137-implement-new-ds-page-header`, now merged to `main`) 2. Check that both USWDS and custom styles work (page header) 3. Check that no manual style imports are needed
Note, we need to still add the About page and the contact us modal. I added this as a todo item here: NASA-IMPACT/veda-ui#1282 |
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.
Just one comment about the DOM tree (see below); the preview looks good 👍
app/components/nav.tsx
Outdated
</div> | ||
</nav> | ||
</div> | ||
<nav id='nav'> |
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 think we should remove the unnecessary elements, <nav>
and <aside>
, as we have those implemented with the <PageHeader>
component itself.
Available PR templates