Skip to content

Commit

Permalink
chore: factor exernal wallet provision into header hieght calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
DNR500 committed Sep 17, 2024
1 parent ce05f7b commit 958c6f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/widget/src/hooks/useHeaderHeight.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useHasExternalWalletProvider } from '../providers/WalletProvider/useHasExternalWalletProvider.js';
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js';

export const minHeaderHeight = 64;
Expand All @@ -6,11 +7,12 @@ export const maxHeaderHeightSubvariantSplit = 136;

export const useHeaderHeight = () => {
const { hiddenUI, subvariant } = useWidgetConfig();
const { hasExternalProvider } = useHasExternalWalletProvider();

const headerHeight =
subvariant === 'split'
? maxHeaderHeightSubvariantSplit
: hiddenUI?.includes('walletMenu')
: hiddenUI?.includes('walletMenu') || hasExternalProvider
? minHeaderHeight
: maxHeaderHeight;

Expand Down

0 comments on commit 958c6f5

Please sign in to comment.