|
|
@ -29,6 +29,7 @@ import Colors from "../../../../constants/Colors"; |
|
|
|
import fontSize from "../../../../constants/fontSize"; |
|
|
|
import fontSize from "../../../../constants/fontSize"; |
|
|
|
|
|
|
|
|
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
const ios = Platform.OS === "ios"; |
|
|
|
|
|
|
|
const { height, width } = Dimensions.get("window"); |
|
|
|
|
|
|
|
|
|
|
|
const ProfileAddress = ({ |
|
|
|
const ProfileAddress = ({ |
|
|
|
addresses, |
|
|
|
addresses, |
|
|
@ -43,7 +44,7 @@ const ProfileAddress = ({ |
|
|
|
deleteItem, |
|
|
|
deleteItem, |
|
|
|
}) => { |
|
|
|
}) => { |
|
|
|
const navigation = useNavigation(); |
|
|
|
const navigation = useNavigation(); |
|
|
|
const [height, setHeight] = React.useState(Dimensions.get("window").height); |
|
|
|
const [height, setHeight] = React.useState(height); |
|
|
|
const Location = ({ address, active }) => { |
|
|
|
const Location = ({ address, active }) => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Pressable |
|
|
|
<Pressable |
|
|
@ -51,8 +52,12 @@ const ProfileAddress = ({ |
|
|
|
{ |
|
|
|
{ |
|
|
|
backgroundColor: |
|
|
|
backgroundColor: |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
|
? Colors.theme1.greenCF + "0a" |
|
|
|
? theme === "light" |
|
|
|
: Colors.theme1.grayE3 + "44", |
|
|
|
? Colors.theme1.greenCF + "0a" |
|
|
|
|
|
|
|
: Colors.theme1.dark |
|
|
|
|
|
|
|
: theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.grayE3 + "44" |
|
|
|
|
|
|
|
: Colors.theme1.dark, |
|
|
|
borderWidth: 2, |
|
|
|
borderWidth: 2, |
|
|
|
borderColor: |
|
|
|
borderColor: |
|
|
|
userAddressId === address?.id |
|
|
|
userAddressId === address?.id |
|
|
@ -60,7 +65,7 @@ const ProfileAddress = ({ |
|
|
|
: Colors.theme1.grayE3, |
|
|
|
: Colors.theme1.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 mb-4` |
|
|
|
), |
|
|
|
), |
|
|
|
]} |
|
|
|
]} |
|
|
|
onPress={() => |
|
|
|
onPress={() => |
|
|
@ -79,7 +84,12 @@ const ProfileAddress = ({ |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.base, |
|
|
|
fontSize: fontSize.base, |
|
|
|
fontFamily: "bold", |
|
|
|
fontFamily: "bold", |
|
|
|
color: Colors.theme1.gray20, |
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
آدرس انتخابی شما |
|
|
|
آدرس انتخابی شما |
|
|
@ -88,7 +98,12 @@ const ProfileAddress = ({ |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: fontSize.xs, |
|
|
|
fontSize: fontSize.xs, |
|
|
|
fontFamily: "regular", |
|
|
|
fontFamily: "regular", |
|
|
|
color: Colors.theme1.gray20, |
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
marginRight: 10, |
|
|
|
marginRight: 10, |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -100,7 +115,13 @@ const ProfileAddress = ({ |
|
|
|
<Ionicons |
|
|
|
<Ionicons |
|
|
|
name="ios-pencil-sharp" |
|
|
|
name="ios-pencil-sharp" |
|
|
|
size={20} |
|
|
|
size={20} |
|
|
|
color={theme === "light" ? "#52796F" : Colors.theme1.white} |
|
|
|
color={ |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? "#52796F" |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white |
|
|
|
|
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Pressable> |
|
|
|
</Pressable> |
|
|
|
<Pressable |
|
|
|
<Pressable |
|
|
@ -116,7 +137,13 @@ const ProfileAddress = ({ |
|
|
|
<Ionicons |
|
|
|
<Ionicons |
|
|
|
name="trash-bin" |
|
|
|
name="trash-bin" |
|
|
|
size={20} |
|
|
|
size={20} |
|
|
|
color={theme === "light" ? "#52796F" : Colors.theme1.white} |
|
|
|
color={ |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? "#52796F" |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white |
|
|
|
|
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Pressable> |
|
|
|
</Pressable> |
|
|
|
</View> |
|
|
|
</View> |
|
|
@ -131,6 +158,12 @@ const ProfileAddress = ({ |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
lineHeight: 22, |
|
|
|
lineHeight: 22, |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
@ -144,6 +177,12 @@ const ProfileAddress = ({ |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
lineHeight: 22, |
|
|
|
lineHeight: 22, |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
@ -157,6 +196,12 @@ const ProfileAddress = ({ |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
lineHeight: 22, |
|
|
|
lineHeight: 22, |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
@ -170,6 +215,12 @@ const ProfileAddress = ({ |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
fontSize: mobile ? fontSize.sm : fontSize.lg, |
|
|
|
lineHeight: 22, |
|
|
|
lineHeight: 22, |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
textAlign: ios ? "right" : "auto", |
|
|
|
|
|
|
|
color: |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? Colors.theme1.gray20 |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white, |
|
|
|
}, |
|
|
|
}, |
|
|
|
]} |
|
|
|
]} |
|
|
|
> |
|
|
|
> |
|
|
@ -182,7 +233,13 @@ const ProfileAddress = ({ |
|
|
|
<Ionicons |
|
|
|
<Ionicons |
|
|
|
name="ios-pencil-sharp" |
|
|
|
name="ios-pencil-sharp" |
|
|
|
size={20} |
|
|
|
size={20} |
|
|
|
color={theme === "light" ? "#52796F" : Colors.theme1.white} |
|
|
|
color={ |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? "#52796F" |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white |
|
|
|
|
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Pressable> |
|
|
|
</Pressable> |
|
|
|
<Pressable |
|
|
|
<Pressable |
|
|
@ -198,7 +255,13 @@ const ProfileAddress = ({ |
|
|
|
<Ionicons |
|
|
|
<Ionicons |
|
|
|
name="trash-bin" |
|
|
|
name="trash-bin" |
|
|
|
size={20} |
|
|
|
size={20} |
|
|
|
color={theme === "light" ? "#52796F" : Colors.theme1.white} |
|
|
|
color={ |
|
|
|
|
|
|
|
theme === "light" |
|
|
|
|
|
|
|
? "#52796F" |
|
|
|
|
|
|
|
: active |
|
|
|
|
|
|
|
? Colors.theme1.greenCF |
|
|
|
|
|
|
|
: Colors.theme1.white |
|
|
|
|
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Pressable> |
|
|
|
</Pressable> |
|
|
|
</View> |
|
|
|
</View> |
|
|
@ -328,7 +391,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(ProfileAddress); |
|
|
|
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
|
const styles = StyleSheet.create({ |
|
|
|
contentContainerStyle: { |
|
|
|
contentContainerStyle: { |
|
|
|
paddingBottom: 100, |
|
|
|
paddingBottom: height, |
|
|
|
position: "relative", |
|
|
|
position: "relative", |
|
|
|
}, |
|
|
|
}, |
|
|
|
container: { |
|
|
|
container: { |
|
|
|