register update

This commit is contained in:
Samandar Turgunboyev
2026-03-18 17:56:26 +05:00
parent a34cf75c57
commit 22c1688781
31 changed files with 631 additions and 1080 deletions

View File

@@ -1,9 +1,9 @@
import { useTheme } from '@/components/ThemeContext';
import { products_api } from '@/screens/home/lib/api';
import { useMutation, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
import { ChevronLeft, ChevronRight } from 'lucide-react-native';
import React, { Dispatch, SetStateAction, useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
ActivityIndicator,
FlatList,
@@ -12,6 +12,7 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import { Toast } from 'toastify-react-native';
interface Category {
id: number;
@@ -44,6 +45,7 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
const [currentCategories, setCurrentCategories] = useState<Category[]>([]);
const [currentParentId, setCurrentParentId] = useState<number | null>(null);
const [history, setHistory] = useState<HistoryItem[]>([]);
const { t } = useTranslation()
// Root categories
const { isLoading: rootLoading, error: rootError } = useQuery<CategoryResponse>({
@@ -66,8 +68,8 @@ export default function CategorySelect({ selectedCategories, setSelectedCategori
setCurrentCategories(childCategories);
setCurrentParentId(id);
},
onError: (err: AxiosError) => {
console.error('Child category loading error:', err);
onError: () => {
Toast.error(t("Xatolik yuz berdi"))
},
});