Skip to content

Commit

Permalink
move theme to wallet level
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Dec 18, 2024
1 parent c4c463a commit 3351e3e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/wallet/components/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { WalletDropdown } from './WalletDropdown';
import { WalletProvider, useWalletContext } from './WalletProvider';

function WalletContent({ children, className }: WalletReact) {
const componentTheme = useTheme();
const {
isOpen,
handleClose,
Expand All @@ -30,16 +29,17 @@ function WalletContent({ children, className }: WalletReact) {
return (
<div
ref={walletContainerRef}
className={cn('relative w-fit shrink-0', componentTheme, className)}
className={cn('relative w-fit shrink-0', className)}
>
{connect}
{isOpen && dropdown}
</div>
);
}

export const Wallet = ({ children }: WalletReact) => {
export const Wallet = ({ children, className }: WalletReact) => {
const isMounted = useIsMounted();
const componentTheme = useTheme();

// prevents SSR hydration issue
if (!isMounted) {
Expand All @@ -48,7 +48,9 @@ export const Wallet = ({ children }: WalletReact) => {

return (
<WalletProvider>
<WalletContent>{children}</WalletContent>
<WalletContent className={cn(componentTheme, className)}>
{children}
</WalletContent>
</WalletProvider>
);
};

0 comments on commit 3351e3e

Please sign in to comment.