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

Expose As Is - PageHeader, LinkElement Prop & Logo #1184

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

sandrahoang686
Copy link
Collaborator

@sandrahoang686 sandrahoang686 commented Oct 7, 2024

Related Ticket: #1136

Description of Changes

  • Exposes the Page Header, LinkElement as prop, & LOGO without any additional styling

Notes & Questions About Changes

Validation / Testing

  • This should NOT break any current behavior with the page header and navigation

Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 947ad47
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67200a6330afd6000842ebf4
😎 Deploy Preview https://deploy-preview-1184--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sandrahoang686 sandrahoang686 changed the title get page header working with linkProperties Expose PageHeader, Nav, & Logo for NextJs Oct 7, 2024
@sandrahoang686 sandrahoang686 marked this pull request as ready for review October 21, 2024 11:16
@sandrahoang686 sandrahoang686 changed the title Expose PageHeader, Nav, & Logo for NextJs Expose PageHeader, LinkElement Prop & Logo As Is Oct 21, 2024
@sandrahoang686 sandrahoang686 changed the title Expose PageHeader, LinkElement Prop & Logo As Is Expose As Is - PageHeader, LinkElement Prop & Logo Oct 21, 2024
Copy link
Collaborator

@hanbyul-here hanbyul-here left a comment

Choose a reason for hiding this comment

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

Thanks for working on it! I think navlink can be more worked on so they don't have to be a tags !
https://github.com/NASA-IMPACT/veda-ui/pull/1184/files#diff-6cccba12d155a579cba98d2e85e43fd88de10b0b6e83f44a261cceb1429e2695R77

app/scripts/components/common/page-header/logo.tsx Outdated Show resolved Hide resolved
export default function Logo () {
export default function Logo ({ linkProperties }: { linkProperties: LinkProperties }) {
const LinkElement: ComponentType<any> = linkProperties.LinkElement as ComponentType<any>;

return (
<ComponentOverride with='headerBrand'>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am having trouble understanding how exporting Logo can work, when ComponentOverride component imports elements from the virtual moduleveda directly (https://github.com/NASA-IMPACT/veda-ui/blob/main/app/scripts/components/common/page-overrides.tsx#L3) Can you help me understand how this works?

Copy link
Collaborator

Choose a reason for hiding this comment

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

All of the instsances except OG dashboard overrides this component with each instance's branding : ex. https://github.com/US-GHG-Center/veda-config-ghg/blob/16fe5b7c08e67f78e1a2a27727a82ff28034f4bc/overrides/components/header-brand/component.tsx#L4 🤔 which makes me wonder if this component is worth exporting at all. how do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably not worth exporting, and we could anyway pass any ReactElement as a logo prop from Next.js: https://github.com/NASA-IMPACT/veda-ui/pull/1184/files#diff-86e372214b3b1dff36fcabf602d3ea911690d226a6e0bed48fee30b571864756R233

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

very good point, thanks for making it 👍🏼 It might make sense in this case to separate the actual logo/svg from the styled container and have the logo/svg passed as a prop. I'll have to remove the veda virtual module dependency though so might have to recreate the same without the override 🤔, let me give it more thought!

Copy link
Collaborator Author

@sandrahoang686 sandrahoang686 Oct 28, 2024

Choose a reason for hiding this comment

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

Created a separate LogoContainer component that takes in the SVG logo as a prop along with other attributres like title. When working on the new page header design implementation, we might not have to expose this container though as its meant to just fit in the page header itself, might just have instance pass in only the SVG itself but this will work best for now for our current state of code.

Copy link
Collaborator

@hanbyul-here hanbyul-here left a comment

Choose a reason for hiding this comment

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

I left my concern about logo-container component that it might not be catered towards users' needs for logo. Then users don't need to use it - so it probably is not a blocker. Thanks for working on it!

<span>{title}</span> <span>{subTitle}</span>
</LinkElement>
<Tip content={`v${version}`}>
<PageTitleSecLink {...{as: linkProperties.LinkElement as ComponentType<any>, [linkProperties.pathAttributeKeyName]: '/development'}}>Beta</PageTitleSecLink>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if this component can be used by other instances when only logo svg is tweak-able - (ex. ghg overwrote the whole logo)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The plan is to use the logo container in the larger page-header component. So i mentioned in my above comment we probably dont have to expose this actually because it would just be integrated in page-header component directly but this would come in the next iteration of implementing the new page-header design. So its more like a set up for next phase 👍🏼

@sandrahoang686 sandrahoang686 merged commit 0cc5f82 into main Oct 29, 2024
9 checks passed
@sandrahoang686 sandrahoang686 deleted the refactor/expose-page-header branch October 29, 2024 14:46
@hanbyul-here hanbyul-here mentioned this pull request Oct 29, 2024
snmln added a commit that referenced this pull request Oct 30, 2024
You can find VEDA Dashboard preview link to test these changes:
NASA-IMPACT/veda-config#470

## 🎉 Features
- Cookie consent component:
#1163,
#1165,
#1127,
#1177
- Stories Hub export in #1162
- Expose As Is - PageHeader, LinkElement Prop & Logo in
#1184
## 🚀 Improvements

- Add docs for registry dev in
#1169
- Timeline date selection centering functionality in
#1181
- Deprecate old explore page, Mapbox component
#1176
- Update doc with new diagrams about general architecture in
#1195
-  Add playwright in #1139
- Pre-select AOIs that have the "selected" prop set to true in
#1215
- 
## 🐛 Fixes
- Check dastaset analysis exclude attribute before running analysis in
#1175
- Restrict dynamic colormaps to applicable layer types in
#1183
- Fix external link badge display for tools hosted under the same domain
in #1192
- Escape special characters in regex expression when searching datasets
in #1204


### New Contributors
* @snmln made their first contribution in
#1127
* @AliceR made their first contribution in
#1204
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.

3 participants