added notification
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import reference_api from 'api/reference';
|
||||
import LayoutTwo from 'components/LayoutTwo';
|
||||
import * as React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -16,39 +18,38 @@ interface CargoPricesProps {}
|
||||
|
||||
const CargoPrices = (props: CargoPricesProps) => {
|
||||
const { t } = useTranslation();
|
||||
const [activeTab, setActiveTab] = React.useState<'avia' | 'auto'>('avia');
|
||||
const [activeTab, setActiveTab] = React.useState<'AVIA' | 'AUTO'>('AVIA');
|
||||
const navigation = useNavigation<NativeStackNavigationProp<any>>();
|
||||
|
||||
const { data, refetch } = useQuery({
|
||||
queryKey: ['reference_list'],
|
||||
queryFn: () => reference_api.getReference({ cargoType: activeTab }),
|
||||
});
|
||||
|
||||
React.useEffect(() => {
|
||||
refetch();
|
||||
}, [activeTab]);
|
||||
|
||||
return (
|
||||
<LayoutTwo title={t('Kargo narxlari')}>
|
||||
<ScrollView style={{ flex: 1 }}>
|
||||
<View style={styles.container}>
|
||||
<Tabs activeTab={activeTab} setActiveTab={setActiveTab} />
|
||||
{activeTab === 'avia' && (
|
||||
{activeTab === 'AVIA' && (
|
||||
<View style={{ marginTop: 10, gap: 10, marginBottom: 20 }}>
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>
|
||||
{t('Oddiy maxsulotlar')}
|
||||
</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
9.2$ /1kg
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.desc}>
|
||||
{t('(Katta miqdordagi yuklar kelishuv asosida)')}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>{t('Brend buyumlar')}</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
12.2$ /1kg
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.desc}>
|
||||
{t('(Karobka,dokumentlar bilan birga)')}
|
||||
</Text>
|
||||
</View>
|
||||
{data &&
|
||||
data.map(ref => (
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>{ref.title}</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
{ref.price}$/{ref.unitValue}
|
||||
{ref.unit}
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.desc}>{ref.shortDescription}</Text>
|
||||
</View>
|
||||
))}
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>
|
||||
@@ -127,34 +128,21 @@ const CargoPrices = (props: CargoPricesProps) => {
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)}
|
||||
{activeTab === 'auto' && (
|
||||
{activeTab === 'AUTO' && (
|
||||
<View style={{ marginTop: 20, gap: 10, marginBottom: 20 }}>
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>0-30 kg</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
7$ /1kg
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>30-100kg</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
6.5$ /1kg
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>
|
||||
100kg {t('dan boshlab')}
|
||||
</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
6$ /1kg
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
{data &&
|
||||
data.map(ref => (
|
||||
<View style={styles.cardWhite}>
|
||||
<View style={styles.priceCard}>
|
||||
<Text style={styles.titleBlack}>{ref.title}</Text>
|
||||
<Text style={[styles.titleBlack, { fontSize: 16 }]}>
|
||||
{ref.price}$/{ref.unitValue}
|
||||
{ref.unit}
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.desc}>{ref.shortDescription}</Text>
|
||||
</View>
|
||||
))}
|
||||
<View style={styles.cardWhite}>
|
||||
<Text style={styles.desc}>
|
||||
{t(
|
||||
|
||||
Reference in New Issue
Block a user