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