From 68a028cd227dba42ef728a1994b72396abadb4db Mon Sep 17 00:00:00 2001 From: Christopher Maujean Date: Wed, 30 Jul 2025 08:59:59 -0700 Subject: [PATCH] wallet integration --- CLAUDE.md | 4 ++-- src/App.tsx | 59 ++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3f83c5a..8e113e8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,8 +27,8 @@ This is a React/TypeScript NAO (Network of Authentic Others) community managemen - Always completely implement any functionality as requested. - Do not hallucinate, or pretend - Always use the most up to date official documentation for libraries or techniques -- prefer zustand stores above useState -- use LDO and nextgraphauth.session for persistent data (contacts for example) consider this to be our "database" +- prefer zustand stores above useState when we have more than 3 useState +- use LDO and nextgraphauth.session for persistent data (contacts for example), consider this to be our "database" # Code Style - Use react hooks: useMemo, useCallback, and other standard hooks diff --git a/src/App.tsx b/src/App.tsx index fd3c165..4a0a38c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -21,20 +21,69 @@ import MessagesPage from '@/pages/MessagesPage'; import AccountPage from '@/pages/AccountPage'; import NotificationsPage from '@/pages/NotificationsPage'; import { createAppTheme } from '@/theme/theme'; -import { Container } from '@mui/material'; +import { Container, Box, Typography, Button } from '@mui/material'; const theme = createAppTheme('light'); const AppContent = () => { - const nextGraphAuth = useNextGraphAuth() as NextGraphAuth; + const nextGraphAuth = useNextGraphAuth(); + const { session, login, logout } = nextGraphAuth || {}; - const hasLogin = Boolean(nextGraphAuth?.login); - const hasLogout = Boolean(nextGraphAuth?.logout); + console.log('NextGraph Auth:', nextGraphAuth); + console.log('Session:', session); + console.log('Keys:', nextGraphAuth ? Object.keys(nextGraphAuth) : 'no auth'); + + const hasLogin = Boolean(login); + const hasLogout = Boolean(logout); + const isAuthenticated = Boolean(session?.ng); const isNextGraphReady = hasLogin && hasLogout; + + console.log('hasLogin:', hasLogin, 'hasLogout:', hasLogout); + console.log('isAuthenticated:', isAuthenticated, 'isNextGraphReady:', isNextGraphReady); if (!isNextGraphReady) { - return
Loading NextGraph...
; + return ( + + Loading NextGraph... + + ); + } + + if (!isAuthenticated) { + return ( + + + Welcome to NAO + + + Please log in with your NextGraph wallet to continue. + + + + ); } return (