From fb825828f7e87c7cb721b92437e39990b4e0b4e2 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Tue, 17 Mar 2026 07:13:49 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20extract=20welcome/loading=20screens?= =?UTF-8?q?=20in=20App.tsx=20=E2=80=94=20reduce=20main=20component=20compl?= =?UTF-8?q?exity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 54 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 61da33f4..00a3a973 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -478,31 +478,12 @@ function App() { // Show welcome/onboarding screen when vault doesn't exist if (onboarding.state.status === 'welcome' || onboarding.state.status === 'vault-missing') { - const defaultPath = onboarding.state.defaultPath - return ( -
- -
- ) + return } // Show loading spinner while checking vault if (onboarding.state.status === 'loading') { - return ( -
-
- Loading… -
-
- ) + return } return ( @@ -633,4 +614,35 @@ function App() { ) } +type OnboardingState = ReturnType + +/** Welcome screen view - extracted from main App component */ +function WelcomeView({ onboarding }: { onboarding: OnboardingState }) { + const state = onboarding.state as { status: 'welcome' | 'vault-missing'; defaultPath: string; vaultPath?: string } + return ( +
+ +
+ ) +} + +/** Loading spinner view - extracted from main App component */ +function LoadingView() { + return ( +
+
+ Loading… +
+
+ ) +} + export default App