|
|
|
@ -16,6 +16,7 @@ import { |
|
|
|
|
import Order from "./components/Order"; |
|
|
|
|
import Navbar from "../../components/Navbar"; |
|
|
|
|
import Drawer from "../../components/Drawer"; |
|
|
|
|
import Empty from "../../components/Empty"; |
|
|
|
|
|
|
|
|
|
//assets
|
|
|
|
|
import b1Image from "./assets/b1.png"; |
|
|
|
@ -32,7 +33,7 @@ function OrdersFollowUp({ orders, getList }) { |
|
|
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
|
|
getList(); |
|
|
|
|
},[]); |
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<SafeAreaView |
|
|
|
@ -54,14 +55,22 @@ function OrdersFollowUp({ orders, getList }) { |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
<Drawer setBoxPosition={setBoxPosition} position={position} /> |
|
|
|
|
<ScrollView |
|
|
|
|
contentContainerStyle={styles.contentContainerStyle} |
|
|
|
|
style={styles.container} |
|
|
|
|
> |
|
|
|
|
{orders.map((order, index) => ( |
|
|
|
|
<Order order={order} key={index} /> |
|
|
|
|
))} |
|
|
|
|
</ScrollView> |
|
|
|
|
{orders?.length ? ( |
|
|
|
|
<ScrollView |
|
|
|
|
contentContainerStyle={styles.contentContainerStyle} |
|
|
|
|
style={styles.container} |
|
|
|
|
> |
|
|
|
|
{orders.map((order, index) => ( |
|
|
|
|
<Order order={order} key={index} /> |
|
|
|
|
))} |
|
|
|
|
</ScrollView> |
|
|
|
|
) : ( |
|
|
|
|
<Empty |
|
|
|
|
text="هیچ موردی برای شما وجود ندارد." |
|
|
|
|
buttonText={"رفتن به فروشگاه"} |
|
|
|
|
buttonAction={() => navigation.push("Products")} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
</SafeAreaView> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -79,12 +88,12 @@ const styles = StyleSheet.create({ |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const mapStateToProps = (state) => ({ |
|
|
|
|
orders: state.userFactor.fullList |
|
|
|
|
orders: state.userFactor.fullList, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = { |
|
|
|
|
getList: userFactor.fullList, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(OrdersFollowUp); |
|
|
|
|
|
|
|
|
|