Skip to content

Commit

Permalink
chore(impr): behaivior & clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfcito committed May 14, 2024
1 parent 0193762 commit d0df645
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions components/button-wrapper/button-wrapper.component.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ButtonWrapperProps } from './button-wrapper.type'
import clsx from 'clsx'

export function ButtonWrapper({ children, classname, onclick }: ButtonWrapperProps) {
export function ButtonWrapper({ children, classname, onclick, isVisible = true }: ButtonWrapperProps) {
// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {}
return (
<div
className={clsx(
'items-center hidden gap-2 px-4 py-3 rounded-sm lg:flex hover:rounded-sm hover:bg-neutral cursor-pointer',
'items-center gap-2 px-4 py-3 rounded-sm md:flex hover:rounded-sm hover:bg-neutral cursor-pointer',
classname,
{ hidden: isVisible },
)}
onClick={onclick ? onclick : noop}
role="button"
Expand Down
1 change: 1 addition & 0 deletions components/button-wrapper/button-wrapper.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface ButtonWrapperProps {
children: React.ReactNode
classname?: string
onclick?: () => void
isVisible?: boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AddressInfoDropdown = ({
<details ref={dropdownRef} className="leading-3 dropdown dropdown-end">
<summary tabIndex={0} className="btn btn-sm p-2 dropdown-toggle gap-0 !h-auto rounded-sm hover:bg-neutral">
<BlockieAvatar address={address} size={30} ensImage={ensAvatar} />
<span className="ml-2 mr-1 font-mono">{displayName}</span>
<span className="hidden ml-2 mr-1 font-mono md:flex">{displayName}</span>
<ChevronDownIcon className="w-4 h-6 ml-2 sm:ml-0" />
</summary>
<ul tabIndex={0} className="gap-1 p-2 mt-2 rounded-sm dropdown-content menu bg-neutral">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const RainbowKitCustomConnectButton = () => {
</label>
<Notifications notificationList={notificationList} />
</ButtonWrapper>
<ButtonWrapper onclick={openChainModal}>
<ButtonWrapper onclick={openChainModal} isVisible={false}>
<Image
src={targetNetwork.iconUrl ?? ''}
className="h-7 w-7"
Expand Down

0 comments on commit d0df645

Please sign in to comment.