@@ -6,11 +6,16 @@ import { useWalletContext } from "./WalletProvider";
66import { Popover , PopoverContent , PopoverTrigger } from "@tokenization/ui/popover" ;
77import { Check , Copy , LogOut , ChevronRight , Wallet } from "lucide-react" ;
88
9+ type WalletButtonProps = {
10+ /** Use "sidebar" for lighter styling inside a sidebar (no dark/black background) */
11+ variant ?: "default" | "sidebar" ;
12+ } ;
13+
914/**
1015 * Wallet connection/disconnection button component
1116 * Shows different states based on wallet connection status
1217 */
13- export const WalletButton = ( ) => {
18+ export const WalletButton = ( { variant = "default" } : WalletButtonProps ) => {
1419 const { handleConnect, handleDisconnect } = useWallet ( ) ;
1520 const { walletAddress, walletName } = useWalletContext ( ) ;
1621 const [ copied , setCopied ] = React . useState ( false ) ;
@@ -37,12 +42,17 @@ export const WalletButton = () => {
3742 }
3843 } ;
3944
40- if ( ! mounted ) {
45+ const connectButtonClass =
46+ variant === "sidebar"
47+ ? "flex w-full items-center gap-2 rounded-xl px-3 h-12 border border-border bg-sidebar-accent text-sidebar-accent-foreground hover:bg-sidebar-accent/80 transition-colors font-medium text-sm cursor-pointer"
48+ : "flex w-full items-center gap-2 rounded-xl px-3 h-12 bg-primary text-primary-foreground hover:bg-primary/90 transition-colors font-medium text-sm cursor-pointer" ;
49+
50+ if ( ! mounted || ! walletAddress ) {
4151 return (
4252 < button
4353 type = "button"
44- onClick = { mounted ? handleConnect : undefined }
45- className = "flex w-full items-center gap-2 rounded-xl px-3 h-12 bg-primary text-primary-foreground hover:bg-brand-primary-hover transition-colors font-medium text-sm cursor-pointer"
54+ onClick = { handleConnect }
55+ className = { connectButtonClass }
4656 >
4757 < Wallet className = "size-5 shrink-0" />
4858 < span > Conectar Billetera</ span >
0 commit comments