complated
This commit is contained in:
@@ -9,7 +9,7 @@ import SearchTabs from '@/components/ui/SearchTabs';
|
||||
import { useTabSearch } from '@/hooks/useSearch';
|
||||
import { TabKey } from '@/types';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { Stack } from 'expo-router';
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import { Filter, Search } from 'lucide-react-native';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
} from 'react-native';
|
||||
import { GestureHandlerRootView, RefreshControl } from 'react-native-gesture-handler';
|
||||
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
||||
import { useHomeStore } from '../lib/hook';
|
||||
|
||||
function Loading() {
|
||||
return (
|
||||
@@ -37,12 +38,12 @@ function Loading() {
|
||||
export default function HomeScreen() {
|
||||
const { isDark } = useTheme();
|
||||
const [activeTab, setActiveTab] = useState<TabKey>('products');
|
||||
const [step, setStep] = useState<'filter' | 'items'>('filter');
|
||||
|
||||
const [query, setQuery] = useState('');
|
||||
const [showFilter, setShowFilter] = useState(false);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [filtered, setFiltered] = useState<{ id: number; company_name: string }[]>([]);
|
||||
const { t } = useTranslation();
|
||||
const { showFilter, setShowFilter, step, setStep } = useHomeStore();
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
@@ -115,10 +116,7 @@ export default function HomeScreen() {
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Stack.Screen options={{ headerShown: false }} />
|
||||
|
||||
<View style={styles.content}>
|
||||
{/* Qidiruv va filter */}
|
||||
<View style={styles.searchSection}>
|
||||
<View
|
||||
style={[
|
||||
@@ -169,8 +167,12 @@ export default function HomeScreen() {
|
||||
presentationStyle="pageSheet"
|
||||
onRequestClose={handleCloseFilter}
|
||||
>
|
||||
<SafeAreaProvider>
|
||||
<SafeAreaView style={{ flex: 1 }}>
|
||||
<SafeAreaProvider style={{ flex: 1 }}>
|
||||
<SafeAreaView style={{ flex: 1, backgroundColor: isDark ? '#0f172a' : '#fff' }}>
|
||||
<StatusBar
|
||||
style={isDark ? 'light' : 'dark'}
|
||||
backgroundColor={isDark ? '#0f172a' : '#fff'}
|
||||
/>
|
||||
<FilterUI back={handleCloseFilter} setStep={setStep} setFiltered={setFiltered} />
|
||||
</SafeAreaView>
|
||||
</SafeAreaProvider>
|
||||
|
||||
Reference in New Issue
Block a user