complated
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Logo from '@/assets/images/logo.png';
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { RefreshProvider } from '@/components/ui/RefreshContext';
|
||||
import { useHomeStore } from '@/screens/home/lib/hook';
|
||||
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
||||
import { router, Tabs } from 'expo-router';
|
||||
import { Home, Megaphone, PlusCircle, User } from 'lucide-react-native';
|
||||
@@ -12,6 +13,7 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
export default function TabsLayout() {
|
||||
const { isDark } = useTheme();
|
||||
const { t } = useTranslation();
|
||||
const { setShowFilter, setStep } = useHomeStore();
|
||||
const rotateAnim = useRef(new Animated.Value(0)).current;
|
||||
|
||||
useEffect(() => {
|
||||
@@ -58,9 +60,9 @@ export default function TabsLayout() {
|
||||
paddingBottom: 12,
|
||||
borderTopLeftRadius: 24,
|
||||
borderTopRightRadius: 24,
|
||||
backgroundColor: isDark ? 'rgba(15, 23, 42, 0.95)' : 'rgba(255, 255, 255, 0.95)', // #0f172a mos fon
|
||||
backgroundColor: isDark ? 'rgba(15, 23, 42, 1)' : 'rgba(255, 255, 255, 1)', // #0f172a mos fon
|
||||
borderWidth: 0.5,
|
||||
borderColor: isDark ? 'rgba(255, 255, 255, 0.1)' : 'rgba(226, 232, 240, 0.8)', // quyuq fon uchun yengil oq
|
||||
borderColor: isDark ? 'rgba(255, 255, 255, 0.1)' : 'rgba(226, 232, 240, 1)', // quyuq fon uchun yengil oq
|
||||
...Platform.select({
|
||||
ios: {
|
||||
shadowColor: isDark ? '#0f172a' : '#0f172a', // shadow qora emas #0f172a bilan uyg‘un
|
||||
@@ -85,6 +87,7 @@ export default function TabsLayout() {
|
||||
>
|
||||
<Tabs.Screen
|
||||
name="index"
|
||||
key={"index"}
|
||||
options={{
|
||||
title: 'Bosh sahifa',
|
||||
tabBarLabel: ({ color, focused }) => (
|
||||
@@ -103,7 +106,12 @@ export default function TabsLayout() {
|
||||
</Text>
|
||||
),
|
||||
tabBarIcon: ({ color, focused }) => (
|
||||
<View
|
||||
<TouchableOpacity
|
||||
onPress={() => {
|
||||
router.push('/(dashboard)');
|
||||
setShowFilter(false);
|
||||
setStep('filter');
|
||||
}}
|
||||
style={[
|
||||
styles.iconContainer,
|
||||
focused && styles.iconContainerActive,
|
||||
@@ -113,7 +121,7 @@ export default function TabsLayout() {
|
||||
]}
|
||||
>
|
||||
<Home color={color} size={30} strokeWidth={2} />
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
@@ -135,7 +143,7 @@ export default function TabsLayout() {
|
||||
},
|
||||
]}
|
||||
>
|
||||
{t("Qo'shish")}
|
||||
{t("Jo'natish")}
|
||||
</Text>
|
||||
),
|
||||
tabBarIcon: ({ color, focused }) => (
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { FilterProvider } from '@/components/ui/FilterContext';
|
||||
import { CustomHeader } from '@/components/ui/Header';
|
||||
import DashboardScreen from '@/screens/announcements/ui/AnnouncementsList';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function Announcements() {
|
||||
const { isDark } = useTheme();
|
||||
return (
|
||||
<FilterProvider>
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 80 }}
|
||||
>
|
||||
<CustomHeader />
|
||||
<DashboardScreen />
|
||||
</SafeAreaView>
|
||||
<CustomHeader />
|
||||
<DashboardScreen />
|
||||
</FilterProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,18 +2,13 @@ import { useTheme } from '@/components/ThemeContext';
|
||||
import { FilterProvider } from '@/components/ui/FilterContext';
|
||||
import { CustomHeader } from '@/components/ui/Header';
|
||||
import CreateAdsScreens from '@/screens/create-ads/ui/CreateAdsScreens';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function CreateAnnouncements() {
|
||||
const { isDark } = useTheme();
|
||||
return (
|
||||
<FilterProvider>
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 30 }}
|
||||
>
|
||||
<CustomHeader />
|
||||
<CreateAdsScreens />
|
||||
</SafeAreaView>
|
||||
<CustomHeader />
|
||||
<CreateAdsScreens />
|
||||
</FilterProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { CustomHeader } from '@/components/ui/Header';
|
||||
import EServicesScreen from '@/screens/e-services/ui/EServicesScreen';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function EServicesCategory() {
|
||||
const { isDark } = useTheme();
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 50 }}
|
||||
edges={['top']}
|
||||
>
|
||||
<>
|
||||
<CustomHeader />
|
||||
<EServicesScreen />
|
||||
</SafeAreaView>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { CustomHeader } from '@/components/ui/Header';
|
||||
import EServicesCategoryScreen from '@/screens/e-services/ui/EServicesCategoryScreen';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function EServices() {
|
||||
const { isDark } = useTheme();
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 80 }}
|
||||
edges={['top']}
|
||||
>
|
||||
<>
|
||||
<CustomHeader />
|
||||
<EServicesCategoryScreen />
|
||||
</SafeAreaView>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
// 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(() => {
|
||||
@@ -19,17 +16,13 @@ export default function Index() {
|
||||
}, [isAuthenticated, isLoading]);
|
||||
|
||||
if (isLoading || !isAuthenticated) {
|
||||
return null; // Loading vaqtida yoki auth yo‘q bo‘lsa hech narsa ko‘rmasin
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<FilterProvider>
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 55 }}
|
||||
>
|
||||
<CustomHeader />
|
||||
<HomeScreen />
|
||||
</SafeAreaView>
|
||||
<CustomHeader />
|
||||
<HomeScreen />
|
||||
</FilterProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import { useTheme } from '@/components/ThemeContext';
|
||||
import { CustomHeader } from '@/components/ui/Header';
|
||||
import Profile from '@/screens/profile/ui/ProfileScreen';
|
||||
import { SafeAreaView } from 'react-native-safe-area-context';
|
||||
|
||||
export default function ProfileScreen() {
|
||||
const { isDark } = useTheme();
|
||||
return (
|
||||
<SafeAreaView
|
||||
style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#ffffff', paddingBottom: 40 }}
|
||||
edges={['top']}
|
||||
>
|
||||
<>
|
||||
<CustomHeader logoutbtn={true} notif={false} />
|
||||
<Profile />
|
||||
</SafeAreaView>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user