You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.7 KiB
104 lines
2.7 KiB
import { |
|
View, |
|
Text, |
|
SafeAreaView, |
|
ScrollView, |
|
StyleSheet, |
|
StatusBar, |
|
Platform, |
|
Dimensions, |
|
} from "react-native"; |
|
import React from "react"; |
|
import { connect } from "react-redux"; |
|
import { userFactor, userAddress } from "../../redux/actions"; |
|
import { useNavigation } from "@react-navigation/native"; |
|
|
|
//components |
|
import Navbar from "../../components/Navbar"; |
|
import TransportMethod from "./PaymentMethod"; |
|
import TransportDate from "./TransportDate"; |
|
// import PaymentMethod from "./PaymentMethod"; |
|
import Address from "./Address"; |
|
|
|
//style |
|
import tw from "tailwind-rn"; |
|
|
|
const DeliveryForm = ({ list }) => { |
|
const navigation = useNavigation(); |
|
return ( |
|
<SafeAreaView |
|
style={{ |
|
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0, |
|
position: "relative", |
|
}} |
|
> |
|
<Navbar |
|
setBoxPosition={setBoxPosition} |
|
headerOptions={{ |
|
logo: false, |
|
menu: true, |
|
hamburgerMenu: false, |
|
title: "", |
|
bookmark: true, |
|
qr: false, |
|
back: true, |
|
}} |
|
/> |
|
<ScrollView |
|
contentContainerStyle={styles.contentContainerStyle} |
|
style={styles.container} |
|
> |
|
<View style={tw("w-full flex flex-col pt-4 pb-4")}> |
|
<View style={tw("w-full flex flex-row gap-5")}> |
|
<Address addresses={list} /> |
|
</View> |
|
<View style={tw("w-full flex flex-row gap-5 mt-8")}> |
|
<TransportMethod /> |
|
</View> |
|
<View style={tw("w-full flex flex-row gap-5 mt-8")}> |
|
<TransportDate transportDate={form.transportDate} /> |
|
</View> |
|
<View |
|
style={[ |
|
tw("flex justify-between items-center py-3 px-4 w-full"), |
|
{ backgroundColor: "#061B30" }, |
|
]} |
|
> |
|
<Text style={tw("")}>تکمیل اطلاعات</Text> |
|
{/* <Image |
|
source={{ uri: isDark ? arrowWhiteIcon : arrowBlueIcon }} |
|
style={tw(`w-6`)} |
|
onPress={() => navigation.goBack()} |
|
/> */} |
|
</View> |
|
</View> |
|
</ScrollView> |
|
</SafeAreaView> |
|
); |
|
}; |
|
|
|
const styles = StyleSheet.create({ |
|
contentContainerStyle: { |
|
paddingBottom: 100, |
|
}, |
|
container: { |
|
width: Dimensions.get("window").width, |
|
backgroundColor: "white", |
|
flexDirection: "column", |
|
paddingVertical: 5, |
|
paddingHorizontal: 16, |
|
}, |
|
}); |
|
|
|
const mapStateToProps = (state) => ({ |
|
factorInfo: state.userFactor.info, |
|
userId: state.user.status?.id, |
|
list: state.userAddress.list, |
|
}); |
|
|
|
const mapDispatchToProps = { |
|
getFactorInfo: userFactor.info, |
|
getList: userAddress.list, |
|
}; |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(DeliveryForm);
|
|
|