diff --git a/app/guilds.tsx b/app/guilds.tsx index 7f24507..17c335e 100644 --- a/app/guilds.tsx +++ b/app/guilds.tsx @@ -7,6 +7,7 @@ import { GuildCard } from "../src/components/GuildCard"; import { LoadingState } from "../src/components/LoadingState"; import { ErrorState } from "../src/components/ErrorState"; import { EmptyState } from "../src/components/EmptyState"; +import { WalletRequired } from "../src/components/WalletRequired"; import React from "react"; export default function Guilds() { @@ -23,31 +24,33 @@ export default function Guilds() { ]; return ( - - - item.id} - contentContainerStyle={{ padding: 16 }} - testID="guilds-list" - renderItem={({ item }) => ( - router.push(`/guilds/${item.id}`)} - /> - )} - ListEmptyComponent={ - {}} - /> - } - /> - + + + + item.id} + contentContainerStyle={{ padding: 16 }} + testID="guilds-list" + renderItem={({ item }) => ( + router.push(`/guilds/${item.id}`)} + /> + )} + ListEmptyComponent={ + {}} + /> + } + /> + + ); } diff --git a/app/guilds/[guildId].tsx b/app/guilds/[guildId].tsx index 9e84d51..75a1135 100644 --- a/app/guilds/[guildId].tsx +++ b/app/guilds/[guildId].tsx @@ -9,6 +9,7 @@ import { ErrorState } from "../../src/components/ErrorState"; import { Card } from "../../src/components/Card"; import { RoleBadge } from "../../src/components/RoleBadge"; import { StaleDataBanner } from "../../src/components/StaleDataBanner"; +import { WalletRequired } from "../../src/components/WalletRequired"; import { useCombinedStaleState } from "../../src/features/offline/useStaleQuery"; import React from "react"; @@ -34,106 +35,96 @@ export default function GuildDetail() { const staleState = useCombinedStaleState([guildQuery, membershipQuery, rolesQuery]); - if (!validGuildId) { - return ; - } - - if ( - (guildPending && guildLoading) || - (memPending && memLoading) || - (rolesPending && rolesLoading) - ) { - return ; - } - - if (guildError && !guild) { - return ( - - ); - } - - if (!guild) { - return ( - - ); - } - return ( - - - - {staleState.isOffline ? ( - - ) : staleState.isStale && staleState.reason ? ( - - ) : null} + + + {!validGuildId ? ( + + ) : (guildPending && guildLoading) || (memPending && memLoading) || (rolesPending && rolesLoading) ? ( + + ) : guildError && !guild ? ( + + ) : !guild ? ( + + ) : ( + <> + + + {staleState.isOffline ? ( + + ) : staleState.isStale && staleState.reason ? ( + + ) : null} - - - {guild.name} - - - {guild.description || "No description provided."} - + + + {guild.name} + + + {guild.description || "No description provided."} + - - - Owner - - {guild.ownerAddress.substring(0, 6)}...{guild.ownerAddress.substring(38)} - - - - Chain ID - - {guild.chainId} - - - - + + + Owner + + {guild.ownerAddress.substring(0, 6)}...{guild.ownerAddress.substring(38)} + + + + Chain ID + + {guild.chainId} + + + + - - Your Membership - - - Status - - {membership?.isActive ? "Active Member" : "Not a Member"} - - - - + + Your Membership + + + Status + + {membership?.isActive ? "Active Member" : "Not a Member"} + + + + - - Available Roles - - {roles && roles.length > 0 ? ( - roles.map((role: { id: string; name: string }) => ) - ) : ( - No roles defined for this guild. - )} - - - - + + Available Roles + + {roles && roles.length > 0 ? ( + roles.map((role: { id: string; name: string }) => ) + ) : ( + No roles defined for this guild. + )} + + + + + )} + + ); } diff --git a/app/settings.tsx b/app/settings.tsx index 19adb6d..ae1c48d 100644 --- a/app/settings.tsx +++ b/app/settings.tsx @@ -3,6 +3,7 @@ import { useWallet } from "../src/features/wallet/useWallet"; import { AppHeader } from "../src/components/AppHeader"; import { Card } from "../src/components/Card"; import { Button } from "../src/components/Button"; +import { WalletRequired } from "../src/components/WalletRequired"; import { appConfig } from "../src/config/appConfig"; import { resetAppState } from "../src/lib/resetAppState"; import React, { useState } from "react"; @@ -51,16 +52,18 @@ export default function Settings() { Account - - will disconnect your current wallet address and clear any local cache. - -