global fix and add tauri app
This commit is contained in:
32
tauri_app/src/App.tsx
Normal file
32
tauri_app/src/App.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { useState } from 'react';
|
||||
import { MobileShell, type MobileTab } from './components/mobile-shell';
|
||||
import { LoginScreen } from './features/auth/login-screen';
|
||||
import { ChatsScreen } from './features/chat/chats-screen';
|
||||
import { SecurityScreen } from './features/security/security-screen';
|
||||
import { TotpScreen } from './features/totp/totp-screen';
|
||||
import { MobileAuthProvider, useMobileAuth } from './lib/auth';
|
||||
|
||||
function AppContent() {
|
||||
const { isAuthenticated } = useMobileAuth();
|
||||
const [activeTab, setActiveTab] = useState<MobileTab>('security');
|
||||
|
||||
if (!isAuthenticated) {
|
||||
return <LoginScreen />;
|
||||
}
|
||||
|
||||
return (
|
||||
<MobileShell activeTab={activeTab} onTabChange={setActiveTab}>
|
||||
{activeTab === 'chats' ? <ChatsScreen /> : null}
|
||||
{activeTab === 'totp' ? <TotpScreen /> : null}
|
||||
{activeTab === 'security' ? <SecurityScreen /> : null}
|
||||
</MobileShell>
|
||||
);
|
||||
}
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
<MobileAuthProvider>
|
||||
<AppContent />
|
||||
</MobileAuthProvider>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user