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: Add new nav icon for the detours page #2771

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

joshlarson
Copy link
Contributor

@joshlarson joshlarson requested a review from a team as a code owner September 4, 2024 17:27
@joshlarson joshlarson marked this pull request as draft September 4, 2024 17:27
@joshlarson joshlarson marked this pull request as ready for review September 4, 2024 17:42
Copy link

github-actions bot commented Sep 4, 2024

Coverage of commit fb574c6

Summary coverage rate:
  lines......: 93.0% (3299 of 3547 lines)
  functions..: 72.5% (1360 of 1876 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

navIcon: React.JSXElementConstructor<HTMLElementProps>
navIcon:
| React.JSXElementConstructor<HTMLElementProps>
| ((props: NavIconProps) => React.JSX.Element)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feels unideal to me, but I'm not sure how to convince typescript that this is okay without doing this.

Copy link
Member

Choose a reason for hiding this comment

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

IMO, the best way to handle this would be to change navIcon to a ReactNode and stop having the nav supply classes to the content it's trying to render, but the way our CSS is built is probably less friendly to that idea.

Comment on lines 3 to 7
export type NavIconProps = ComponentPropsWithoutRef<"span">

export const DetourNavIcon = (props: NavIconProps) => (
<span {...props}>
<svg
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think we should make this function like the icons in our bsIcons, so we'd ideally have the same props and we'd be putting {...props} on the <svg/> and get rid of the <span> inside here. If anything relies on the <span/> being there, I'd instead wrap this icon in some intermediate component.

If it follows our bsicons conventions we could potentially reuse some of that testing code as well that verifies the correct properties are present.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to torture navLinkData.ts (now navLinkData.tsx) a little bit in order to get this to work.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Works for me!

@joshlarson joshlarson force-pushed the jdl/feat/new-detour-nav-icon branch from 27e7438 to 3056e3e Compare September 5, 2024 18:55
Copy link

github-actions bot commented Sep 5, 2024

Coverage of commit 3056e3e

Summary coverage rate:
  lines......: 93.0% (3299 of 3547 lines)
  functions..: 72.5% (1360 of 1876 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

@joshlarson joshlarson merged commit 2dee1e0 into main Sep 5, 2024
21 checks passed
@joshlarson joshlarson deleted the jdl/feat/new-detour-nav-icon branch September 5, 2024 19:05
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