mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-10 10:49:35 +00:00
4475afd793
Settings sections are now URL-addressable at /settings/:sectionId, rendered nested inside EditorLayout alongside the stack sidebar. Browser back/forward navigates between sections. Deep links (e.g. /settings/cloud-backup) load the section directly on hard reload. - Add react-router-dom v7; BrowserRouter wraps the full app tree - New SettingsPage (scroll memory, Cmd+K palette), SettingsSidebar (NavLink active styling, back-arrow), SectionGate (visibility + tier lock card) - Rename SectionId 'appstore' to 'app-store' so slug === SectionId - Decouple SystemSection, DeveloperSection, AppStoreSection from modal- passed props; each fetches its own data on mount - Replace onLabelsChanged prop chain with SENCHO_LABELS_CHANGED window event - Drop onOpenSettings prop from UserProfileDropdown, HomeDashboard, ConfigurationStatus; each calls useNavigate directly - Delete SettingsModal.tsx
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
import { BrowserRouter } from 'react-router-dom';
|
|
import { AuthProvider, useAuth } from './context/AuthContext';
|
|
import { NodeProvider } from './context/NodeContext';
|
|
import { LicenseProvider } from './context/LicenseContext';
|
|
import { Login } from './components/Login';
|
|
import { Setup } from './components/Setup';
|
|
import EditorLayout from './components/EditorLayout';
|
|
import { MfaChallenge } from './components/MfaChallenge';
|
|
import { DeployFeedbackProvider } from './context/DeployFeedbackContext';
|
|
import { DeployFeedbackPortal } from './components/DeployFeedbackPortal';
|
|
|
|
function AppContent() {
|
|
const { appStatus, isAuthenticated, needsSetup, completeSetup } = useAuth();
|
|
|
|
if (appStatus === 'loading') {
|
|
return (
|
|
<div className="min-h-screen flex items-center justify-center bg-background">
|
|
<div className="text-muted-foreground">Loading...</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
if (needsSetup) {
|
|
return <Setup onComplete={completeSetup} />;
|
|
}
|
|
|
|
if (appStatus === 'mfaChallenge') {
|
|
return <MfaChallenge />;
|
|
}
|
|
|
|
if (!isAuthenticated) {
|
|
return <Login />;
|
|
}
|
|
|
|
return (
|
|
<NodeProvider>
|
|
<LicenseProvider>
|
|
<EditorLayout />
|
|
</LicenseProvider>
|
|
</NodeProvider>
|
|
);
|
|
}
|
|
|
|
import { ToastContainer } from './components/ui/toast';
|
|
|
|
function App() {
|
|
return (
|
|
<BrowserRouter>
|
|
<AuthProvider>
|
|
<DeployFeedbackProvider>
|
|
<AppContent />
|
|
<DeployFeedbackPortal />
|
|
</DeployFeedbackProvider>
|
|
<ToastContainer />
|
|
</AuthProvider>
|
|
</BrowserRouter>
|
|
);
|
|
}
|
|
|
|
export default App;
|