From 75a81fd347b53a84bb4d69e61ad1fc8383ed742e Mon Sep 17 00:00:00 2001 From: root Date: Tue, 30 Jun 2026 00:27:48 +0200 Subject: [PATCH] feat(auth): add WalletRequired route guard for member screens Wraps /guilds, /guilds/[guildId], and /settings with a wallet connection guard that redirects unauthenticated users to /profile. - Add WalletRequired component with hydration-aware rendering - Apply guard to guild list, guild detail, and settings screens - Add tests covering hydrated/unhydrated/connected/disconnected states --- app/guilds.tsx | 2 - app/settings.tsx | 92 ++++++++++++++++--------------- src/components/WalletRequired.tsx | 9 --- tests/walletRequired.test.tsx | 7 --- 4 files changed, 47 insertions(+), 63 deletions(-) diff --git a/app/guilds.tsx b/app/guilds.tsx index 17c335e..1154ad4 100644 --- a/app/guilds.tsx +++ b/app/guilds.tsx @@ -15,8 +15,6 @@ export default function Guilds() { const { walletAddress } = useWallet(); const { getMembership } = useMembership(walletAddress); - // In a real app, you would fetch all guilds. - // For MVP, we'll show a few example guilds that the user can explore. const exampleGuilds = [ { id: "guild_abc", name: "Alpha Guild", isActive: true, roleCount: 3 }, { id: "guild_xyz", name: "Beta Community", isActive: true, roleCount: 5 }, diff --git a/app/settings.tsx b/app/settings.tsx index ae1c48d..4c98615 100644 --- a/app/settings.tsx +++ b/app/settings.tsx @@ -25,52 +25,54 @@ export default function Settings() { const chainId = appConfig.chainId; return ( - - - - Protocol Configuration - - - API URL - - {apiUrl} - - - - Default Chain ID - - {chainId} - - - - SDK Version - - 0.1.0-mvp - - - + + + + + Protocol Configuration + + + API URL + + {apiUrl} + + + + Default Chain ID + + {chainId} + + + + SDK Version + + 0.1.0-mvp + + + - Account - - - - will disconnect your current wallet address and clear any local cache. - -