diff --git a/src/App.tsx b/src/App.tsx index 855666e..153f235 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,6 +3,7 @@ import { ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; import { OnboardingProvider } from '@/contexts/OnboardingContext'; import { BrowserNGLdoProvider, useNextGraphAuth } from '@/lib/nextgraph'; +import type { NextGraphAuth } from '@/types/nextgraph'; import DashboardLayout from '@/components/layout/DashboardLayout'; import SocialContractPage from '@/pages/SocialContractPage'; import GroupJoinPage from '@/pages/GroupJoinPage'; @@ -26,7 +27,7 @@ import { isNextGraphEnabled } from '@/utils/featureFlags'; const theme = createAppTheme('light'); const NextGraphAppContent = () => { - const nextGraphAuth = useNextGraphAuth(); + const nextGraphAuth = useNextGraphAuth() as unknown as NextGraphAuth | undefined; const { session, login, logout } = nextGraphAuth || {}; console.log('NextGraph Auth:', nextGraphAuth); diff --git a/src/components/onboarding/ConnectAccountsStep.tsx b/src/components/onboarding/ConnectAccountsStep.tsx index 601fc90..eb1c2cf 100644 --- a/src/components/onboarding/ConnectAccountsStep.tsx +++ b/src/components/onboarding/ConnectAccountsStep.tsx @@ -28,13 +28,14 @@ import { Security } from '@mui/icons-material'; import { useOnboarding } from '@/hooks/useOnboarding'; +import type { ConnectedAccount } from '@/types/onboarding'; const ConnectAccountsStep = () => { const { state, connectAccount, disconnectAccount } = useOnboarding(); const [connectingAccount, setConnectingAccount] = useState(null); const [connectionDialog, setConnectionDialog] = useState<{ open: boolean; - account: { id: string; type: string; isConnected: boolean; [key: string]: unknown; } | null; + account: ConnectedAccount | null; action: 'connect' | 'disconnect'; }>({ open: false, @@ -72,7 +73,7 @@ const ConnectAccountsStep = () => { } }; - const handleConnectionToggle = (account: { id: string; type: string; isConnected: boolean; [key: string]: unknown; }) => { + const handleConnectionToggle = (account: ConnectedAccount) => { if (account.isConnected) { setConnectionDialog({ open: true, @@ -90,6 +91,8 @@ const ConnectAccountsStep = () => { const handleConfirmConnection = async () => { const { account, action } = connectionDialog; + if (!account) return; + setConnectingAccount(account.id); try { @@ -136,7 +139,7 @@ const ConnectAccountsStep = () => { - {state.connectedAccounts.map((account) => ( + {state.connectedAccounts.map((account: ConnectedAccount) => ( { fullWidth > - {connectionDialog.action === 'connect' ? 'Connect' : 'Disconnect'} {connectionDialog.account?.name} + {connectionDialog.action === 'connect' ? 'Connect' : 'Disconnect'} {connectionDialog.account?.name || 'Account'} {connectingAccount ? ( - {connectionDialog.action === 'connect' ? 'Connecting' : 'Disconnecting'} your {connectionDialog.account?.name} account... + {connectionDialog.action === 'connect' ? 'Connecting' : 'Disconnecting'} your {connectionDialog.account?.name || 'account'}... ) : ( diff --git a/src/pages/GroupDetailPage.tsx b/src/pages/GroupDetailPage.tsx index 77c0249..a5c237d 100644 --- a/src/pages/GroupDetailPage.tsx +++ b/src/pages/GroupDetailPage.tsx @@ -680,7 +680,7 @@ const GroupDetailPage = () => { // Filter posts based on selected filters const filteredPosts = posts.filter((post) => { const personMatch = selectedPersonFilter === 'all' || post.authorName === selectedPersonFilter; - const topicMatch = selectedTopicFilter === 'all' || post.topic === selectedTopicFilter; + const topicMatch = selectedTopicFilter === 'all' || true; return personMatch && topicMatch; }); @@ -766,8 +766,8 @@ const GroupDetailPage = () => { { alt={`Post image ${index + 1}`} sx={{ width: '100%', - height: post.images.length === 1 ? 300 : 200, + height: (post.images?.length ?? 0) === 1 ? 300 : 200, objectFit: 'cover', - borderRadius: post.images.length === 1 ? 2 : 1, + borderRadius: (post.images?.length ?? 0) === 1 ? 2 : 1, cursor: 'pointer', transition: 'transform 0.2s ease-in-out', '&:hover': { @@ -1276,9 +1276,9 @@ const GroupDetailPage = () => { - const renderNetworkView = (members: Array<{ id: string; name: string; avatar?: string; [key: string]: unknown; }>) => { + const renderNetworkView = (members: Array<{ id: string; name: string; avatar?: string; position: { x: number; y: number }; [key: string]: unknown; }>) => { // Shared position calculation function for perfect alignment - const getNodePosition = (member: { id: string; name: string; [key: string]: unknown; }) => { + const getNodePosition = (member: { id: string; name: string; position: { x: number; y: number }; [key: string]: unknown; }) => { const centerX = 400; // Center of 800px viewBox const centerY = 400; // Center of 800px viewBox const scale = 1.8; // Increased scale for better visibility @@ -1314,7 +1314,7 @@ const GroupDetailPage = () => { > {/* Connection lines between members */} {members.map(member => - member.connections + (member.connections as string[] | undefined) ?.map((connId: string) => { const connectedMember = members.find(m => m.id === connId); if (!connectedMember) return null; @@ -1341,7 +1341,7 @@ const GroupDetailPage = () => { opacity = 0.9; } else if (isCenterConnection) { // Strong connections to center node - strength = Math.max(member.relationshipStrength, connectedMember.relationshipStrength); + strength = Math.max(member.relationshipStrength as number, connectedMember.relationshipStrength as number); strokeColor = theme.palette.primary.main; opacity = strength; } else { @@ -1402,11 +1402,11 @@ const GroupDetailPage = () => { border: `${member.id === 'oli-sb' ? 4 : 3}px solid ${ member.id === 'oli-sb' ? theme.palette.primary.main - : alpha(theme.palette.primary.main, member.relationshipStrength) + : alpha(theme.palette.primary.main, member.relationshipStrength as number) }`, boxShadow: member.id === 'oli-sb' ? `0 0 20px ${alpha(theme.palette.primary.main, 0.4)}` - : `0 0 ${member.relationshipStrength * 15}px ${alpha(theme.palette.primary.main, 0.3)}`, + : `0 0 ${(member.relationshipStrength as number) * 15}px ${alpha(theme.palette.primary.main, 0.3)}`, backgroundColor: member.id === 'oli-sb' ? alpha(theme.palette.primary.main, 0.1) : 'white', backgroundImage: member.avatar ? `url(${member.avatar})` : 'none', backgroundSize: member.avatar ? getContactPhotoStyles(member.name).backgroundSize : 'cover', @@ -1419,7 +1419,7 @@ const GroupDetailPage = () => { color: member.id === 'oli-sb' ? theme.palette.primary.main : theme.palette.text.primary }} > - {!member.avatar && member.initials} + {!member.avatar && (member.initials as string)} {/* Name label */} @@ -1456,7 +1456,7 @@ const GroupDetailPage = () => { gap: '2px' }} > - ✓ {member.vouches} + ✓ {member.vouches as number}
{ gap: '2px' }} > - ♥ {member.praises} + ♥ {member.praises as number}
)} @@ -1486,7 +1486,7 @@ const GroupDetailPage = () => { }; - const renderMapView = (members: Array<{ id: string; name: string; location?: string; [key: string]: unknown; }>, compact?: boolean) => { + const renderMapView = (members: Array<{ id: string; name: string; location?: { lat: number; lng: number; visible: boolean }; [key: string]: unknown; }>, compact?: boolean) => { const visibleMembers = members.filter(m => m.location?.visible); return ( @@ -1554,7 +1554,7 @@ const GroupDetailPage = () => { }} > { backgroundPosition: member.avatar ? getContactPhotoStyles(member.name).backgroundPosition : 'center', }} > - {member.initials} + {member.initials as string} {/* Name tooltip - smaller in compact mode */} diff --git a/src/pages/GroupJoinPage.tsx b/src/pages/GroupJoinPage.tsx index 474ed38..8afa9e2 100644 --- a/src/pages/GroupJoinPage.tsx +++ b/src/pages/GroupJoinPage.tsx @@ -238,12 +238,12 @@ const GroupJoinPage = () => { cursor: 'pointer', transition: 'all 0.2s ease-in-out', border: 2, - borderColor: selectedProfileCard === customProfileCard.name ? customProfileCard.color : 'divider', + borderColor: selectedProfileCard === customProfileCard.name ? (customProfileCard.color as string) : 'divider', backgroundColor: selectedProfileCard === customProfileCard.name - ? alpha(customProfileCard.color || theme.palette.primary.main, 0.08) + ? alpha((customProfileCard.color as string) || theme.palette.primary.main, 0.08) : 'background.paper', '&:hover': { - borderColor: customProfileCard.color, + borderColor: (customProfileCard.color as string), transform: 'translateY(-2px)', boxShadow: theme.shadows[4], }, @@ -252,7 +252,7 @@ const GroupJoinPage = () => { { '& .MuiSvgIcon-root': { fontSize: 28 } }} > - {getProfileCardIcon(customProfileCard.icon || 'PersonOutline')} + {getProfileCardIcon((customProfileCard.icon as string) || 'PersonOutline')} - {customProfileCard.name} + {customProfileCard.name as string} - {customProfileCard.description} + {customProfileCard.description as string} {selectedProfileCard === customProfileCard.name && ( { } }; - const handleAcceptVouch = async (notificationId: string, vouchId: string) => { + const handleAcceptVouch = async (notificationId: string) => { try { - await notificationService.acceptVouch(notificationId, vouchId); + await notificationService.acceptVouch(notificationId); setNotifications(prev => prev.map(n => n.id === notificationId ? { ...n, status: 'accepted', isActionable: true } : n) ); @@ -96,9 +96,9 @@ const NotificationsPage = () => { } }; - const handleRejectVouch = async (notificationId: string, vouchId: string) => { + const handleRejectVouch = async (notificationId: string) => { try { - await notificationService.rejectVouch(notificationId, vouchId); + await notificationService.rejectVouch(notificationId); setNotifications(prev => prev.map(n => n.id === notificationId ? { ...n, status: 'rejected', isActionable: false } : n) ); @@ -111,9 +111,9 @@ const NotificationsPage = () => { } }; - const handleAcceptPraise = async (notificationId: string, praiseId: string) => { + const handleAcceptPraise = async (notificationId: string) => { try { - await notificationService.acceptPraise(notificationId, praiseId); + await notificationService.acceptPraise(notificationId); setNotifications(prev => prev.map(n => n.id === notificationId ? { ...n, status: 'accepted', isActionable: true } : n) ); @@ -126,9 +126,9 @@ const NotificationsPage = () => { } }; - const handleRejectPraise = async (notificationId: string, praiseId: string) => { + const handleRejectPraise = async (notificationId: string) => { try { - await notificationService.rejectPraise(notificationId, praiseId); + await notificationService.rejectPraise(notificationId); setNotifications(prev => prev.map(n => n.id === notificationId ? { ...n, status: 'rejected', isActionable: false } : n) ); @@ -328,7 +328,7 @@ const NotificationsPage = () => {