diff --git a/packages/web/src/components/modals/SpaceSettings.tsx b/packages/web/src/components/modals/SpaceSettings.tsx index d41023ed..1c99c715 100644 --- a/packages/web/src/components/modals/SpaceSettings.tsx +++ b/packages/web/src/components/modals/SpaceSettings.tsx @@ -266,11 +266,13 @@ function JoinRequestsSection({ spaceId }: { spaceId: string }) { export function SpaceSettingsModal() { const activeModal = useUIStore((s) => s.activeModal); const closeModal = useUIStore((s) => s.closeModal); + const isMobile = useUIStore((s) => s.isMobile); const currentSpaceId = useSpaceStore((s) => s.currentSpaceId); const spaces = useSpaceStore((s) => s.spaces); const spacePermissions = useSpaceStore((s) => s.spacePermissions); const [tab, setTab] = useState<'overview' | 'discovery' | 'members' | 'roles' | 'bans'>('overview'); + const [mobileView, setMobileView] = useState<'tabs' | 'content'>('tabs'); const isOpen = activeModal === 'spaceSettings'; const space = spaces.find(s => s.id === currentSpaceId); @@ -282,48 +284,114 @@ export function SpaceSettingsModal() { if (!space || !currentSpaceId) return null; const tabClass = (t: typeof tab) => - `w-full text-left px-2.5 py-1.5 rounded text-sm transition-colors ${ - tab === t ? 'bg-interactive-selected text-txt-primary' : 'text-txt-tertiary hover:text-txt-secondary hover:bg-interactive-hover' + `w-full text-left px-3 py-2 rounded-md text-sm transition-colors ${ + tab === t ? 'bg-interactive-selected text-txt-primary font-medium' : 'text-txt-tertiary hover:text-txt-secondary hover:bg-interactive-hover' }`; + const handleTabClick = (t: typeof tab) => { + setTab(t); + if (isMobile) setMobileView('content'); + }; + return ( - -
- {/* Tabs */} -
-
- + +
+ {/* Desktop Sidebar */} +
+ {/* Space card */} +
+ +
+
{space.name}
+
+
+ + {/* Nav list */} +
+
General
+ {canManageSpace && ( - + )} - + +
+
Management
+ {canManageRoles && ( - + )} {canBanMembers && ( - + )}
- {/* Content */} -
- {tab === 'overview' && } - {tab === 'discovery' && canManageSpace && } - {tab === 'members' && } - {tab === 'roles' && canManageRoles && } - {tab === 'bans' && canBanMembers && } -
+ {/* Mobile: Tab list */} + {isMobile && mobileView === 'tabs' && ( +
+ {/* Mobile space card */} +
+ +
+
{space.name}
+
+
+ +
+
General
+ + {canManageSpace && ( + + )} + +
+
Management
+ + {canManageRoles && ( + + )} + {canBanMembers && ( + + )} +
+
+ )} + + {/* Content area (desktop always, mobile only when viewing content) */} + {(!isMobile || mobileView === 'content') && ( +
+
+ {/* Mobile back button */} + {isMobile && ( + + )} + {tab === 'overview' && } + {tab === 'discovery' && canManageSpace && } + {tab === 'members' && } + {tab === 'roles' && canManageRoles && } + {tab === 'bans' && canBanMembers && } +
+
+ )}
);