fitst commit

This commit is contained in:
Samandar Turgunboyev
2026-01-28 18:26:50 +05:00
parent 166a55b1e9
commit 124798419b
196 changed files with 26627 additions and 421 deletions

33
app/(dashboard)/index.tsx Normal file
View File

@@ -0,0 +1,33 @@
// pages/home/index.tsx
import { useAuth } from '@/components/AuthProvider';
import { useTheme } from '@/components/ThemeContext';
import { FilterProvider } from '@/components/ui/FilterContext';
import { CustomHeader } from '@/components/ui/Header';
import HomeScreen from '@/screens/home/ui/HomeScreen';
import { router } from 'expo-router';
import { useEffect } from 'react';
import { SafeAreaView } from 'react-native-safe-area-context';
export default function Index() {
const { isDark } = useTheme();
const { isAuthenticated, isLoading } = useAuth();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.replace('/(auth)');
}
}, [isAuthenticated, isLoading]);
if (isLoading || !isAuthenticated) {
return null; // Loading vaqtida yoki auth yoq bolsa hech narsa kormasin
}
return (
<FilterProvider>
<SafeAreaView style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff' }}>
<CustomHeader />
<HomeScreen />
</SafeAreaView>
</FilterProvider>
);
}