2023-04-21 06:23:36 +00:00
|
|
|
/* eslint-disable prettier/prettier */
|
2019-06-16 13:09:54 +00:00
|
|
|
/**
|
|
|
|
* Sample React Native App
|
|
|
|
* https://github.com/facebook/react-native
|
|
|
|
*
|
|
|
|
* @format
|
|
|
|
* @flow
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import {Platform, StyleSheet, Text, View} from 'react-native';
|
2021-02-25 18:47:49 +00:00
|
|
|
import {
|
|
|
|
createSwitchNavigator,
|
|
|
|
createStackNavigator,
|
|
|
|
createDrawerNavigator,
|
|
|
|
createAppContainer,
|
2023-04-21 06:23:36 +00:00
|
|
|
createBottomTabNavigator,
|
2021-02-25 18:47:49 +00:00
|
|
|
} from 'react-navigation';
|
2023-04-21 06:23:36 +00:00
|
|
|
import Connect from './screens/login/Connect';
|
|
|
|
import SplashScreen from './screens/splashscreen/SplashScreen';
|
|
|
|
import HelpMenu from './screens/help/HelpMenu';
|
|
|
|
import Help from './screens/help/Help';
|
|
|
|
import ForgottenPassword from './screens/login/ForgottenPassword';
|
|
|
|
import TypeChoiser from './screens/login/TypeChoiser';
|
|
|
|
import CreateUserStep2 from './screens/login/createUserStep2';
|
|
|
|
import createAccount from './screens/login/createAccount';
|
|
|
|
import UpdateInformations from './screens/account/UpdateInformations';
|
|
|
|
import UserAccount from './screens/account/UserAccount';
|
|
|
|
import ActivateAccount from './screens/login/ActivateAccount';
|
|
|
|
import Notifications from './screens/notifications/Notifications';
|
|
|
|
import About from './screens/configurations/About';
|
|
|
|
import Configurations from './screens/configurations/Configurations';
|
2019-06-16 13:09:54 +00:00
|
|
|
|
2023-04-21 06:23:36 +00:00
|
|
|
import History from './screens/history-request/History';
|
|
|
|
import OptionsMenu from './screens/optionMenu/OptionsMenu';
|
|
|
|
import Home from './screens/home/Home';
|
|
|
|
import HistoryItemDetails from './screens/history-request/HistoryItemDetails';
|
|
|
|
import SuperViseurGroupeHome from './screens/groupes/SuperViseurGroupeHome';
|
|
|
|
import HistoryRequester from './screens/history-request/HistoryRequester';
|
|
|
|
import AddNetwork from './screens/account/AddNetwork';
|
|
|
|
import MyHistory from './screens/history-request/MyHistory';
|
|
|
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
2021-02-25 18:47:49 +00:00
|
|
|
import {GoogleAnalyticsTracker} from 'react-native-google-analytics-bridge';
|
|
|
|
import {Appbar} from 'react-native-paper';
|
2019-06-16 13:09:54 +00:00
|
|
|
|
2023-04-21 06:23:36 +00:00
|
|
|
import IconWithBadge from './screens/IconWithBadge';
|
|
|
|
import I18n from 'react-native-i18n';
|
2019-06-16 13:09:54 +00:00
|
|
|
import Filter from './screens/home/Filter';
|
2021-02-25 18:47:49 +00:00
|
|
|
import {createMaterialBottomTabNavigator} from 'react-navigation-material-bottom-tabs';
|
2019-06-16 13:09:54 +00:00
|
|
|
import Networks from './screens/home/Networks';
|
2021-02-25 18:47:49 +00:00
|
|
|
|
2019-06-16 13:09:54 +00:00
|
|
|
const instructions = Platform.select({
|
2021-02-25 18:47:49 +00:00
|
|
|
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
|
|
|
android:
|
|
|
|
'Double tap R on your keyboard to reload,\n' +
|
|
|
|
'Shake or press menu button for dev menu',
|
2019-06-16 13:09:54 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
type Props = {};
|
2023-04-21 06:23:36 +00:00
|
|
|
const theme = require('./utils/theme');
|
2021-02-25 18:47:49 +00:00
|
|
|
|
2019-06-16 13:09:54 +00:00
|
|
|
class HomeScreen extends Component<Props> {
|
2021-02-25 18:47:49 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<View style={styles.container}>
|
|
|
|
<Text style={styles.welcome}>Welcome to iLink World!</Text>
|
|
|
|
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
|
|
|
<Text style={styles.instructions}>{instructions}</Text>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
}
|
2019-06-16 13:09:54 +00:00
|
|
|
}
|
2021-02-25 18:47:49 +00:00
|
|
|
|
|
|
|
const AuthStack = createStackNavigator({
|
|
|
|
login: Connect,
|
|
|
|
helpMenu: HelpMenu,
|
|
|
|
help: Help,
|
|
|
|
forgottenpass: ForgottenPassword,
|
|
|
|
typeaccountcreate: TypeChoiser,
|
|
|
|
simpleusercreate: createAccount,
|
|
|
|
step2: CreateUserStep2,
|
2023-04-21 06:23:36 +00:00
|
|
|
activateaccout: ActivateAccount,
|
2021-02-25 18:47:49 +00:00
|
|
|
|
|
|
|
}, {
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none',
|
|
|
|
});
|
2021-02-25 18:47:49 +00:00
|
|
|
const AppStack = createDrawerNavigator({
|
|
|
|
sta: createStackNavigator({
|
|
|
|
home: Home,
|
|
|
|
/* filtre:Filter,
|
|
|
|
network:Networks,*/
|
|
|
|
useraccount: {
|
|
|
|
screen: UserAccount,
|
|
|
|
navigationOptions: {},
|
2019-06-16 13:09:54 +00:00
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
notificationview: Notifications,
|
|
|
|
configuration: Configurations,
|
2023-04-21 06:23:36 +00:00
|
|
|
about: About,
|
2021-02-25 18:47:49 +00:00
|
|
|
|
2023-04-21 06:23:36 +00:00
|
|
|
}),
|
|
|
|
}, {contentComponent: OptionsMenu, headerMode: 'none', contentOptions: {activeTintColor: theme.accent}});
|
2021-02-25 18:47:49 +00:00
|
|
|
const AppAgentStack = createDrawerNavigator({
|
|
|
|
sta: createStackNavigator({
|
|
|
|
home: Home,
|
|
|
|
useraccount: UserAccount,
|
|
|
|
Historique:
|
|
|
|
{
|
|
|
|
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none',
|
2021-02-25 18:47:49 +00:00
|
|
|
header: null,
|
|
|
|
headerTitle: null,
|
|
|
|
headerTitle: I18n.t('CREDIT_MANAGE'),
|
|
|
|
tabBarOptions: {
|
|
|
|
labelStyle: {
|
|
|
|
fontSize: 13,
|
2023-04-21 06:23:36 +00:00
|
|
|
fontWeight: 'bold',
|
2021-02-25 18:47:49 +00:00
|
|
|
},
|
2023-04-21 06:23:36 +00:00
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
}),
|
|
|
|
navigationOptions: ({navigation}) => ({
|
|
|
|
header: null,
|
|
|
|
headerMode: 'none',
|
|
|
|
headerTitle: null,
|
|
|
|
activeColor: '#f0edf6',
|
|
|
|
inactiveColor: '#3e2465',
|
|
|
|
barStyle: {backgroundColor: '#694fad'},
|
|
|
|
|
|
|
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
|
|
|
drawerIcon: ({tintColor}) => (
|
|
|
|
<Icon
|
|
|
|
name={'credit-card'}
|
|
|
|
size={24}
|
2023-04-21 06:23:36 +00:00
|
|
|
/>),
|
2021-02-25 18:47:49 +00:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
|
|
|
historyItemDetails: HistoryItemDetails,
|
|
|
|
creditrequest: HistoryRequester,
|
|
|
|
addNetwork: AddNetwork,
|
|
|
|
updateinformation: UpdateInformations,
|
|
|
|
notificationview: Notifications,
|
|
|
|
configuration: Configurations,
|
2023-04-21 06:23:36 +00:00
|
|
|
about: About,
|
|
|
|
}),
|
2021-02-25 18:47:49 +00:00
|
|
|
}, {
|
|
|
|
contentComponent: OptionsMenu,
|
2023-04-21 06:23:36 +00:00
|
|
|
backBehavior: 'none',
|
2021-02-25 18:47:49 +00:00
|
|
|
lazy: false,
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none', contentOptions: {activeTintColor: theme.accent},
|
|
|
|
});
|
2021-02-25 18:47:49 +00:00
|
|
|
const AppAdministratorStack = createDrawerNavigator({
|
|
|
|
sta: createStackNavigator({
|
|
|
|
home: Home,
|
|
|
|
useraccount: UserAccount,
|
|
|
|
Historique: {
|
|
|
|
screen: createBottomTabNavigator({
|
2023-04-21 06:23:36 +00:00
|
|
|
myDemand: MyHistory, OthersDemand: MyHistory,
|
2021-02-25 18:47:49 +00:00
|
|
|
}, {
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none',
|
2021-02-25 18:47:49 +00:00
|
|
|
header: null,
|
|
|
|
headerTitle: null,
|
|
|
|
title: I18n.t('CREDIT_MANAGE'),
|
|
|
|
tabBarOptions: {
|
|
|
|
labelStyle: {
|
|
|
|
fontSize: 13,
|
|
|
|
},
|
2023-04-21 06:23:36 +00:00
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
}),
|
|
|
|
navigationOptions: ({navigation}) => ({
|
|
|
|
header: null,
|
|
|
|
headerMode: 'none',
|
|
|
|
headerTitle: null,
|
|
|
|
activeColor: '#f0edf6',
|
|
|
|
inactiveColor: '#3e2465',
|
|
|
|
barStyle: {backgroundColor: '#694fad'},
|
|
|
|
|
|
|
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
|
|
|
drawerIcon: ({tintColor}) => (
|
|
|
|
<Icon
|
|
|
|
name={'credit-card'}
|
|
|
|
size={24}
|
2023-04-21 06:23:36 +00:00
|
|
|
/>),
|
2021-02-25 18:47:49 +00:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
creditrequest: HistoryRequester,
|
|
|
|
historyItemDetails: HistoryItemDetails,
|
|
|
|
|
|
|
|
superviseurgroup: SuperViseurGroupeHome,
|
|
|
|
notificationview: Notifications,
|
|
|
|
configuration: Configurations,
|
2023-04-21 06:23:36 +00:00
|
|
|
about: About,
|
2021-02-25 18:47:49 +00:00
|
|
|
|
2023-04-21 06:23:36 +00:00
|
|
|
}),
|
2019-06-16 13:09:54 +00:00
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
{
|
|
|
|
contentComponent: OptionsMenu,
|
2023-04-21 06:23:36 +00:00
|
|
|
backBehavior: 'none',
|
|
|
|
headerMode: 'none',
|
|
|
|
});
|
2021-02-25 18:47:49 +00:00
|
|
|
const AppSuperAdministrator = createDrawerNavigator({
|
|
|
|
sta: createStackNavigator({
|
|
|
|
home: Home,
|
|
|
|
useraccount: UserAccount,
|
|
|
|
Historique: {
|
|
|
|
screen: createBottomTabNavigator({OthersDemand: MyHistory}, {
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none',
|
2021-02-25 18:47:49 +00:00
|
|
|
header: null,
|
|
|
|
headerTitle: null,
|
|
|
|
title: I18n.t('CREDIT_MANAGE'),
|
2019-06-16 13:09:54 +00:00
|
|
|
tabBarOptions: {
|
|
|
|
labelStyle: {
|
|
|
|
fontSize: 13,
|
2023-04-21 06:23:36 +00:00
|
|
|
fontWeight: 'bold',
|
2019-06-16 13:09:54 +00:00
|
|
|
},
|
2023-04-21 06:23:36 +00:00
|
|
|
},
|
2019-06-16 13:09:54 +00:00
|
|
|
}),
|
2021-02-25 18:47:49 +00:00
|
|
|
navigationOptions: ({navigation}) => ({
|
|
|
|
title: I18n.t('CREDIT_MANAGE'),
|
2023-04-21 06:23:36 +00:00
|
|
|
headerMode: 'none',
|
2021-02-25 18:47:49 +00:00
|
|
|
header: null,
|
|
|
|
headerTitle: null,
|
|
|
|
drawerIcon: ({tintColor}) => (
|
2019-06-16 13:09:54 +00:00
|
|
|
<Icon
|
|
|
|
name={'credit-card'}
|
|
|
|
size={24}
|
2023-04-21 06:23:36 +00:00
|
|
|
/>),
|
2019-06-16 13:09:54 +00:00
|
|
|
}),
|
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
creditrequest: HistoryRequester,
|
|
|
|
historyItemDetails: HistoryItemDetails,
|
|
|
|
superviseurgroup: SuperViseurGroupeHome,
|
|
|
|
notificationview: Notifications,
|
|
|
|
configuration: Configurations,
|
2023-04-21 06:23:36 +00:00
|
|
|
about: About,
|
2019-06-16 13:09:54 +00:00
|
|
|
|
2023-04-21 06:23:36 +00:00
|
|
|
}),
|
2021-02-25 18:47:49 +00:00
|
|
|
}, {
|
|
|
|
contentComponent: OptionsMenu,
|
2023-04-21 06:23:36 +00:00
|
|
|
backBehavior: 'none',
|
|
|
|
headerMode: 'none',
|
|
|
|
});
|
2021-02-25 18:47:49 +00:00
|
|
|
export const AppNavigator = createSwitchNavigator({
|
|
|
|
first: {
|
2023-04-21 06:23:36 +00:00
|
|
|
screen: SplashScreen,
|
2019-06-16 13:09:54 +00:00
|
|
|
},
|
2021-02-25 18:47:49 +00:00
|
|
|
App: AppStack,
|
|
|
|
AgentApp: AppAgentStack,
|
|
|
|
adminApp: AppAdministratorStack,
|
|
|
|
supAdminApp: AppSuperAdministrator,
|
2023-04-21 06:23:36 +00:00
|
|
|
Auth: AuthStack,
|
2021-02-25 18:47:49 +00:00
|
|
|
}, {
|
2023-04-21 06:23:36 +00:00
|
|
|
initialRouteName: 'first',
|
2019-06-16 13:09:54 +00:00
|
|
|
});
|
|
|
|
const AppContainer = createAppContainer(AppNavigator);
|
|
|
|
|
|
|
|
export default AppContainer;
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
2021-02-25 18:47:49 +00:00
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
backgroundColor: '#F5FCFF',
|
|
|
|
},
|
|
|
|
welcome: {
|
|
|
|
fontSize: 20,
|
|
|
|
textAlign: 'center',
|
|
|
|
margin: 10,
|
|
|
|
},
|
|
|
|
instructions: {
|
|
|
|
textAlign: 'center',
|
|
|
|
color: '#333333',
|
|
|
|
marginBottom: 5,
|
|
|
|
},
|
2019-06-16 13:09:54 +00:00
|
|
|
});
|