|
|
@ -3,8 +3,6 @@ import { |
|
|
|
Text, |
|
|
|
Text, |
|
|
|
Pressable, |
|
|
|
Pressable, |
|
|
|
TouchableOpacity, |
|
|
|
TouchableOpacity, |
|
|
|
Appearance, |
|
|
|
|
|
|
|
ActivityIndicator, |
|
|
|
|
|
|
|
SafeAreaView, |
|
|
|
SafeAreaView, |
|
|
|
ScrollView, |
|
|
|
ScrollView, |
|
|
|
StyleSheet, |
|
|
|
StyleSheet, |
|
|
@ -28,7 +26,6 @@ import tw from "tailwind-rn"; |
|
|
|
import Colors from "../../../../constants/Colors"; |
|
|
|
import Colors from "../../../../constants/Colors"; |
|
|
|
import fontSize from "../../../../constants/fontSize"; |
|
|
|
import fontSize from "../../../../constants/fontSize"; |
|
|
|
|
|
|
|
|
|
|
|
const { height, width } = Dimensions.get("window"); |
|
|
|
|
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
|
|
|
|
|
|
|
|
const ProfileAddress = ({ |
|
|
|
const ProfileAddress = ({ |
|
|
@ -38,11 +35,9 @@ const ProfileAddress = ({ |
|
|
|
userId, |
|
|
|
userId, |
|
|
|
userAddressId, |
|
|
|
userAddressId, |
|
|
|
getFactorInfo, |
|
|
|
getFactorInfo, |
|
|
|
loading, |
|
|
|
|
|
|
|
closeBottomSheet, |
|
|
|
|
|
|
|
mobile, |
|
|
|
mobile, |
|
|
|
|
|
|
|
theme |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const colorScheme = Appearance.getColorScheme(); |
|
|
|
|
|
|
|
const navigation = useNavigation(); |
|
|
|
const navigation = useNavigation(); |
|
|
|
const [height, setHeight] = React.useState(Dimensions.get("window").height); |
|
|
|
const [height, setHeight] = React.useState(Dimensions.get("window").height); |
|
|
|
const Location = ({ address, active }) => { |
|
|
|
const Location = ({ address, active }) => { |
|
|
@ -52,13 +47,13 @@ const ProfileAddress = ({ |
|
|
|
{ |
|
|
|
{ |
|
|
|
backgroundColor: |
|
|
|
backgroundColor: |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
|
? Colors.theme1[colorScheme].greenCF + "0a" |
|
|
|
? Colors.theme1[theme].greenCF + "0a" |
|
|
|
: Colors.theme1[colorScheme].grayE3 + "44", |
|
|
|
: Colors.theme1[theme].grayE3 + "44", |
|
|
|
borderWidth: 2, |
|
|
|
borderWidth: 2, |
|
|
|
borderColor: |
|
|
|
borderColor: |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
|
? Colors.theme1[colorScheme].greenCF + "aa" |
|
|
|
? Colors.theme1[theme].greenCF + "aa" |
|
|
|
: Colors.theme1[colorScheme].grayE3, |
|
|
|
: Colors.theme1[theme].grayE3, |
|
|
|
}, |
|
|
|
}, |
|
|
|
tw( |
|
|
|
tw( |
|
|
|
`flex flex-row-reverse items-center w-full px-3 py-2 rounded-md mt-2` |
|
|
|
`flex flex-row-reverse items-center w-full px-3 py-2 rounded-md mt-2` |
|
|
@ -80,7 +75,7 @@ const ProfileAddress = ({ |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.base, |
|
|
|
fontSize: fontSize.base, |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
color: Colors.theme1[colorScheme].gray20, |
|
|
|
color: Colors.theme1[theme].gray20, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
آدرس انتخابی شما |
|
|
|
آدرس انتخابی شما |
|
|
@ -89,7 +84,7 @@ const ProfileAddress = ({ |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.xs, |
|
|
|
fontSize: fontSize.xs, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
color: Colors.theme1[colorScheme].gray20, |
|
|
|
color: Colors.theme1[theme].gray20, |
|
|
|
marginRight: 10, |
|
|
|
marginRight: 10, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -164,7 +159,7 @@ const ProfileAddress = ({ |
|
|
|
{!active && ( |
|
|
|
{!active && ( |
|
|
|
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}> |
|
|
|
<Svg xmlns="http://www.w3.org/2000/svg" width={24} height={24}> |
|
|
|
<G |
|
|
|
<G |
|
|
|
fill={Colors.theme1[colorScheme].gray20} |
|
|
|
fill={Colors.theme1[theme].gray20} |
|
|
|
data-name="vuesax/linear/more" |
|
|
|
data-name="vuesax/linear/more" |
|
|
|
> |
|
|
|
> |
|
|
|
<Path d="M10 19a2 2 0 1 0 2-2 2.006 2.006 0 0 0-2 2Z" /> |
|
|
|
<Path d="M10 19a2 2 0 1 0 2-2 2.006 2.006 0 0 0-2 2Z" /> |
|
|
@ -181,8 +176,8 @@ const ProfileAddress = ({ |
|
|
|
title={"مشاهده روی نقشه"} |
|
|
|
title={"مشاهده روی نقشه"} |
|
|
|
backgroundColor={ |
|
|
|
backgroundColor={ |
|
|
|
active |
|
|
|
active |
|
|
|
? Colors.theme1[colorScheme].greenCF |
|
|
|
? Colors.theme1[theme].greenCF |
|
|
|
: Colors.theme1[colorScheme].gray20 + "66" |
|
|
|
: Colors.theme1[theme].gray20 + "66" |
|
|
|
} |
|
|
|
} |
|
|
|
color={"white"} |
|
|
|
color={"white"} |
|
|
|
border={{ color: "#196EC0", width: 0 }} |
|
|
|
border={{ color: "#196EC0", width: 0 }} |
|
|
@ -245,8 +240,8 @@ const ProfileAddress = ({ |
|
|
|
<TouchableOpacity |
|
|
|
<TouchableOpacity |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
{ |
|
|
|
{ |
|
|
|
backgroundColor: Colors.theme1[colorScheme].greenCF + "05", |
|
|
|
backgroundColor: Colors.theme1[theme].greenCF + "05", |
|
|
|
borderColor: Colors.theme1[colorScheme].greenCF, |
|
|
|
borderColor: Colors.theme1[theme].greenCF, |
|
|
|
borderWidth: 1.5, |
|
|
|
borderWidth: 1.5, |
|
|
|
}, |
|
|
|
}, |
|
|
|
tw( |
|
|
|
tw( |
|
|
@ -259,7 +254,7 @@ const ProfileAddress = ({ |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
fontSize: fontSize.tiny, |
|
|
|
fontSize: fontSize.tiny, |
|
|
|
color: Colors.theme1[colorScheme].greenCF, |
|
|
|
color: Colors.theme1[theme].greenCF, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
یک آدرس جدید اضافه کنید |
|
|
|
یک آدرس جدید اضافه کنید |
|
|
@ -269,7 +264,7 @@ const ProfileAddress = ({ |
|
|
|
marginTop: 3, |
|
|
|
marginTop: 3, |
|
|
|
marginRight: 5, |
|
|
|
marginRight: 5, |
|
|
|
fontSize: fontSize.xl3, |
|
|
|
fontSize: fontSize.xl3, |
|
|
|
color: Colors.theme1[colorScheme].greenCF, |
|
|
|
color: Colors.theme1[theme].greenCF, |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -287,6 +282,7 @@ const mapStateToProps = (state) => ({ |
|
|
|
loading: state.userFactor.loading, |
|
|
|
loading: state.userFactor.loading, |
|
|
|
addresses: state.userAddress.list, |
|
|
|
addresses: state.userAddress.list, |
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
mobile: state.publicApi.mobile, |
|
|
|
|
|
|
|
theme: state.publicApi.theme |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
const mapDispatchToProps = { |
|
|
|