|
|
@ -8,7 +8,7 @@ import { |
|
|
|
} from "react-native"; |
|
|
|
} from "react-native"; |
|
|
|
import React from "react"; |
|
|
|
import React from "react"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import {asyncAwesomeAlert} from "../../../utils/AsyncWrappers"; |
|
|
|
import { asyncAwesomeAlert } from "../../../utils/AsyncWrappers"; |
|
|
|
import { Ionicons, Entypo } from "@expo/vector-icons"; |
|
|
|
import { Ionicons, Entypo } from "@expo/vector-icons"; |
|
|
|
import { useNavigation } from "@react-navigation/native"; |
|
|
|
import { useNavigation } from "@react-navigation/native"; |
|
|
|
import { userFactor, userAddress } from "../../../redux/actions"; |
|
|
|
import { userFactor, userAddress } from "../../../redux/actions"; |
|
|
@ -59,7 +59,7 @@ const Address = ({ |
|
|
|
borderColor: active ? Colors.theme1.greenCF : Colors.theme1.grayE3, |
|
|
|
borderColor: active ? Colors.theme1.greenCF : Colors.theme1.grayE3, |
|
|
|
}, |
|
|
|
}, |
|
|
|
tw( |
|
|
|
tw( |
|
|
|
`flex flex-row-reverse items-center w-full px-3 rounded-sm mt-2 ${ |
|
|
|
`flex flex-row-reverse items-center w-full px-3 rounded-sm mt-2 mb-4 ${ |
|
|
|
mobile ? "py-3.5" : "py-4" |
|
|
|
mobile ? "py-3.5" : "py-4" |
|
|
|
}` |
|
|
|
}` |
|
|
|
), |
|
|
|
), |
|
|
@ -134,7 +134,7 @@ const Address = ({ |
|
|
|
onConfirm: () => deleteItem({ id: address?.id }), |
|
|
|
onConfirm: () => deleteItem({ id: address?.id }), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
style={tw('h-full')} |
|
|
|
style={tw("h-full")} |
|
|
|
> |
|
|
|
> |
|
|
|
<Ionicons |
|
|
|
<Ionicons |
|
|
|
name="trash-bin" |
|
|
|
name="trash-bin" |
|
|
@ -156,6 +156,7 @@ const Address = ({ |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View style={tw("w-full mt-2")}> |
|
|
|
<View style={tw("w-full mt-2")}> |
|
|
|
{addresses?.length ? ( |
|
|
|
{addresses?.length ? ( |
|
|
|
|
|
|
|
<React.Fragment> |
|
|
|
<Text |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
fontSize: mobile ? fontSize.base : fontSize.base, |
|
|
|
fontSize: mobile ? fontSize.base : fontSize.base, |
|
|
@ -166,7 +167,6 @@ const Address = ({ |
|
|
|
> |
|
|
|
> |
|
|
|
لطفا آدرس مورد نظر را انتخاب کنید. |
|
|
|
لطفا آدرس مورد نظر را انتخاب کنید. |
|
|
|
</Text> |
|
|
|
</Text> |
|
|
|
) : null} |
|
|
|
|
|
|
|
<View style={tw("p-0 mt-2 flex")}> |
|
|
|
<View style={tw("p-0 mt-2 flex")}> |
|
|
|
{addresses?.map((address, index) => ( |
|
|
|
{addresses?.map((address, index) => ( |
|
|
|
<Location |
|
|
|
<Location |
|
|
@ -176,6 +176,9 @@ const Address = ({ |
|
|
|
/> |
|
|
|
/> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
|
|
|
|
</React.Fragment> |
|
|
|
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
|
|
<TouchableOpacity |
|
|
|
<TouchableOpacity |
|
|
|
style={[ |
|
|
|
style={[ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -186,7 +189,7 @@ const Address = ({ |
|
|
|
borderWidth: 1.5, |
|
|
|
borderWidth: 1.5, |
|
|
|
}, |
|
|
|
}, |
|
|
|
tw( |
|
|
|
tw( |
|
|
|
`flex flex-row-reverse justify-center py-3 rounded-sm items-center w-full mt-4` |
|
|
|
`flex flex-row-reverse justify-center py-3 rounded-sm items-center w-full` |
|
|
|
), |
|
|
|
), |
|
|
|
]} |
|
|
|
]} |
|
|
|
onPress={() => navigation.push("CreateAddress")} |
|
|
|
onPress={() => navigation.push("CreateAddress")} |
|
|
@ -224,7 +227,7 @@ const mapStateToProps = (state) => ({ |
|
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
const mapDispatchToProps = { |
|
|
|
update: userFactor.update, |
|
|
|
update: userFactor.update, |
|
|
|
deleteItem: userAddress.update |
|
|
|
deleteItem: userAddress.update, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Address); |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Address); |
|
|
|