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

fix: homepage - use Link for internal links #1001

Closed
wants to merge 1 commit into from
Closed

fix: homepage - use Link for internal links #1001

wants to merge 1 commit into from

Conversation

SutuSebastian
Copy link
Collaborator

Use NextJS Link component for internal routes. Avoid full page refresh and improve UX.

Before

Screen.Recording.2023-09-26.at.13.36.44.mov

After

Screen.Recording.2023-09-26.at.13.36.22.mov

@vercel
Copy link

vercel bot commented Sep 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 4:01pm

<Button href="/docs/getting-started/introduction" size="lg" className="w-full whitespace-nowrap">
Get started <HiOutlineArrowRight className="ml-2 mt-1 h-4 w-4" />
</Button>
<Link href="/docs/getting-started/introduction" tabIndex={-1}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@SutuSebastian probably here we want to use <Button as={Link} ...>

Copy link
Collaborator Author

@SutuSebastian SutuSebastian Sep 26, 2023

Choose a reason for hiding this comment

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

Already discussed in Discord in the react-library, TS throws errors when doing that, it does not properly infer & extend the Link component from NextJS. That is the reason I made it like this.

Do u think we should fix the underlying issue with TS first? Luckily this is the only place href prop is used that is visible to the user.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Screenshot 2023-09-26 at 19 35 30

Copy link
Collaborator

Choose a reason for hiding this comment

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

As we discussed, I think that we should first fix the button. I'm converting this PR to draft till we get the fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

#1244 should fix this now @SutuSebastian @rluders

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will push the fixes in #1246.

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Attention: 485 lines in your changes are missing coverage. Please review.

Comparison is base (7461173) 99.54% compared to head (369a8d4) 93.56%.
Report is 127 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1001      +/-   ##
==========================================
- Coverage   99.54%   93.56%   -5.99%     
==========================================
  Files         163      205      +42     
  Lines        6621     8545    +1924     
  Branches      401      468      +67     
==========================================
+ Hits         6591     7995    +1404     
- Misses         30      550     +520     
Files Coverage Δ
src/components/Accordion/Accordion.tsx 100.00% <100.00%> (ø)
src/components/Accordion/AccordionContent.tsx 100.00% <100.00%> (ø)
src/components/Accordion/AccordionPanel.tsx 100.00% <100.00%> (ø)
src/components/Accordion/AccordionPanelContext.tsx 88.88% <100.00%> (+1.38%) ⬆️
src/components/Accordion/AccordionTitle.tsx 100.00% <100.00%> (ø)
src/components/Accordion/index.ts 100.00% <100.00%> (ø)
src/components/Alert/Alert.tsx 100.00% <100.00%> (ø)
src/components/Avatar/Avatar.tsx 100.00% <100.00%> (ø)
src/components/Avatar/AvatarGroup.tsx 100.00% <100.00%> (ø)
src/components/Avatar/AvatarGroupCounter.tsx 100.00% <100.00%> (ø)
... and 107 more

... and 39 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SutuSebastian
Copy link
Collaborator Author

deprecated by #1246, this one is too outdated.

@SutuSebastian SutuSebastian deleted the fix/homepage/internal-links/use-nextJS-link-component branch January 24, 2024 07:34
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