- Introduced SpoolPreset and User domain models with necessary DTOs and utility functions. - Created AuthRepository, FilamentRepository, and SpoolPresetRepository interfaces for authentication and data management. - Implemented UI components for filament display, including ColorSwatch, FilamentCard, and StockBar. - Developed layout components such as Header and Screen for consistent app structure. - Added reusable UI components like Badge, Button, Card, and Input for better user interaction. - Established global constants and theme settings for consistent styling across the application. - Implemented utility functions for filament calculations and formatting. - Created Zustand stores for managing authentication, filament, and preset states. - Configured TypeScript settings for improved development experience.
29 lines
807 B
TypeScript
29 lines
807 B
TypeScript
import React, { useEffect } from 'react';
|
|
import { Stack } from 'expo-router';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import { useAuthStore } from '@store/authStore';
|
|
|
|
/**
|
|
* Root layout do expo-router.
|
|
* Carrega a sessão armazenada e controla o fluxo auth vs app.
|
|
*/
|
|
export default function RootLayout(): React.ReactElement | null {
|
|
const { loadStoredSession, isLoading } = useAuthStore();
|
|
|
|
useEffect(() => {
|
|
loadStoredSession();
|
|
}, [loadStoredSession]);
|
|
|
|
if (isLoading) return null;
|
|
|
|
return (
|
|
<>
|
|
<StatusBar style="light" backgroundColor="transparent" translucent />
|
|
<Stack screenOptions={{ headerShown: false, contentStyle: { backgroundColor: '#1E1B18' } }}>
|
|
<Stack.Screen name="(auth)" />
|
|
<Stack.Screen name="(app)" />
|
|
</Stack>
|
|
</>
|
|
);
|
|
}
|