bug fix
This commit is contained in:
2
.env
2
.env
@@ -1 +1 @@
|
|||||||
API_URL=http://141.105.64.233:7723/api/v1
|
API_URL=https://api.cpcargo.uz/api/v1
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export const BASE_URL = 'http://141.105.64.233:7723/api/v1';
|
export const BASE_URL = 'https://api.cpcargo.uz/api/v1';
|
||||||
|
|
||||||
export const REGISTER = '/mobile/auth/register';
|
export const REGISTER = '/mobile/auth/register';
|
||||||
export const LOGIN = '/mobile/auth/login';
|
export const LOGIN = '/mobile/auth/login';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import axios, { AxiosError } from 'axios';
|
|||||||
import { navigate } from 'components/NavigationRef';
|
import { navigate } from 'components/NavigationRef';
|
||||||
|
|
||||||
const axiosInstance = axios.create({
|
const axiosInstance = axios.create({
|
||||||
baseURL: 'http://141.105.64.233:7723/api/v1',
|
baseURL: 'https://api.cpcargo.uz/api/v1',
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
|||||||
@@ -94,13 +94,13 @@ const styles = StyleSheet.create({
|
|||||||
wrapper: {
|
wrapper: {
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: 60,
|
height: 70,
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
borderTopLeftRadius: 30,
|
borderTopLeftRadius: 20,
|
||||||
borderTopRightRadius: 30,
|
borderTopRightRadius: 20,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
shadowColor: '#000',
|
shadowColor: '#000',
|
||||||
shadowOpacity: 0.1,
|
shadowOpacity: 0.1,
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
import { Dispatch, SetStateAction, useCallback, useMemo } from 'react';
|
import { Dispatch, SetStateAction, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
import { Image, Text, TouchableOpacity, View } from 'react-native';
|
||||||
FlatList,
|
|
||||||
Image,
|
|
||||||
Text,
|
|
||||||
TouchableOpacity,
|
|
||||||
useWindowDimensions,
|
|
||||||
} from 'react-native';
|
|
||||||
import LinearGradient from 'react-native-linear-gradient';
|
import LinearGradient from 'react-native-linear-gradient';
|
||||||
import AviaLogo from 'screens/../../assets/bootsplash/Avia.png';
|
import AviaLogo from 'screens/../../assets/bootsplash/Avia.png';
|
||||||
import AutoLogo from 'screens/../../assets/bootsplash/auto.png';
|
import AutoLogo from 'screens/../../assets/bootsplash/auto.png';
|
||||||
@@ -19,8 +13,6 @@ interface Props {
|
|||||||
|
|
||||||
const Tabs = ({ activeTab, setActiveTab }: Props) => {
|
const Tabs = ({ activeTab, setActiveTab }: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { width: screenWidth } = useWindowDimensions();
|
|
||||||
const cardWidth = screenWidth * 0.95;
|
|
||||||
const styles = useMemo(() => HomeStyle(), []);
|
const styles = useMemo(() => HomeStyle(), []);
|
||||||
|
|
||||||
const gradientStyle = useMemo(
|
const gradientStyle = useMemo(
|
||||||
@@ -29,9 +21,7 @@ const Tabs = ({ activeTab, setActiveTab }: Props) => {
|
|||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
flexDirection: 'row' as const,
|
flexDirection: 'row' as const,
|
||||||
alignItems: 'center' as const,
|
alignItems: 'center' as const,
|
||||||
paddingHorizontal: 12,
|
|
||||||
height: 80,
|
height: 80,
|
||||||
gap: 8,
|
|
||||||
}),
|
}),
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
@@ -53,8 +43,9 @@ const Tabs = ({ activeTab, setActiveTab }: Props) => {
|
|||||||
[t],
|
[t],
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderItem = useCallback(
|
return (
|
||||||
({ item }: { item: (typeof tabsData)[number] }) => {
|
<View style={{ flexDirection: 'row', paddingHorizontal: 10, gap: 12 }}>
|
||||||
|
{tabsData.map(item => {
|
||||||
const isActive = activeTab === item.type;
|
const isActive = activeTab === item.type;
|
||||||
const gradientColors = isActive
|
const gradientColors = isActive
|
||||||
? ['#28A7E8', '#28A7E8']
|
? ['#28A7E8', '#28A7E8']
|
||||||
@@ -80,30 +71,27 @@ const Tabs = ({ activeTab, setActiveTab }: Props) => {
|
|||||||
</LinearGradient>
|
</LinearGradient>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
);
|
);
|
||||||
},
|
|
||||||
[activeTab, styles, gradientStyle, setActiveTab],
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FlatList
|
|
||||||
data={tabsData}
|
|
||||||
numColumns={2}
|
|
||||||
keyExtractor={(_, idx) => idx.toString()}
|
|
||||||
renderItem={renderItem}
|
|
||||||
showsHorizontalScrollIndicator={false}
|
|
||||||
scrollEnabled={false}
|
|
||||||
columnWrapperStyle={{
|
|
||||||
gap: 8,
|
|
||||||
}}
|
|
||||||
contentContainerStyle={{
|
|
||||||
paddingHorizontal: (screenWidth - cardWidth) / 2,
|
|
||||||
}}
|
|
||||||
getItemLayout={(_, index) => ({
|
|
||||||
length: cardWidth,
|
|
||||||
offset: cardWidth * index,
|
|
||||||
index,
|
|
||||||
})}
|
})}
|
||||||
/>
|
</View>
|
||||||
|
// <FlatList
|
||||||
|
// data={tabsData}
|
||||||
|
// numColumns={2}
|
||||||
|
// keyExtractor={(_, idx) => idx.toString()}
|
||||||
|
// renderItem={renderItem}
|
||||||
|
// showsHorizontalScrollIndicator={false}
|
||||||
|
// scrollEnabled={false}
|
||||||
|
// columnWrapperStyle={{
|
||||||
|
// gap: 8,
|
||||||
|
// }}
|
||||||
|
// contentContainerStyle={{
|
||||||
|
// paddingHorizontal: (screenWidth - cardWidth) / 2,
|
||||||
|
// }}
|
||||||
|
// getItemLayout={(_, index) => ({
|
||||||
|
// length: cardWidth,
|
||||||
|
// offset: cardWidth * index,
|
||||||
|
// index,
|
||||||
|
// })}
|
||||||
|
// />
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user