Skip to content

Commit

Permalink
fix: should show wallet menu in split mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Dec 16, 2024
1 parent 4030c80 commit 7ca782c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/widget/src/components/Header/WalletHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,27 @@ const useInternalWalletManagement = () => {
const isWalletMenuHidden = hiddenUI?.includes(HiddenUI.WalletMenu)

const shouldShowWalletMenu =
!useExternalWalletProvidersOnly && !isSplitVariant && !isWalletMenuHidden
!useExternalWalletProvidersOnly && !isWalletMenuHidden

return shouldShowWalletMenu
return {
shouldShowWalletMenu,
isSplitVariant,
}
}

export const WalletHeader: React.FC = () => {
const shouldShowWalletMenu = useInternalWalletManagement()
const { shouldShowWalletMenu, isSplitVariant } = useInternalWalletManagement()

return shouldShowWalletMenu ? (
return shouldShowWalletMenu && !isSplitVariant ? (
<HeaderAppBar elevation={0} sx={{ justifyContent: 'flex-end' }}>
<WalletMenuButton />
</HeaderAppBar>
) : null
}

export const SplitWalletMenuButton: React.FC = () => {
const shouldShowWalletMenu = useInternalWalletManagement()
return shouldShowWalletMenu ? <WalletMenuButton /> : null
const { shouldShowWalletMenu, isSplitVariant } = useInternalWalletManagement()
return shouldShowWalletMenu && isSplitVariant ? <WalletMenuButton /> : null
}

export const WalletMenuButton: React.FC = () => {
Expand Down

0 comments on commit 7ca782c

Please sign in to comment.