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 option to make TabList button be a element #3508

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

omBratteng
Copy link
Member

@omBratteng omBratteng commented Sep 3, 2024

Changes

  • Converts tabs on explore page to use a instead of button

Preview domain

https://as-543-buttons-to-links.preview.app.daily.dev

Copy link

vercel bot commented Sep 3, 2024

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

Name Status Preview Comments Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2024 9:34am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
storybook ⬜️ Ignored (Inspect) Sep 6, 2024 9:34am

Copy link
Contributor

@rebelchris rebelchris left a comment

Choose a reason for hiding this comment

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

More going of visual testing.
Can we add cursor-pointer to hovering it?

@@ -113,7 +118,7 @@ function TabList<T extends string = string>({
);

return (
<button
<Tag
Copy link
Contributor

Choose a reason for hiding this comment

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

If now is an anchor maybe we want to add useful attributes like aria-label, title, href (this should be required imo). What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added label and title. Adding href needs a bit more work I see

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's hard to implement, also we can put role="button" and href="#" if the behaviour is fully JS-side

Copy link
Member Author

Choose a reason for hiding this comment

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

Had a chat with @rebelchris, we'll merge it without the href and then run it through the SEO tool to look. If it still complains, I'll refactor it so that it gets proper href.

Comment on lines 133 to +134
isActive ? '' : 'text-text-tertiary',
isAnchor && 'cursor-pointer',
Copy link
Contributor

Choose a reason for hiding this comment

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

Non mandatory: if we have more conditional classes maybe the object structure can be more readable, wdyt?

classNames(
              className.item,
              'relative p-2 py-4 text-center font-bold typo-callout',
              { 'text-text-tertiary': !isActive, 'cursor-pointer': isAnchor},
)

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think we'll have any more now

@@ -126,13 +131,14 @@ function TabList<T extends string = string>({
className.item,
'relative p-2 py-4 text-center font-bold typo-callout',
isActive ? '' : 'text-text-tertiary',
isAnchor && 'cursor-pointer',
)}
onClick={() => onClick(tab)}
type="button"
Copy link
Contributor

Choose a reason for hiding this comment

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

If anchor type button should not be there

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed

@omBratteng omBratteng enabled auto-merge (squash) September 6, 2024 09:32
@omBratteng omBratteng merged commit 5209850 into main Sep 6, 2024
9 of 10 checks passed
@omBratteng omBratteng deleted the AS-543-buttons-to-links branch September 6, 2024 09:35
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.

4 participants