|
|
@@ -6,8 +6,7 @@ import { StyleSheet } from "react-native";
|
|
|
import { useModel } from "flooks";
|
|
|
import NavHeaderBar from "../components/NavHeaderBar";
|
|
|
import OrderListScreen from "./OrderListScreen";
|
|
|
-import { Layout, Text } from "@ui-kitten/components";
|
|
|
-import LoadingNode from "../components/LoadingNode";
|
|
|
+import { Layout, Text, ButtonGroup, Button } from "@ui-kitten/components";
|
|
|
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
|
|
|
const Tab = createMaterialTopTabNavigator();
|
|
|
|
|
|
@@ -16,60 +15,76 @@ const labelText = (focused, title) => (
|
|
|
{title}
|
|
|
</Text>
|
|
|
);
|
|
|
+
|
|
|
export default function OrderScreen() {
|
|
|
- const { NOTRECEIVED, RECEIVED, REJECTED, COMPLETED, tab2 } = useModel(
|
|
|
- "wordsModel"
|
|
|
- );
|
|
|
+ const {
|
|
|
+ NOT_RECEIVED,
|
|
|
+ RECEIVED,
|
|
|
+ REJECTED,
|
|
|
+ COMPLETED,
|
|
|
+ tab2,
|
|
|
+ orderTitleBtn1,
|
|
|
+ orderTitleBtn2,
|
|
|
+ } = useModel("wordsModel");
|
|
|
return (
|
|
|
<>
|
|
|
- <NavHeaderBar title={tab2} />
|
|
|
- <Tab.Navigator
|
|
|
- initialRouteName='NOTRECEIVED'
|
|
|
- lazy={true}
|
|
|
- tabBarOptions={{
|
|
|
- activeTintColor: "#FFC21C",
|
|
|
- inactiveTintColor: "#000",
|
|
|
- style: styles.tabBack,
|
|
|
- indicatorStyle: styles.indicatorStyle,
|
|
|
- labelStyle: {
|
|
|
- zIndex: 2,
|
|
|
- },
|
|
|
- }}
|
|
|
- lazyPlaceholder={LoadingNode}
|
|
|
- >
|
|
|
- <Tab.Screen
|
|
|
- name='NOTRECEIVED'
|
|
|
- component={OrderListScreen}
|
|
|
- options={{
|
|
|
- tabBarLabel: ({ focused }) =>
|
|
|
- labelText(focused, NOTRECEIVED),
|
|
|
- }}
|
|
|
- />
|
|
|
- <Tab.Screen
|
|
|
- name='RECEIVED'
|
|
|
- component={OrderListScreen}
|
|
|
- options={{
|
|
|
- tabBarLabel: ({ focused }) =>
|
|
|
- labelText(focused, RECEIVED),
|
|
|
+ <Layout style={[styles.tabBack, { flex: 1 }]}>
|
|
|
+ <NavHeaderBar title={tab2} />
|
|
|
+ <ButtonGroup
|
|
|
+ appearance='outline'
|
|
|
+ style={styles.buttonGroup}
|
|
|
+ appearance='filled'
|
|
|
+ >
|
|
|
+ <Button>{orderTitleBtn1}</Button>
|
|
|
+ <Button>{orderTitleBtn2}</Button>
|
|
|
+ </ButtonGroup>
|
|
|
+ <Tab.Navigator
|
|
|
+ initialRouteName='NOTRECEIVED'
|
|
|
+ tabBarOptions={{
|
|
|
+ activeTintColor: "#FFC21C",
|
|
|
+ inactiveTintColor: "#000",
|
|
|
+ style: styles.tabBack,
|
|
|
+ indicatorStyle: styles.indicatorStyle,
|
|
|
+ labelStyle: {
|
|
|
+ zIndex: 2,
|
|
|
+ borderWidth: 0,
|
|
|
+ },
|
|
|
}}
|
|
|
- />
|
|
|
- <Tab.Screen
|
|
|
- name='COMPLETED'
|
|
|
- component={OrderListScreen}
|
|
|
- options={{
|
|
|
- tabBarLabel: ({ focused }) =>
|
|
|
- labelText(focused, COMPLETED),
|
|
|
- }}
|
|
|
- />
|
|
|
- <Tab.Screen
|
|
|
- name='REJECTED'
|
|
|
- component={OrderListScreen}
|
|
|
- options={{
|
|
|
- tabBarLabel: ({ focused }) =>
|
|
|
- labelText(focused, REJECTED),
|
|
|
- }}
|
|
|
- />
|
|
|
- </Tab.Navigator>
|
|
|
+ >
|
|
|
+ <Tab.Screen
|
|
|
+ name='NOTRECEIVED'
|
|
|
+ component={(props) => <OrderListScreen {...props} />}
|
|
|
+ options={{
|
|
|
+ tabBarLabel: ({ focused }) =>
|
|
|
+ labelText(focused, NOT_RECEIVED),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Tab.Screen
|
|
|
+ name='RECEIVED'
|
|
|
+ component={(props) => <OrderListScreen {...props} />}
|
|
|
+ options={{
|
|
|
+ tabBarLabel: ({ focused }) =>
|
|
|
+ labelText(focused, RECEIVED),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Tab.Screen
|
|
|
+ name='COMPLETED'
|
|
|
+ component={(props) => <OrderListScreen {...props} />}
|
|
|
+ options={{
|
|
|
+ tabBarLabel: ({ focused }) =>
|
|
|
+ labelText(focused, COMPLETED),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Tab.Screen
|
|
|
+ name='REJECTED'
|
|
|
+ component={(props) => <OrderListScreen {...props} />}
|
|
|
+ options={{
|
|
|
+ tabBarLabel: ({ focused }) =>
|
|
|
+ labelText(focused, REJECTED),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </Tab.Navigator>
|
|
|
+ </Layout>
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
|
@@ -77,8 +92,13 @@ export default function OrderScreen() {
|
|
|
const styles = StyleSheet.create({
|
|
|
tabBack: {
|
|
|
backgroundColor: "#eee",
|
|
|
+ borderWidth: 0,
|
|
|
},
|
|
|
indicatorStyle: {
|
|
|
backgroundColor: "#FFC21C",
|
|
|
},
|
|
|
+ buttonGroup: {
|
|
|
+ justifyContent: "center",
|
|
|
+ paddingVertical: 7,
|
|
|
+ },
|
|
|
});
|