feat: navigate workspaces without page reloads

This commit is contained in:
Codex
2026-07-30 22:10:59 +08:00
parent 3a6652be0f
commit 144e17c220
3 changed files with 147 additions and 3 deletions
+11 -3
View File
@@ -4,15 +4,23 @@ import 'animal-island-ui/style';
import { ConsoleAuthGate } from './auth/console-auth.js';
import { AppShell } from './app-shell.js';
import { useBrowserPathname } from './navigation/use-browser-pathname.js';
import './styles.css';
const root = document.querySelector<HTMLElement>('#root');
if (!root) throw new Error('Missing application root');
function BrowserApp() {
const pathname = useBrowserPathname();
return (
<ConsoleAuthGate>
<AppShell pathname={pathname} />
</ConsoleAuthGate>
);
}
createRoot(root).render(
<StrictMode>
<ConsoleAuthGate>
<AppShell pathname={window.location.pathname} />
</ConsoleAuthGate>
<BrowserApp />
</StrictMode>,
);