bug fixed

This commit is contained in:
Samandar Turgunboyev
2026-03-02 13:22:55 +05:00
parent bdc205b538
commit ab363ca3b9
44 changed files with 424 additions and 130 deletions

View File

@@ -2,7 +2,7 @@ import { useTheme } from '@/components/ThemeContext';
import { useInfiniteQuery } from '@tanstack/react-query';
import * as Clipboard from 'expo-clipboard';
import { useRouter } from 'expo-router';
import { ArrowLeft, CopyIcon, HandCoins, Plus, Users } from 'lucide-react-native';
import { ArrowLeft, CopyIcon, Gift, HandCoins, Plus, Users } from 'lucide-react-native';
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import {
@@ -14,11 +14,11 @@ import {
Share,
StyleSheet,
Text,
ToastAndroid,
TouchableOpacity,
View,
View
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { Toast } from 'toastify-react-native';
import { user_api } from '../lib/api';
const PAGE_SIZE = 10;
@@ -84,7 +84,7 @@ export function ReferralsTab() {
}
if (Platform.OS === 'android') {
ToastAndroid.show(t('Refferal kopiya qilindi'), ToastAndroid.SHORT);
Toast.success(t('Refferal kopiya qilindi'));
}
};
@@ -153,11 +153,22 @@ export function ReferralsTab() {
</View>
</View>
)}
ListEmptyComponent={
<Text style={{ textAlign: 'center', color: theme.subText }}>
{t('Refferallar topilmadi')}
</Text>
}
ListEmptyComponent={() => (
<View style={styles.emptyContainer}>
<View
style={[
styles.emptyIconWrapper,
{ backgroundColor: theme.cardBg }
]}
>
<Gift size={40} color={theme.primary} />
</View>
<Text style={[styles.emptyTitle, { color: theme.text }]}>
{t("Refferallar mavjud emas")}
</Text>
</View>
)}
/>
</View>
);
@@ -175,7 +186,7 @@ const styles = StyleSheet.create({
},
headerTitle: { fontSize: 18, fontWeight: '700' },
list: { padding: 16, gap: 12, paddingBottom: 30 },
list: { padding: 16, gap: 12, paddingBottom: 30, flexGrow: 1 },
card: {
borderRadius: 16,
@@ -217,4 +228,46 @@ const styles = StyleSheet.create({
amount: {
fontWeight: '700',
},
emptyContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: 30,
},
emptyIconWrapper: {
width: 80,
height: 80,
borderRadius: 40,
alignItems: 'center',
justifyContent: 'center',
marginBottom: 20,
elevation: 4,
},
emptyTitle: {
fontSize: 18,
fontWeight: '700',
marginBottom: 8,
textAlign: 'center',
},
emptyDesc: {
fontSize: 14,
textAlign: 'center',
marginBottom: 20,
lineHeight: 20,
},
emptyButton: {
paddingHorizontal: 24,
paddingVertical: 12,
borderRadius: 12,
},
emptyButtonText: {
color: '#fff',
fontWeight: '600',
fontSize: 15,
},
});