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.
 
 
 
 
 

100 lines
2.3 KiB

import React, { useState } from "react";
import {
Dimensions,
StyleSheet,
ScrollView,
SafeAreaView,
StatusBar,
Platform,
LayoutAnimation,
} from "react-native";
import Order from "./components/Order";
import Navbar from "../../components/Navbar";
import Drawer from "../../components/Drawer";
import b1Image from "./assets/b1.png";
const width = Dimensions.get("window").width;
function OrdersFollowUp({ orders }) {
const [position, setPosition] = useState("100%");
const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setPosition(position === "100%" ? "0%" : "100%");
};
return (
<SafeAreaView
style={{
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
position: "relative",
}}
>
<Navbar
setBoxPosition={setBoxPosition}
headerOptions={{
logo: false,
menu: false,
hamburgerMenu: false,
title: "سفارشات",
bookmark: false,
qr: false,
back: true,
}}
/>
<Drawer setBoxPosition={setBoxPosition} position={position} />
<ScrollView
contentContainerStyle={styles.contentContainerStyle}
style={styles.container}
>
{orders.map((order, index) => (
<Order order={order} key={index} />
))}
</ScrollView>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
contentContainerStyle: {
paddingBottom: 100,
alignItems: "flex-end",
},
container: {
width: width,
backgroundColor: "white",
flexDirection: "column",
paddingVertical: 5,
paddingHorizontal: 10,
},
});
export default OrdersFollowUp;
OrdersFollowUp.defaultProps = {
orders: [
{
number: "535353523653",
receiveCode: "300031",
status: 2,
items: [b1Image, b1Image, b1Image, b1Image],
date: "1400/1/12",
cost: "1.240.000",
},
{
number: "535353523653",
receiveCode: "300031",
status: 3,
items: [b1Image, b1Image, b1Image],
date: "1400/1/12",
cost: "1.240.000",
},
{
number: "535353523653",
receiveCode: "300031",
status: 4,
items: [b1Image, b1Image, b1Image],
date: "1400/1/12",
cost: "1.240.000",
},
],
};