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: Style improvements for buttons and tooltips #147

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

NikolaiKryshnev
Copy link
Contributor

Copy link

vercel bot commented Dec 10, 2024

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

Name Status Preview Comments Updated (UTC)
hyperlane-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 3:27pm

Copy link

vercel bot commented Dec 10, 2024

@NikolaiKryshnev is attempting to deploy a commit to the Abacus Works Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@jmrossy jmrossy 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 these improvements! Just a few small things to fix please

src/components/search/SearchBar.tsx Outdated Show resolved Hide resolved
/* Fix for tooltips breaking layout on mobile devices (<526px width). */


@media (max-width: 526px) {#gas-info, #transaction-info, #message-info{max-width: calc(100% - 10px);}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use tailwind classes instead of creating a new css file.
If you need to do specific amounts like 526px, you can use a class like max-w-[526px], but it would be better if you can make this work with just the max-w classes in tailwind's base set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Unfortunately, this appears to be a limitation or bug in the Tooltip library. When we try to pass a className like max-w-[calc(100%-10px)] sm:max-w-[526px], it gets applied to an unexpected tag instead of the actual tooltip. This behavior prevents us from fully leveraging Tailwind classes in this case. For now, me had to rely on a custom CSS file to address this issue.

Copy link
Contributor

@Xaroz Xaroz Dec 11, 2024

Choose a reason for hiding this comment

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

There is a property inside the Tooltip called data-tooltip-class-name which directly modifies the className for the tooltip component. I vote we also move this part to the widgets lib @jmrossy

Copy link
Collaborator

Choose a reason for hiding this comment

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

@NikolaiKryshnev would you like to give this classname-based approach a try? Also from the CI failure it looks like you need to run yarn prettier to fix the formatting issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmrossy Thanks for the suggestion! I gave the data-tooltip-class-name approach a try, and it seems to work well.
image

@jmrossy jmrossy changed the title Feature/multiple updates feat: Style improvements for buttons and tooltips Dec 11, 2024
Copy link
Collaborator

@jmrossy jmrossy left a comment

Choose a reason for hiding this comment

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

Looks like prettier is still failing due to the extra space is SearchBar but I'll merge as is and fix it for you.

@jmrossy jmrossy merged commit 0363407 into hyperlane-xyz:main Dec 16, 2024
5 of 6 checks passed
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