+
+ {isConnected ? (
+ /* --- CONNECTED STATE --- */
+
+
- {/* Wallet Info */}
-
- {activeWallet && (
-
-
Connected Wallet
-
{getWalletDisplayName(activeWallet)}
+ {walletType === 'web3auth' && userInfo && (
+
+ {userInfo.profileImage && (
+

+ )}
+
+
+ Connected via {formatSocialProvider(userInfo.typeOfLogin)}
+
+
{userInfo.email || userInfo.name}
+
)}
-
- >
- )}
-
- {!activeAddress &&
- wallets?.map((wallet) => (
- ))}
-
+
+ ) : (
+ /* --- DISCONNECTED STATE --- */
+ <>
+
+
Social Login
+ {socialOptions.map((option) => (
+
+ ))}
+
-
-
+
+
+
+ Or use a wallet
+
+
- {activeAddress && (
-
+
+ {traditionalWallets?.map((wallet) => (
+
+ ))}
+
+ >
)}
)
}
+
export default ConnectWallet
diff --git a/projects/TokenizeRWATemplate-frontend/src/components/Web3AuthButton.tsx b/projects/TokenizeRWATemplate-frontend/src/components/Web3AuthButton.tsx
index 12a26f4..0d8a0e4 100644
--- a/projects/TokenizeRWATemplate-frontend/src/components/Web3AuthButton.tsx
+++ b/projects/TokenizeRWATemplate-frontend/src/components/Web3AuthButton.tsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'
import { AiOutlineLoading3Quarters } from 'react-icons/ai'
-import { FaGoogle, FaCopy, FaCheck } from 'react-icons/fa'
+import { FaCheck, FaCopy, FaGoogle } from 'react-icons/fa'
import { useWeb3Auth } from './Web3AuthProvider'
/**
@@ -46,12 +46,12 @@ export function Web3AuthButton() {
// Handle if address is an object (like from algosdk with publicKey property)
if (typeof algorandAccount.address === 'object' && algorandAccount.address !== null) {
// If it has a toString method, use it
- if ('toString' in algorandAccount.address && typeof algorandAccount.address.toString === 'function') {
- return algorandAccount.address.toString()
+ if ('toString' in algorandAccount.address && typeof algorandAccount.address === 'function') {
+ return algorandAccount.address
}
// If it has an addr property (algosdk Account object)
if ('addr' in algorandAccount.address) {
- return String(algorandAccount.address.addr)
+ return String(algorandAccount.address)
}
return ''
}
@@ -59,14 +59,6 @@ export function Web3AuthButton() {
return String(algorandAccount.address)
}
- // Ellipsize long addresses for better UI
- const ellipseAddress = (address: string = '', startChars = 6, endChars = 4): string => {
- if (!address || address.length <= startChars + endChars) {
- return address
- }
- return `${address.slice(0, startChars)}...${address.slice(-endChars)}`
- }
-
// Handle login with error feedback
const handleLogin = async () => {
try {
@@ -149,7 +141,7 @@ export function Web3AuthButton() {