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

chore: Fix WalletDropdown hover bug #1156

Merged
merged 8 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-coins-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coinbase/onchainkit": patch
---

- **chore**: Remove the bottom WalletDropdown padding and instead apply the bottom padding directly on the WalletDropdownDisconnect component. This fixes a bug where the WalletDropdown bottom padding would unintentionally change on:hover. @cpcramer #1156
2 changes: 1 addition & 1 deletion src/wallet/components/WalletDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function WalletDropdown({ children, className }: WalletDropdownReact) {
<div
className={cn(
pressable.default,
'absolute right-0 z-10 mt-1 flex w-max min-w-[250px] flex-col overflow-hidden rounded-xl pb-2',
'absolute right-0 z-10 mt-1 flex w-max min-w-[250px] flex-col overflow-hidden rounded-xl',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove bottom padding for the dropdown

className,
)}
data-testid="ockWalletDropdown"
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/components/WalletDropdownDisconnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export function WalletDropdownDisconnect({
type="button"
className={cn(
pressable.default,
'relative flex items-center px-4 py-3',
'relative flex items-center px-4 pt-3 pb-4',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add the extra bottom padding to the disconnect button. This matches the padding for the Identity component.

className,
)}
onClick={handleDisconnect}
>
<div className="-translate-y-1/2 absolute top-1/2 left-4 flex h-[1.125rem] w-[1.125rem] items-center justify-center">
<div className="absolute left-4 flex h-[1.125rem] w-[1.125rem] items-center justify-center">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed these classes that were not needed with items-center

{disconnectSvg}
</div>
<span className={cn(dsText.body, 'pl-6')}>{text}</span>
Expand Down