diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index cae21567..8138d094 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -1,6 +1,7 @@ -import { useCallback, useMemo } from "react"; +import { useCallback, useMemo, type ReactNode } from "react"; import { CircleNotch, TerminalWindow } from "@phosphor-icons/react"; -import { LocaleContext, TranslationContext } from "./i18n"; +import { LocaleContext, TranslationContext, type TranslationFn } from "./i18n"; +import type { AppLocale } from "@shared/locale"; import { CompanyOnboarding } from "./components/CompanyOnboarding"; import TitleBar from "./components/TitleBar"; import ToastContainer from "./components/Toast"; @@ -15,6 +16,31 @@ import { useCommandPaletteHotkeys } from "./hooks/useCommandPaletteHotkeys"; import { AppActionsContext, type AppActions } from "./hooks/useAppActions"; import { unwrap } from "./lib/desktop"; +function Shell({ + locale, + t, + showCustomTitleBar, + className, + children, +}: { + locale: AppLocale; + t: TranslationFn; + showCustomTitleBar: boolean; + className?: string; + children: ReactNode; +}) { + return ( + + +
+ {showCustomTitleBar && } + {children} +
+
+
+ ); +} + export function App() { const ui = useUIController(); const company = useCompanyController(); @@ -99,44 +125,34 @@ export function App() { if (!company.snapshot) { return ( - - -
- {showCustomTitleBar && } -
- - {ui.t("app.loading")} -
-
-
-
+ +
+ + {ui.t("app.loading")} +
+
); } if (company.snapshot.companies.length === 0 || ui.showOnboarding || ui.initialOnboardingLocked) { return ( - - -
- {showCustomTitleBar && } -
- 0 && !ui.initialOnboardingLocked} - onCancel={() => { - ui.setShowOnboarding(false); - ui.setInitialOnboardingLocked(false); - setError(null); - }} - currentLocale={ui.locale} - onLocaleChange={ui.handleLocaleChange} - isFirstLaunch={company.snapshot.companies.length === 0} - /> -
-
-
-
+ +
+ 0 && !ui.initialOnboardingLocked} + onCancel={() => { + ui.setShowOnboarding(false); + ui.setInitialOnboardingLocked(false); + setError(null); + }} + currentLocale={ui.locale} + onLocaleChange={ui.handleLocaleChange} + isFirstLaunch={company.snapshot.companies.length === 0} + /> +
+
); }