feat: onboarding page & adding git settings

This commit is contained in:
simos
2025-11-17 15:26:46 +01:00
parent 2df8c8e786
commit 8c629a1a05
10 changed files with 934 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ import React from 'react';
import { useAuth } from '../contexts/AuthContext';
import SetupForm from './SetupForm';
import LoginForm from './LoginForm';
import Onboarding from './Onboarding';
import { MessageSquare } from 'lucide-react';
const LoadingScreen = () => (
@@ -24,14 +25,20 @@ const LoadingScreen = () => (
);
const ProtectedRoute = ({ children }) => {
const { user, isLoading, needsSetup } = useAuth();
const { user, isLoading, needsSetup, hasCompletedOnboarding, refreshOnboardingStatus } = useAuth();
// Platform mode: skip all auth UI and directly render children
if (import.meta.env.VITE_IS_PLATFORM === 'true') {
if (isLoading) {
return <LoadingScreen />;
}
if (!hasCompletedOnboarding) {
return <Onboarding onComplete={refreshOnboardingStatus} />;
}
return children;
}
// Normal OSS mode: standard auth flow
if (isLoading) {
return <LoadingScreen />;
}
@@ -44,6 +51,10 @@ const ProtectedRoute = ({ children }) => {
return <LoginForm />;
}
if (!hasCompletedOnboarding) {
return <Onboarding onComplete={refreshOnboardingStatus} />;
}
return children;
};