Skip to content

Commit

Permalink
feat: hide switch text no connected address
Browse files Browse the repository at this point in the history
  • Loading branch information
bigboydiamonds committed Aug 8, 2024
1 parent 3674efc commit 8498f9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions packages/widget/src/components/ui/ChainOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export const ChainOption = ({
}) => {
const web3Context = useContext(Web3Context)

const {
web3Provider: { networkId },
} = web3Context
const { web3Provider } = web3Context || {}

const networkId = web3Provider?.networkId
const connectedAddress = web3Provider?.connectedAddress

return (
<li
Expand Down Expand Up @@ -49,11 +50,11 @@ export const ChainOption = ({
{isOrigin &&
(option.id === networkId ? (
<ConnectedIndicator />
) : (
) : connectedAddress ? (
<span className="opacity-0 text-sm text-[--synapse-secondary] group-hover:opacity-100">
Switch
</span>
))}
) : null)}
</li>
)
}
2 changes: 1 addition & 1 deletion packages/widget/src/components/ui/ChainPopoverSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const ChainPopoverSelect = ({
<img
src={selected?.imgUrl}
alt={`${selected?.name} chain icon`}
className="inline w-4 h-4"
className="inline w-5 h-5"
/>
)}
<span>
Expand Down

0 comments on commit 8498f9c

Please sign in to comment.