-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
139 lines (134 loc) · 3.84 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React, { Component } from 'react';
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import { HomeScreen } from './src/HomeScreen';
import { StyleSheet, View, Text, StatusBar, Image } from 'react-native';
import { CreateProjectScreen } from './src/CreateProjectScreen';
import { AllTask } from './src/AllTask';
import PushNotification from 'react-native-push-notification';
import { ProjectDetail } from './src/ProjectDetail';
import { CreateTaskScreen } from './src/CreateTaskScreen';
import { createDrawerNavigator, DrawerSidebar } from 'react-navigation-drawer';
import { Panel } from './src/Panel';
import { HeadBar } from './src/Headbar';
import LottieView from 'lottie-react-native';
import { Archive } from './src/Archive';
class App extends Component {
constructor(props) {
super(props);
this.state = {
isLoading: true,
};
let oldRender = Text.render;
Text.render = function (...args) {
let origin = oldRender.call(this, ...args);
return React.cloneElement(origin, {
style: [{ fontFamily: 'Vazir-FD' }, origin.props.style],
});
};
}
toggleDrawer = () => {
this.props.navigationProps.toggleDrawer();
};
render() {
if (this.state.isLoading) {
return (
<View style={{ flex: 1}}>
<StatusBar hidden />
<View
style={{
flex: 1,
paddingTop: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#01579B',
}}>
<Image
style={{ width: '50%', height: '30%' }}
source={require('./assets/img/logo3.png')}
/>{' '}
<Text style={{ fontSize: 30, color: 'white' }}> دست یار </Text>{' '}
<LottieView
source={require('./assets/animation/loading5.json')}
autoPlay
duration={4000}
loop={false}
style={{ width: 400, marginTop: -50 }}
onAnimationFinish={() => this.setState({ isLoading: false })}
/>{' '}
</View>{' '}
</View>
);
}
return <AppContainer> </AppContainer>;
}
}
const Home_stack = createStackNavigator({
Home: {
screen: HomeScreen,
navigationOptions: ({ navigation }) => ({
header: <HeadBar navigationProps={navigation} pageName="داشبورد" />,
}),
},
projectDetail: ProjectDetail,
createProject: CreateProjectScreen,
createTask: CreateTaskScreen,
});
const Alltask_stack = createStackNavigator({
AllTask: {
screen: AllTask,
navigationOptions: ({ navigation }) => ({
header: <HeadBar navigationProps={navigation} pageName="فعالیت ها" />,
}),
},
});
const Archive_stack = createStackNavigator({
Archive: {
screen: Archive,
navigationOptions: ({ navigation }) => ({
header: <HeadBar navigationProps={navigation} pageName="بایگانی" />,
}),
},
});
// const TaskOption_Stack = createStackNavigator({
// TaskOption: {
// screen: TaskOption,
// navigationOptions: ({navigation}) => ({
// header: (
// <HeadBar navigationProps={navigation} pageName="تنظیمات رویدادها" />
// ),
// }),
// },
// });
const DrawerNavigator = createDrawerNavigator(
{
//Drawer Optons and indexing
Home: {
screen: Home_stack,
},
Task: {
screen: Alltask_stack,
},
Archive: {
screen: Archive_stack,
},
// TaskOption: {
// screen: TaskOption_Stack,
// },
},
{
contentComponent: Panel,
drawerWidth: '70%',
drawerPosition: 'right',
drawerType: 'front',
},
);
const AppContainer = createAppContainer(DrawerNavigator);
export default App;