diff --git a/projects/TokenizeRWATemplate-frontend/src/Layout.tsx b/projects/TokenizeRWATemplate-frontend/src/Layout.tsx index af83e8e..51ec351 100644 --- a/projects/TokenizeRWATemplate-frontend/src/Layout.tsx +++ b/projects/TokenizeRWATemplate-frontend/src/Layout.tsx @@ -2,143 +2,83 @@ import { useState } from 'react' import { NavLink, Outlet } from 'react-router-dom' import ConnectWallet from './components/ConnectWallet' import ThemeToggle from './components/ThemeToggle' -import Web3AuthButton from './components/Web3AuthButton' import { useUnifiedWallet } from './hooks/useUnifiedWallet' -/** - * Main Layout Component - * Wraps the entire app with navigation, footer, and wallet connection modal - * Now with unified wallet support - shows mutual exclusion between Web3Auth and traditional wallets - */ export default function Layout() { const [openWalletModal, setOpenWalletModal] = useState(false) - const { walletType } = useUnifiedWallet() + const { isConnected, activeAddress, userInfo } = useUnifiedWallet() const toggleWalletModal = () => setOpenWalletModal(!openWalletModal) - // Determine button states based on which wallet is active - const isWeb3AuthActive = walletType === 'web3auth' - const isTraditionalActive = walletType === 'traditional' + // Helper to format address: "ZBC...WXYZ" + const displayAddress = + isConnected && activeAddress ? `${activeAddress.toString().slice(0, 4)}...${activeAddress.toString().slice(-4)}` : 'Sign in' return (
{/* Navbar */} - {/* Main */}
- {/* Footer */} -