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: home action btns hover state #4755

Merged
merged 1 commit into from
Jan 18, 2024
Merged

fix: home action btns hover state #4755

merged 1 commit into from
Jan 18, 2024

Conversation

alter-eggo
Copy link
Contributor

@alter-eggo alter-eggo commented Dec 25, 2023

Try out this version of Leather — Extension build, Test report

Pr to fix home action btns hover state, @mica000 wonder if colour is right here?
Screenshot 2023-12-25 at 12 07 40

@alter-eggo alter-eggo marked this pull request as ready for review December 26, 2023 06:14
@markmhendrickson
Copy link
Collaborator

Please link issue to PR 🙏

image

@mica000
Copy link

mica000 commented Jan 3, 2024

@@ -10,9 +11,12 @@ interface ActionButtonProps extends React.ComponentProps<typeof LeatherButton> {
}

export function ActionButton({ icon, label, ...rest }: ActionButtonProps) {
const isBreakpointSm = useViewportMinWidth('sm');
const variant = isBreakpointSm ? 'ghost' : 'ghost-secondary';

Copy link
Contributor

@pete-watters pete-watters Jan 8, 2024

Choose a reason for hiding this comment

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

You can use panda to set this rather than having to use the hook

variant={{ base: 'ghost', md: 'ghost-secondary' }}

I think that will make it cleaner and avoid mixing hooks here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems variant prop doesn't support it
Screenshot 2024-01-08 at 12 27 47

Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 thats odd.

I checked further and maybe we don't even need this variant at all?

We can change the color of 'ghost' in the recipe based on the screen size?

 ghost: {
        _hover: { bg: { base: 'brown.2', md: 'brown.4' } },
        ...
      },

Copy link
Contributor Author

@alter-eggo alter-eggo Jan 8, 2024

Choose a reason for hiding this comment

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

it will affect all "ghost" buttons, not sure if this is right direction here

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you are adding a new variant so that we can change the hover colour on small screens?

So we can:

  • add the new variant as you did but pass it as a prop and don't use the hook
  • change the hover for all ghost on small screen

You are affecting all ghost buttons anyway as if the viewport it small you switch them to another variant which is the same but has a different hover colour

Copy link
Contributor Author

@alter-eggo alter-eggo Jan 8, 2024

Choose a reason for hiding this comment

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

add the new variant as you did but pass it as a prop and don't use the hook

hm, how can I can get rid of hook? if I pass variant as prop I'll need this hook in parent component, no?

You are affecting all ghost buttons anyway

I here affect only action btns on home screen: send/recieve/buy/swap
If I change ghost variant directly it will affect all these ghost btns

Screenshot 2024-01-08 at 15 54 46

@alter-eggo alter-eggo added this pull request to the merge queue Jan 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 8, 2024
Copy link
Collaborator

@kyranjamie kyranjamie 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 taking on @alter-eggo, but IMO we should hold off for the moment.

We have 4 button variants, none that work with this one particular home page use case. It's up to the designers to either add a new variant, or change the design to work with the constraints of the current set of buttons. There is no ghost-secondary in design system atm. So I reckon we should wait it's added to figma before proceeding with implementation.

This issue also impacted the settings menu button 👇🏼
image

2 months ago, we had a conversation about removing the off white background colour, which would remedy this problem & avoid having to add a new design system button for this edge-case

@mica000 @fabric-8 any chance we can revisit this. Reckon this is a much better solution.

@alter-eggo
Copy link
Contributor Author

added new color here leather-io/mono#40

@alter-eggo alter-eggo added this pull request to the merge queue Jan 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 18, 2024
@alter-eggo alter-eggo added this pull request to the merge queue Jan 18, 2024
Merged via the queue into dev with commit c270868 Jan 18, 2024
28 checks passed
@alter-eggo alter-eggo deleted the fix/home-action-btns branch January 18, 2024 14:52
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.

Account info card btn hover state doesn't work
6 participants