register update
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
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,
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native';
|
||||
import { Toast } from 'toastify-react-native';
|
||||
import { useTheme } from '../ThemeContext';
|
||||
|
||||
interface Category {
|
||||
@@ -39,6 +40,7 @@ export default function CategorySelection({ selectedCategories, setSelectedCateg
|
||||
const [history, setHistory] = useState<{ parentId: number | null; categories: Category[] }[]>([]);
|
||||
const [currentParentId, setCurrentParentId] = useState<number | null>(null);
|
||||
const { isDark } = useTheme();
|
||||
const { t } = useTranslation()
|
||||
|
||||
const theme = {
|
||||
cardBg: isDark ? '#1e293b' : '#f8fafc',
|
||||
@@ -75,8 +77,8 @@ export default function CategorySelection({ selectedCategories, setSelectedCateg
|
||||
setCurrentCategories(childCategories);
|
||||
setCurrentParentId(id);
|
||||
},
|
||||
onError: (err: AxiosError) => {
|
||||
console.error('Child yuklashda xato:', err);
|
||||
onError: () => {
|
||||
Toast.error(t("Xatolik yuz berdi"))
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user