Before fixing release issue
393
App.ios.js
|
|
@ -6,9 +6,9 @@
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
import { Platform, StyleSheet, Text, View, YellowBox } from 'react-native';
|
||||||
import { createSwitchNavigator, createStackNavigator,createDrawerNavigator, createAppContainer,createBottomTabNavigator } from 'react-navigation';
|
import { createSwitchNavigator, createStackNavigator, createDrawerNavigator, createAppContainer, createBottomTabNavigator } from 'react-navigation';
|
||||||
import Connect from "./screens/login/Connect";
|
import Connect from "./screens/login/Connect";
|
||||||
import SplashScreen from "./screens/splashscreen/SplashScreen";
|
import SplashScreen from "./screens/splashscreen/SplashScreen";
|
||||||
import HelpMenu from "./screens/help/HelpMenu";
|
import HelpMenu from "./screens/help/HelpMenu";
|
||||||
|
|
@ -41,208 +41,227 @@ import Filter from './screens/home/Filter';
|
||||||
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
|
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
|
||||||
import Networks from './screens/home/Networks';
|
import Networks from './screens/home/Networks';
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||||
android:
|
android:
|
||||||
'Double tap R on your keyboard to reload,\n' +
|
'Double tap R on your keyboard to reload,\n' +
|
||||||
'Shake or press menu button for dev menu',
|
'Shake or press menu button for dev menu',
|
||||||
});
|
});
|
||||||
|
|
||||||
type Props = {};
|
type Props = {};
|
||||||
const theme=require("./utils/theme")
|
const theme = require("./utils/theme")
|
||||||
class HomeScreen extends Component<Props> {
|
class HomeScreen extends Component<Props> {
|
||||||
render() {
|
|
||||||
return (
|
render() {
|
||||||
<View style={styles.container}>
|
|
||||||
<Text style={styles.welcome}>Welcome to iLink World!</Text>
|
return (
|
||||||
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
<View style={styles.container}>
|
||||||
<Text style={styles.instructions}>{instructions}</Text>
|
<Text style={styles.welcome}>Welcome to iLink World!</Text>
|
||||||
</View>
|
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
||||||
);
|
<Text style={styles.instructions}>{instructions}</Text>
|
||||||
}
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const AuthStack=createStackNavigator({
|
const AuthStack = createStackNavigator({
|
||||||
login:Connect,
|
login: Connect,
|
||||||
helpMenu:HelpMenu,
|
helpMenu: HelpMenu,
|
||||||
help:Help,
|
help: Help,
|
||||||
forgottenpass:ForgottenPassword,
|
forgottenpass: ForgottenPassword,
|
||||||
typeaccountcreate:TypeChoiser,
|
typeaccountcreate: TypeChoiser,
|
||||||
simpleusercreate:createAccount,
|
simpleusercreate: createAccount,
|
||||||
step2:CreateUserStep2,
|
step2: CreateUserStep2,
|
||||||
activateaccout:ActivateAccount
|
activateaccout: ActivateAccount
|
||||||
|
|
||||||
},{
|
}, {
|
||||||
headerMode: 'none'
|
headerMode: 'none'
|
||||||
})
|
})
|
||||||
const AppStack=createDrawerNavigator({sta:createStackNavigator({
|
const AppStack = createDrawerNavigator({
|
||||||
home:Home,
|
sta: createStackNavigator({
|
||||||
/* filtre:Filter,
|
home: Home,
|
||||||
network:Networks,*/
|
/* filtre:Filter,
|
||||||
useraccount:{
|
network:Networks,*/
|
||||||
screen:UserAccount,
|
useraccount: {
|
||||||
navigationOptions: {
|
screen: UserAccount,
|
||||||
},
|
navigationOptions: {
|
||||||
},
|
},
|
||||||
notificationview:Notifications,
|
},
|
||||||
configuration:Configurations,
|
notificationview: Notifications,
|
||||||
about:About
|
configuration: Configurations,
|
||||||
|
about: About
|
||||||
|
|
||||||
})},{contentComponent:OptionsMenu,headerMode: 'none',contentOptions:{activeTintColor: theme.accent}})
|
})
|
||||||
const AppAgentStack=createDrawerNavigator({sta:createStackNavigator({
|
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||||
home:Home,
|
const AppAgentStack = createDrawerNavigator({
|
||||||
useraccount:UserAccount,
|
sta: createStackNavigator({
|
||||||
Historique:
|
home: Home,
|
||||||
{
|
useraccount: UserAccount,
|
||||||
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
Historique:
|
||||||
headerMode: "none",
|
{
|
||||||
header:null,
|
screen: createBottomTabNavigator({ myDemand: MyHistory }, {
|
||||||
headerTitle:null,
|
headerMode: "none",
|
||||||
headerTitle: I18n.t('CREDIT_MANAGE'),
|
header: null,
|
||||||
tabBarOptions: {
|
headerTitle: null,
|
||||||
labelStyle: {
|
headerTitle: I18n.t('CREDIT_MANAGE'),
|
||||||
fontSize: 13,
|
tabBarOptions: {
|
||||||
fontWeight: "bold"
|
labelStyle: {
|
||||||
},
|
fontSize: 13,
|
||||||
}
|
fontWeight: "bold"
|
||||||
}),
|
},
|
||||||
navigationOptions: ({ navigation }) => ({
|
}
|
||||||
header:null,
|
}),
|
||||||
headerMode:'none',
|
navigationOptions: ({ navigation }) => ({
|
||||||
headerTitle:null,
|
header: null,
|
||||||
activeColor: '#f0edf6',
|
headerMode: 'none',
|
||||||
inactiveColor: '#3e2465',
|
headerTitle: null,
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
activeColor: '#f0edf6',
|
||||||
|
inactiveColor: '#3e2465',
|
||||||
|
barStyle: { backgroundColor: '#694fad' },
|
||||||
|
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>)
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
historyItemDetails:HistoryItemDetails,
|
historyItemDetails: HistoryItemDetails,
|
||||||
creditrequest:HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
addNetwork:AddNetwork,
|
addNetwork: AddNetwork,
|
||||||
updateinformation:UpdateInformations,
|
updateinformation: UpdateInformations,
|
||||||
notificationview:Notifications,
|
notificationview: Notifications,
|
||||||
configuration:Configurations,
|
configuration: Configurations,
|
||||||
about:About
|
about: About
|
||||||
})},{contentComponent:OptionsMenu,
|
})
|
||||||
backBehavior:"none",
|
}, {
|
||||||
lazy:false,
|
contentComponent: OptionsMenu,
|
||||||
headerMode: 'none',contentOptions:{activeTintColor:theme.accent}})
|
backBehavior: "none",
|
||||||
const AppAdministratorStack=createDrawerNavigator({sta:createStackNavigator({
|
lazy: false,
|
||||||
home:Home,
|
headerMode: 'none', contentOptions: { activeTintColor: theme.accent }
|
||||||
useraccount:UserAccount,
|
})
|
||||||
Historique:{
|
const AppAdministratorStack = createDrawerNavigator({
|
||||||
screen:createBottomTabNavigator({
|
sta: createStackNavigator({
|
||||||
myDemand:MyHistory,OthersDemand:MyHistory}, {
|
home: Home,
|
||||||
headerMode:"none",
|
useraccount: UserAccount,
|
||||||
header:null,
|
Historique: {
|
||||||
headerTitle:null,
|
screen: createBottomTabNavigator({
|
||||||
title:I18n.t('CREDIT_MANAGE'),
|
myDemand: MyHistory, OthersDemand: MyHistory
|
||||||
tabBarOptions: {
|
}, {
|
||||||
labelStyle: {
|
headerMode: "none",
|
||||||
fontSize: 13,
|
header: null,
|
||||||
},
|
headerTitle: null,
|
||||||
}}),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
navigationOptions: ({ navigation }) => ({
|
tabBarOptions: {
|
||||||
header:null,
|
labelStyle: {
|
||||||
headerMode:'none',
|
fontSize: 13,
|
||||||
headerTitle:null,
|
},
|
||||||
activeColor: '#f0edf6',
|
}
|
||||||
inactiveColor: '#3e2465',
|
}),
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
navigationOptions: ({ navigation }) => ({
|
||||||
|
header: null,
|
||||||
|
headerMode: 'none',
|
||||||
|
headerTitle: null,
|
||||||
|
activeColor: '#f0edf6',
|
||||||
|
inactiveColor: '#3e2465',
|
||||||
|
barStyle: { backgroundColor: '#694fad' },
|
||||||
|
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>)
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
creditrequest:HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
historyItemDetails:HistoryItemDetails,
|
historyItemDetails: HistoryItemDetails,
|
||||||
|
|
||||||
superviseurgroup:SuperViseurGroupeHome,
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
notificationview:Notifications,
|
notificationview: Notifications,
|
||||||
configuration:Configurations,
|
configuration: Configurations,
|
||||||
about:About
|
about: About
|
||||||
|
|
||||||
})},
|
})
|
||||||
{contentComponent:OptionsMenu,
|
},
|
||||||
backBehavior:"none",
|
{
|
||||||
headerMode: 'none'})
|
contentComponent: OptionsMenu,
|
||||||
const AppSuperAdministrator=createDrawerNavigator({sta:createStackNavigator({
|
backBehavior: "none",
|
||||||
home:Home,
|
headerMode: 'none'
|
||||||
useraccount:UserAccount,
|
})
|
||||||
Historique:{
|
const AppSuperAdministrator = createDrawerNavigator({
|
||||||
screen:createBottomTabNavigator({OthersDemand:MyHistory}, {
|
sta: createStackNavigator({
|
||||||
headerMode:"none",
|
home: Home,
|
||||||
header:null,
|
useraccount: UserAccount,
|
||||||
headerTitle:null,
|
Historique: {
|
||||||
title:I18n.t('CREDIT_MANAGE'),
|
screen: createBottomTabNavigator({ OthersDemand: MyHistory }, {
|
||||||
tabBarOptions: {
|
headerMode: "none",
|
||||||
labelStyle: {
|
header: null,
|
||||||
fontSize: 13,
|
headerTitle: null,
|
||||||
fontWeight:"bold"
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
},
|
tabBarOptions: {
|
||||||
}}),
|
labelStyle: {
|
||||||
navigationOptions: ({ navigation }) => ({
|
fontSize: 13,
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
fontWeight: "bold"
|
||||||
headerMode:"none",
|
},
|
||||||
header:null,
|
}
|
||||||
headerTitle:null,
|
}),
|
||||||
drawerIcon: ({ tintColor }) => (
|
navigationOptions: ({ navigation }) => ({
|
||||||
<Icon
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
name={'credit-card'}
|
headerMode: "none",
|
||||||
size={24}
|
header: null,
|
||||||
/>)
|
headerTitle: null,
|
||||||
}),
|
drawerIcon: ({ tintColor }) => (
|
||||||
},
|
<Icon
|
||||||
creditrequest:HistoryRequester,
|
name={'credit-card'}
|
||||||
historyItemDetails:HistoryItemDetails,
|
size={24}
|
||||||
superviseurgroup:SuperViseurGroupeHome,
|
/>)
|
||||||
notificationview:Notifications,
|
}),
|
||||||
configuration:Configurations,
|
},
|
||||||
about:About
|
creditrequest: HistoryRequester,
|
||||||
|
historyItemDetails: HistoryItemDetails,
|
||||||
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
|
notificationview: Notifications,
|
||||||
|
configuration: Configurations,
|
||||||
|
about: About
|
||||||
|
|
||||||
})},{contentComponent:OptionsMenu,
|
})
|
||||||
backBehavior:"none",
|
}, {
|
||||||
headerMode: 'none'})
|
contentComponent: OptionsMenu,
|
||||||
export const AppNavigator =createSwitchNavigator({
|
backBehavior: "none",
|
||||||
first: {
|
headerMode: 'none'
|
||||||
screen: SplashScreen
|
})
|
||||||
},
|
export const AppNavigator = createSwitchNavigator({
|
||||||
App:AppStack,
|
first: {
|
||||||
AgentApp:AppAgentStack,
|
screen: SplashScreen
|
||||||
adminApp:AppAdministratorStack,
|
},
|
||||||
supAdminApp:AppSuperAdministrator,
|
App: AppStack,
|
||||||
Auth:AuthStack
|
AgentApp: AppAgentStack,
|
||||||
},{
|
adminApp: AppAdministratorStack,
|
||||||
initialRouteName: 'first'
|
supAdminApp: AppSuperAdministrator,
|
||||||
|
Auth: AuthStack
|
||||||
|
}, {
|
||||||
|
initialRouteName: 'first'
|
||||||
});
|
});
|
||||||
const AppContainer = createAppContainer(AppNavigator);
|
const AppContainer = createAppContainer(AppNavigator);
|
||||||
|
|
||||||
export default AppContainer;
|
export default AppContainer;
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: '#F5FCFF',
|
backgroundColor: '#F5FCFF',
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
instructions: {
|
instructions: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
396
App.js
|
|
@ -6,9 +6,9 @@
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
import { Platform, StyleSheet, Text, View, YellowBox } from 'react-native';
|
||||||
import { createSwitchNavigator, createStackNavigator,createDrawerNavigator, createAppContainer,createBottomTabNavigator } from 'react-navigation';
|
import { createSwitchNavigator, createStackNavigator, createDrawerNavigator, createAppContainer, createBottomTabNavigator } from 'react-navigation';
|
||||||
import Connect from "./screens/login/Connect";
|
import Connect from "./screens/login/Connect";
|
||||||
import SplashScreen from "./screens/splashscreen/SplashScreen";
|
import SplashScreen from "./screens/splashscreen/SplashScreen";
|
||||||
import HelpMenu from "./screens/help/HelpMenu";
|
import HelpMenu from "./screens/help/HelpMenu";
|
||||||
|
|
@ -41,208 +41,230 @@ import Filter from './screens/home/Filter';
|
||||||
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
|
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
|
||||||
import Networks from './screens/home/Networks';
|
import Networks from './screens/home/Networks';
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||||
android:
|
android:
|
||||||
'Double tap R on your keyboard to reload,\n' +
|
'Double tap R on your keyboard to reload,\n' +
|
||||||
'Shake or press menu button for dev menu',
|
'Shake or press menu button for dev menu',
|
||||||
});
|
});
|
||||||
|
|
||||||
type Props = {};
|
type Props = {};
|
||||||
const theme=require("./utils/theme")
|
const theme = require("./utils/theme")
|
||||||
class HomeScreen extends Component<Props> {
|
class HomeScreen extends Component<Props> {
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
render() {
|
||||||
<Text style={styles.welcome}>Welcome to iLink World!</Text>
|
|
||||||
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
return (
|
||||||
<Text style={styles.instructions}>{instructions}</Text>
|
<View style={styles.container}>
|
||||||
</View>
|
<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>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const AuthStack=createStackNavigator({
|
const AuthStack = createStackNavigator({
|
||||||
login:Connect,
|
login: Connect,
|
||||||
helpMenu:HelpMenu,
|
helpMenu: HelpMenu,
|
||||||
help:Help,
|
help: Help,
|
||||||
forgottenpass:ForgottenPassword,
|
forgottenpass: ForgottenPassword,
|
||||||
typeaccountcreate:TypeChoiser,
|
typeaccountcreate: TypeChoiser,
|
||||||
simpleusercreate:createAccount,
|
simpleusercreate: createAccount,
|
||||||
step2:CreateUserStep2,
|
step2: CreateUserStep2,
|
||||||
activateaccout:ActivateAccount
|
activateaccout: ActivateAccount
|
||||||
|
|
||||||
},{
|
}, {
|
||||||
headerMode: 'none'
|
headerMode: 'none'
|
||||||
})
|
})
|
||||||
const AppStack=createDrawerNavigator({sta:createStackNavigator({
|
const AppStack = createDrawerNavigator({
|
||||||
home:Home,
|
sta: createStackNavigator({
|
||||||
/* filtre:Filter,
|
home: Home,
|
||||||
network:Networks,*/
|
/* filtre:Filter,
|
||||||
useraccount:{
|
network:Networks,*/
|
||||||
screen:UserAccount,
|
useraccount: {
|
||||||
navigationOptions: {
|
screen: UserAccount,
|
||||||
},
|
navigationOptions: {
|
||||||
},
|
},
|
||||||
notificationview:Notifications,
|
},
|
||||||
configuration:Configurations,
|
notificationview: Notifications,
|
||||||
about:About
|
configuration: Configurations,
|
||||||
|
about: About
|
||||||
|
|
||||||
})},{contentComponent:OptionsMenu,headerMode: 'none',contentOptions:{activeTintColor: theme.accent}})
|
})
|
||||||
const AppAgentStack=createDrawerNavigator({sta:createStackNavigator({
|
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||||
home:Home,
|
const AppAgentStack = createDrawerNavigator({
|
||||||
useraccount:UserAccount,
|
sta: createStackNavigator({
|
||||||
Historique:
|
home: Home,
|
||||||
{
|
useraccount: UserAccount,
|
||||||
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
Historique:
|
||||||
headerMode: "none",
|
{
|
||||||
header:null,
|
screen: createBottomTabNavigator({ myDemand: MyHistory }, {
|
||||||
headerTitle:null,
|
headerMode: "none",
|
||||||
headerTitle: I18n.t('CREDIT_MANAGE'),
|
header: null,
|
||||||
tabBarOptions: {
|
headerTitle: null,
|
||||||
labelStyle: {
|
headerTitle: I18n.t('CREDIT_MANAGE'),
|
||||||
fontSize: 13,
|
tabBarOptions: {
|
||||||
fontWeight: "bold"
|
labelStyle: {
|
||||||
},
|
fontSize: 13,
|
||||||
}
|
fontWeight: "bold"
|
||||||
}),
|
},
|
||||||
navigationOptions: ({ navigation }) => ({
|
}
|
||||||
header:null,
|
}),
|
||||||
headerMode:'none',
|
navigationOptions: ({ navigation }) => ({
|
||||||
headerTitle:null,
|
header: null,
|
||||||
activeColor: '#f0edf6',
|
headerMode: 'none',
|
||||||
inactiveColor: '#3e2465',
|
headerTitle: null,
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
activeColor: '#f0edf6',
|
||||||
|
inactiveColor: '#3e2465',
|
||||||
|
barStyle: { backgroundColor: '#694fad' },
|
||||||
|
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>)
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
historyItemDetails:HistoryItemDetails,
|
historyItemDetails: HistoryItemDetails,
|
||||||
creditrequest:HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
addNetwork:AddNetwork,
|
addNetwork: AddNetwork,
|
||||||
updateinformation:UpdateInformations,
|
updateinformation: UpdateInformations,
|
||||||
notificationview:Notifications,
|
notificationview: Notifications,
|
||||||
configuration:Configurations,
|
configuration: Configurations,
|
||||||
about:About
|
about: About
|
||||||
})},{contentComponent:OptionsMenu,
|
})
|
||||||
backBehavior:"none",
|
}, {
|
||||||
lazy:false,
|
contentComponent: OptionsMenu,
|
||||||
headerMode: 'none',contentOptions:{activeTintColor:theme.accent}})
|
backBehavior: "none",
|
||||||
const AppAdministratorStack=createDrawerNavigator({sta:createStackNavigator({
|
lazy: false,
|
||||||
home:Home,
|
headerMode: 'none', contentOptions: { activeTintColor: theme.accent }
|
||||||
useraccount:UserAccount,
|
})
|
||||||
Historique:{
|
const AppAdministratorStack = createDrawerNavigator({
|
||||||
screen:createBottomTabNavigator({
|
sta: createStackNavigator({
|
||||||
myDemand:MyHistory,OthersDemand:MyHistory}, {
|
home: Home,
|
||||||
headerMode:"none",
|
useraccount: UserAccount,
|
||||||
header:null,
|
Historique: {
|
||||||
headerTitle:null,
|
screen: createBottomTabNavigator({
|
||||||
title:I18n.t('CREDIT_MANAGE'),
|
myDemand: MyHistory, OthersDemand: MyHistory
|
||||||
tabBarOptions: {
|
}, {
|
||||||
labelStyle: {
|
headerMode: "none",
|
||||||
fontSize: 13,
|
header: null,
|
||||||
},
|
headerTitle: null,
|
||||||
}}),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
navigationOptions: ({ navigation }) => ({
|
tabBarOptions: {
|
||||||
header:null,
|
labelStyle: {
|
||||||
headerMode:'none',
|
fontSize: 13,
|
||||||
headerTitle:null,
|
},
|
||||||
activeColor: '#f0edf6',
|
}
|
||||||
inactiveColor: '#3e2465',
|
}),
|
||||||
barStyle: { backgroundColor: '#694fad' },
|
navigationOptions: ({ navigation }) => ({
|
||||||
|
header: null,
|
||||||
|
headerMode: 'none',
|
||||||
|
headerTitle: null,
|
||||||
|
activeColor: '#f0edf6',
|
||||||
|
inactiveColor: '#3e2465',
|
||||||
|
barStyle: { backgroundColor: '#694fad' },
|
||||||
|
|
||||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>)
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
creditrequest:HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
historyItemDetails:HistoryItemDetails,
|
historyItemDetails: HistoryItemDetails,
|
||||||
|
|
||||||
superviseurgroup:SuperViseurGroupeHome,
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
notificationview:Notifications,
|
notificationview: Notifications,
|
||||||
configuration:Configurations,
|
configuration: Configurations,
|
||||||
about:About
|
about: About
|
||||||
|
|
||||||
})},
|
})
|
||||||
{contentComponent:OptionsMenu,
|
},
|
||||||
backBehavior:"none",
|
{
|
||||||
headerMode: 'none'})
|
contentComponent: OptionsMenu,
|
||||||
const AppSuperAdministrator=createDrawerNavigator({sta:createStackNavigator({
|
backBehavior: "none",
|
||||||
home:Home,
|
headerMode: 'none'
|
||||||
useraccount:UserAccount,
|
})
|
||||||
Historique:{
|
const AppSuperAdministrator = createDrawerNavigator({
|
||||||
screen:createBottomTabNavigator({OthersDemand:MyHistory}, {
|
sta: createStackNavigator({
|
||||||
headerMode:"none",
|
home: Home,
|
||||||
header:null,
|
useraccount: UserAccount,
|
||||||
headerTitle:null,
|
Historique: {
|
||||||
title:I18n.t('CREDIT_MANAGE'),
|
screen: createBottomTabNavigator({ OthersDemand: MyHistory }, {
|
||||||
tabBarOptions: {
|
headerMode: "none",
|
||||||
labelStyle: {
|
header: null,
|
||||||
fontSize: 13,
|
headerTitle: null,
|
||||||
fontWeight:"bold"
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
},
|
tabBarOptions: {
|
||||||
}}),
|
labelStyle: {
|
||||||
navigationOptions: ({ navigation }) => ({
|
fontSize: 13,
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
fontWeight: "bold"
|
||||||
headerMode:"none",
|
},
|
||||||
header:null,
|
}
|
||||||
headerTitle:null,
|
}),
|
||||||
drawerIcon: ({ tintColor }) => (
|
navigationOptions: ({ navigation }) => ({
|
||||||
<Icon
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
name={'credit-card'}
|
headerMode: "none",
|
||||||
size={24}
|
header: null,
|
||||||
/>)
|
headerTitle: null,
|
||||||
}),
|
drawerIcon: ({ tintColor }) => (
|
||||||
},
|
<Icon
|
||||||
creditrequest:HistoryRequester,
|
name={'credit-card'}
|
||||||
historyItemDetails:HistoryItemDetails,
|
size={24}
|
||||||
superviseurgroup:SuperViseurGroupeHome,
|
/>)
|
||||||
notificationview:Notifications,
|
}),
|
||||||
configuration:Configurations,
|
},
|
||||||
about:About
|
creditrequest: HistoryRequester,
|
||||||
|
historyItemDetails: HistoryItemDetails,
|
||||||
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
|
notificationview: Notifications,
|
||||||
|
configuration: Configurations,
|
||||||
|
about: About
|
||||||
|
|
||||||
})},{contentComponent:OptionsMenu,
|
})
|
||||||
backBehavior:"none",
|
}, {
|
||||||
headerMode: 'none'})
|
contentComponent: OptionsMenu,
|
||||||
export const AppNavigator =createSwitchNavigator({
|
backBehavior: "none",
|
||||||
first: {
|
headerMode: 'none'
|
||||||
screen: SplashScreen
|
})
|
||||||
},
|
export const AppNavigator = createSwitchNavigator({
|
||||||
App:AppStack,
|
first: {
|
||||||
AgentApp:AppAgentStack,
|
screen: SplashScreen
|
||||||
adminApp:AppAdministratorStack,
|
},
|
||||||
supAdminApp:AppSuperAdministrator,
|
App: AppStack,
|
||||||
Auth:AuthStack
|
AgentApp: AppAgentStack,
|
||||||
},{
|
adminApp: AppAdministratorStack,
|
||||||
initialRouteName: 'first'
|
supAdminApp: AppSuperAdministrator,
|
||||||
|
Auth: AuthStack
|
||||||
|
}, {
|
||||||
|
initialRouteName: 'first'
|
||||||
});
|
});
|
||||||
const AppContainer = createAppContainer(AppNavigator);
|
const AppContainer = createAppContainer(AppNavigator);
|
||||||
|
|
||||||
export default AppContainer;
|
export default AppContainer;
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
backgroundColor: '#F5FCFF',
|
backgroundColor: '#F5FCFF',
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
instructions: {
|
instructions: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.ilink"
|
applicationId "com.ilinktest"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,39 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.ilink">
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="com.ilinktest">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||||
|
|
||||||
|
<uses-sdk tools:overrideLibrary="com.shazam.android.widget.text.reflow" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
android:label="@string/app_name"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
|
||||||
android:allowBackup="false"
|
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity
|
|
||||||
android:name=".MainActivity"
|
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
android:largeHeap="true"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:theme="@style/AppTheme">
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<meta-data
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
android:name="com.google.android.geo.API_KEY"
|
||||||
</intent-filter>
|
android:value="AIzaSyCz4B9uUu3gkuu78Sf72gPWZ3t_qKqf5zg" />
|
||||||
</activity>
|
|
||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
package com.ilink;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
||||||
* rendering of the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getMainComponentName() {
|
|
||||||
return "iLinkWorld";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.ilinktest;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactActivity;
|
||||||
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
|
import com.facebook.react.ReactRootView;
|
||||||
|
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
||||||
|
|
||||||
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
||||||
|
* rendering of the component.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected String getMainComponentName() {
|
||||||
|
return "iLinkWorld";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ReactActivityDelegate createReactActivityDelegate() {
|
||||||
|
return new ReactActivityDelegate(this, getMainComponentName()) {
|
||||||
|
@Override
|
||||||
|
protected ReactRootView createRootView() {
|
||||||
|
return new RNGestureHandlerEnabledRootView(MainActivity.this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ilink;
|
package com.ilinktest;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 231 KiB |
|
After Width: | Height: | Size: 218 KiB |
|
After Width: | Height: | Size: 226 KiB |
|
After Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 187 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 314 KiB |
|
After Width: | Height: | Size: 724 KiB |
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector
|
||||||
|
android:height="108dp"
|
||||||
|
android:width="108dp"
|
||||||
|
android:viewportHeight="108"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#008577"
|
||||||
|
android:pathData="M0,0h108v108h-108z"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
</vector>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 21 KiB |
|
|
@ -2,6 +2,8 @@
|
||||||
"WELCOME": "Welcome to iLink World !",
|
"WELCOME": "Welcome to iLink World !",
|
||||||
"HELP": "Help",
|
"HELP": "Help",
|
||||||
"SIMPLE_USER": "Simple User",
|
"SIMPLE_USER": "Simple User",
|
||||||
|
"ABOUT": "About us",
|
||||||
|
"ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.",
|
||||||
"GEOLOCATED_USER": "Geo located user",
|
"GEOLOCATED_USER": "Geo located user",
|
||||||
"SUPERVISOR": "Supervisor",
|
"SUPERVISOR": "Supervisor",
|
||||||
"AGENT": "Agent",
|
"AGENT": "Agent",
|
||||||
|
|
@ -15,6 +17,7 @@
|
||||||
"ACCOUNT_CREATED_SUCCESS": "Account created successfully.\nYou will receive in a few minutes an email and an SMS with your informations.\nWe will redirect you to the login page",
|
"ACCOUNT_CREATED_SUCCESS": "Account created successfully.\nYou will receive in a few minutes an email and an SMS with your informations.\nWe will redirect you to the login page",
|
||||||
"OR_BIG": "OR",
|
"OR_BIG": "OR",
|
||||||
"FOR_NUMB": "For the ",
|
"FOR_NUMB": "For the ",
|
||||||
|
"FILTER_DATE": "Filter date",
|
||||||
"SUBTITLE_ACTIVE_ACCOUNT": "Activate your account using the code that was sent on your email or phone number",
|
"SUBTITLE_ACTIVE_ACCOUNT": "Activate your account using the code that was sent on your email or phone number",
|
||||||
"ASK_FOR_CREDIT": "Apply for credit",
|
"ASK_FOR_CREDIT": "Apply for credit",
|
||||||
"ASK_CREDIT": "Credit applications",
|
"ASK_CREDIT": "Credit applications",
|
||||||
|
|
@ -26,14 +29,15 @@
|
||||||
"ASK_FOR_SUPERVISOR1": "Ask to become a supervisor",
|
"ASK_FOR_SUPERVISOR1": "Ask to become a supervisor",
|
||||||
"CREDIT_ASK_FROM_MEMBERS": "Credit requests from your members",
|
"CREDIT_ASK_FROM_MEMBERS": "Credit requests from your members",
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "Mon compte",
|
"MY_ACCOUNT": "My account",
|
||||||
"THE_ACCOUNT": "Le compte ",
|
"THE_ACCOUNT": "Account ",
|
||||||
"NO_GEO_POINT_CODE": "You have no free geolocated point",
|
"NO_GEO_POINT_CODE": "You have no free geolocated point",
|
||||||
"NO_DEMAND_ADHESION": "You have no membership request",
|
"NO_DEMAND_ADHESION": "You have no membership request",
|
||||||
"ACTIVATED": "has been activated",
|
"ACTIVATED": "has been activated",
|
||||||
"CREDIT_MANAGE": "Credit Management",
|
"CREDIT_MANAGE": "Credit Management",
|
||||||
"GROUP_MANAGE": "Group Management",
|
"GROUP_MANAGE": "Group Management",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
|
"NO_NOTIFICATION": "You haven't any notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Sign Out",
|
"LOGOUT": "Sign Out",
|
||||||
"HINT_HOME_SEARCH": " Find a place, neighborhood or city ",
|
"HINT_HOME_SEARCH": " Find a place, neighborhood or city ",
|
||||||
|
|
@ -176,6 +180,8 @@
|
||||||
"SEARCH_20": "20 km",
|
"SEARCH_20": "20 km",
|
||||||
"SEARCH_25": "25 km",
|
"SEARCH_25": "25 km",
|
||||||
"SEARCH": "Search",
|
"SEARCH": "Search",
|
||||||
|
"SEE_VIDEO": "Watch the video",
|
||||||
|
"SEE_TUTO": "See the tutorial",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"FREE": "Available",
|
"FREE": "Available",
|
||||||
"SAVED": "Registered",
|
"SAVED": "Registered",
|
||||||
|
|
@ -195,12 +201,14 @@
|
||||||
"PHONE_TRANSACTION": "Transaction number",
|
"PHONE_TRANSACTION": "Transaction number",
|
||||||
"DEMAND_TEXT_FIRST_PART": "made a request for",
|
"DEMAND_TEXT_FIRST_PART": "made a request for",
|
||||||
"REQUEST_SEND": "Request Sent",
|
"REQUEST_SEND": "Request Sent",
|
||||||
|
"DEMAND_RECEIVE": "Requests received",
|
||||||
"TO_": "credit to",
|
"TO_": "credit to",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
||||||
"SAVE_HISTORY": "Save history",
|
"SAVE_HISTORY": "Save history",
|
||||||
"MAKE_REQUEST": "Make a request",
|
"MAKE_REQUEST": "Make a request",
|
||||||
"DATE_WRONG": "The end date can not be earlier than the start date",
|
"DATE_WRONG": "The end date can not be earlier than the start date",
|
||||||
"LOADING_DOTS": "Loads ...",
|
"LOADING_DOTS": "Loading...",
|
||||||
|
"LOADING_PROGRESS": "Loading",
|
||||||
"EMPTY_LIST_REQUEST": "No request",
|
"EMPTY_LIST_REQUEST": "No request",
|
||||||
"MEMBER_LIST": "List of members",
|
"MEMBER_LIST": "List of members",
|
||||||
"FREE_CODE_LIST": "List of available codes",
|
"FREE_CODE_LIST": "List of available codes",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"WELCOME": "Bienvenue sur iLink World !",
|
"WELCOME": "Bienvenue sur iLink World !",
|
||||||
"HELP": "Aide à l'utilisation",
|
"HELP": "Aide",
|
||||||
"SIMPLE_USER": "Utilisateur simple",
|
"SIMPLE_USER": "Utilisateur simple",
|
||||||
|
"ABOUT": "A Propos",
|
||||||
|
"ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.",
|
||||||
"GEOLOCATED_USER": "Utilisateur géo-localisé",
|
"GEOLOCATED_USER": "Utilisateur géo-localisé",
|
||||||
"SUPERVISOR": "Superviseur",
|
"SUPERVISOR": "Superviseur",
|
||||||
"AGENT": "Agent",
|
"AGENT": "Agent",
|
||||||
|
|
@ -15,6 +17,7 @@
|
||||||
"ACCOUNT_CREATED_SUCCESS": "Le compte a été crée avec succès.\nVous recevrez dans quelques minutes un email et un sms avec vos informations.\nNous allons vous rediriger vers la page de connexion",
|
"ACCOUNT_CREATED_SUCCESS": "Le compte a été crée avec succès.\nVous recevrez dans quelques minutes un email et un sms avec vos informations.\nNous allons vous rediriger vers la page de connexion",
|
||||||
"OR_BIG": "OU",
|
"OR_BIG": "OU",
|
||||||
"FOR_NUMB": "Pour le ",
|
"FOR_NUMB": "Pour le ",
|
||||||
|
"FILTER_DATE": "Filtre de date",
|
||||||
"SUBTITLE_ACTIVE_ACCOUNT": "Activez votre compte à l'aide du code qui a été envoyé sur votre mail ou votre numéro de téléphone",
|
"SUBTITLE_ACTIVE_ACCOUNT": "Activez votre compte à l'aide du code qui a été envoyé sur votre mail ou votre numéro de téléphone",
|
||||||
"ASK_FOR_CREDIT": "Demander du crédit",
|
"ASK_FOR_CREDIT": "Demander du crédit",
|
||||||
"ASK_CREDIT": "Demandes de crédit",
|
"ASK_CREDIT": "Demandes de crédit",
|
||||||
|
|
@ -34,6 +37,7 @@
|
||||||
"CREDIT_MANAGE": "Gestion de credit",
|
"CREDIT_MANAGE": "Gestion de credit",
|
||||||
"GROUP_MANAGE": "Gestion du groupe",
|
"GROUP_MANAGE": "Gestion du groupe",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
|
"NO_NOTIFICATION": "Vous n'avez aucune notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Déconnexion",
|
"LOGOUT": "Déconnexion",
|
||||||
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
||||||
|
|
@ -176,6 +180,8 @@
|
||||||
"SEARCH_20": "20 km",
|
"SEARCH_20": "20 km",
|
||||||
"SEARCH_25": "25 km",
|
"SEARCH_25": "25 km",
|
||||||
"SEARCH": "Rechercher",
|
"SEARCH": "Rechercher",
|
||||||
|
"SEE_VIDEO": "Voir la vidéo",
|
||||||
|
"SEE_TUTO": "Voir le tutoriel",
|
||||||
"DELETE": "Supprimer",
|
"DELETE": "Supprimer",
|
||||||
"FREE": "disponibles",
|
"FREE": "disponibles",
|
||||||
"SAVED": "enregistrés",
|
"SAVED": "enregistrés",
|
||||||
|
|
@ -195,12 +201,14 @@
|
||||||
"PHONE_TRANSACTION": "Numéro de transaction",
|
"PHONE_TRANSACTION": "Numéro de transaction",
|
||||||
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
|
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
|
||||||
"DEMANDE_SEND": " Demande Envoyée",
|
"DEMANDE_SEND": " Demande Envoyée",
|
||||||
|
"DEMAND_RECEIVE": "Demandes reçues",
|
||||||
"TO_": " crédit auprès de ",
|
"TO_": " crédit auprès de ",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
||||||
"SAVE_HISTORY": "Enregistrer l'historique",
|
"SAVE_HISTORY": "Enregistrer l'historique",
|
||||||
"MAKE_REQUEST": "Faire une demande",
|
"MAKE_REQUEST": "Faire une demande",
|
||||||
"DATE_WRONG": "La date de fin ne peut être antérieure à la date de début",
|
"DATE_WRONG": "La date de fin ne peut être antérieure à la date de début",
|
||||||
"LOADING_DOTS": "Chargements...",
|
"LOADING_DOTS": "Chargement...",
|
||||||
|
"LOADING_PROGRESS": "Chargement en cours",
|
||||||
"EMPTY_LIST_REQUEST": "Aucune demande",
|
"EMPTY_LIST_REQUEST": "Aucune demande",
|
||||||
"MEMBER_LIST": "Liste des membres",
|
"MEMBER_LIST": "Liste des membres",
|
||||||
"FREE_CODE_LIST": "Liste des codes disponibles",
|
"FREE_CODE_LIST": "Liste des codes disponibles",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">iLink</string>
|
<string name="app_name">iLink Test</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="android:textColor">#000000</item>
|
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
8
index.js
|
|
@ -2,8 +2,12 @@
|
||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {AppRegistry} from 'react-native';
|
import { AppRegistry, YellowBox } from 'react-native';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import {name as appName} from './app.json';
|
import { name as appName } from './app.json';
|
||||||
|
|
||||||
|
YellowBox.ignoredYellowBox = ['Warning: Each', 'Warning: Failed'];
|
||||||
|
console.disableYellowBox = true;
|
||||||
|
|
||||||
|
|
||||||
AppRegistry.registerComponent(appName, () => App);
|
AppRegistry.registerComponent(appName, () => App);
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
import React,{Component} from 'react'
|
import React, { Component } from 'react'
|
||||||
import {StyleSheet,Text,View} from 'react-native'
|
import { StyleSheet, Text, View } from 'react-native'
|
||||||
export const theme=require('./../utils/theme.json')
|
export const theme = require('./../utils/theme.json')
|
||||||
|
|
||||||
export default class BaseScreen extends Component{
|
export default class BaseScreen extends Component {
|
||||||
|
|
||||||
constructor(props,needToCloseDrawer:Boolean=false){
|
constructor(props, needToCloseDrawer) {
|
||||||
super(props)
|
super(props)
|
||||||
if(needToCloseDrawer){
|
if (needToCloseDrawer) {
|
||||||
/* this.props.navigator.toggleDrawer({
|
/* this.props.navigator.toggleDrawer({
|
||||||
side: 'left', // the side of the drawer since you can have two, 'left' / 'right'
|
side: 'left', // the side of the drawer since you can have two, 'left' / 'right'
|
||||||
to: 'close' // optional, 'open' = open the drawer, 'closed' = close it, missing = the opposite of current state
|
to: 'close' // optional, 'open' = open the drawer, 'closed' = close it, missing = the opposite of current state
|
||||||
});*/
|
});*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ export default class About extends React.Component {
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flex: 3 }}>
|
<View style={{ flex: 3 }}>
|
||||||
<Button onPress={() => { Linking.openURL(videoUrl) }} style={{ width: responsiveWidth(40), backgroundColor: "white", borderRadius: responsiveWidth(20), alignSelf: "center", borderColor: "white" }} textStyle={{ color: theme.primary }}>{I18n.t('SEE_VIDEO')}</Button>
|
<Button onPress={() => { Linking.openURL(videoUrl) }} style={{ width: responsiveWidth(40), backgroundColor: "white", borderRadius: responsiveWidth(20), alignSelf: "center", borderColor: "white" }} textStyle={{ color: theme.primary }}>{I18n.t('SEE_VIDEO')}</Button>
|
||||||
<Button style={{ width: responsiveWidth(40), backgroundColor: "transparent", borderRadius: responsiveWidth(20), alignSelf: "center", borderColor: "white" }} textStyle={{ color: "white" }}><View style={{ justifyContent: "center", alignContent: "center" }}><Text style={{ color: "white", fontWeight: "bold" }}>{I18n.t("SEE_TUTO")}</Text><Text style={{ color: "white" }}>{I18n.t('UNAVAILABLE')}</Text></View></Button>
|
<Button style={{ width: responsiveWidth(40), backgroundColor: "transparent", borderRadius: responsiveWidth(20), alignSelf: "center", borderColor: "white" }} textStyle={{ color: "white" }}><View style={{ justifyContent: "center", alignContent: "center" }}><Text style={{ color: "white" }}>{I18n.t('SEE_TUTO')}</Text></View></Button>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: "row", flex: 0.3, width: responsiveWidth(95), height: responsiveHeight(100), justifyContent: "space-between", alignItems: "stretch" }}>
|
<View style={{ flexDirection: "row", flex: 0.3, width: responsiveWidth(95), height: responsiveHeight(100), justifyContent: "space-between", alignItems: "stretch" }}>
|
||||||
<Text style={{ color: "white", fontWeight: "bold" }}>Version 1.0.0</Text>
|
<Text style={{ color: "white", fontWeight: "bold" }}>Version 1.0.0</Text>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { StyleSheet, Text, View, Alert } from 'react-native'
|
import { StyleSheet, Text, View, Alert, Platform, StatusBar } from 'react-native'
|
||||||
import BaseScreen from "../BaseScreen";
|
import BaseScreen from "../BaseScreen";
|
||||||
import { responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions'
|
import { responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions'
|
||||||
import { Dropdown } from 'react-native-material-dropdown'
|
import { Dropdown } from 'react-native-material-dropdown'
|
||||||
|
|
@ -13,22 +13,26 @@ require("./../../utils/Translations")
|
||||||
import { IlinkEmitter } from "./../../utils/events"
|
import { IlinkEmitter } from "./../../utils/events"
|
||||||
import { Header } from "react-native-elements";
|
import { Header } from "react-native-elements";
|
||||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||||
|
import { SafeAreaView } from 'react-navigation';
|
||||||
|
|
||||||
export default class Configurations extends BaseScreen {
|
export default class Configurations extends BaseScreen {
|
||||||
|
|
||||||
static navigationOptions = {
|
static navigationOptions = {
|
||||||
headerTItle: I18n.t('CONFIGURATIONS'),
|
headerTitle: I18n.t('CONFIGURATIONS'),
|
||||||
drawerIcon: ({ tintColor }) => (
|
drawerIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'settings'}
|
name={'settings'}
|
||||||
size={24}
|
size={24}
|
||||||
/>
|
/>
|
||||||
),
|
)
|
||||||
};
|
};
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props, true)
|
super(props, true)
|
||||||
this.state = this.initState()
|
this.state = this.initState()
|
||||||
this.configuration = new Configuration();
|
this.configuration = new Configuration();
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
SafeAreaView.setStatusBarHeight(StatusBar.currentHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initState() {
|
initState() {
|
||||||
|
|
@ -79,7 +83,7 @@ export default class Configurations extends BaseScreen {
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: 'white'
|
backgroundColor: 'white',
|
||||||
},
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
@ -1,104 +1,104 @@
|
||||||
import React, { Component,PureComponent } from 'react';
|
import React, { Component, PureComponent } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {StyleSheet,Text,View,FlatList} from 'react-native';
|
import { StyleSheet, Text, View, FlatList } from 'react-native';
|
||||||
import {responsiveFontSize,responsiveWidth,responsiveHeight} from 'react-native-responsive-dimensions';
|
import { responsiveFontSize, responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions';
|
||||||
|
|
||||||
export class DrawerItem extends React.PureComponent{
|
export class DrawerItem extends React.PureComponent {
|
||||||
|
|
||||||
render(){
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={style.content}>
|
<View style={style.content}>
|
||||||
<Text style={style.title}>{this.props.title}</Text>
|
<Text style={style.title}>{this.props.title}</Text>
|
||||||
<Text style={style.description}>{this.props.description}</Text>
|
<Text style={style.description}>{this.props.description}</Text>
|
||||||
<View style={style.timeContent}>
|
<View style={style.timeContent}>
|
||||||
<Text style={style.time}>{this.props.time}</Text>
|
<Text style={style.time}>{this.props.time}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={style.bottomSeparator}/>
|
<View style={style.bottomSeparator} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export class DrawerListItem extends PureComponent{
|
export class DrawerListItem extends PureComponent {
|
||||||
state = {selected: (new Map(): Map<string, boolean>)};
|
state = { selected: (new Map(): Map<string, boolean>) };
|
||||||
|
|
||||||
_keyExtractor = (item, index) => item.id;
|
_keyExtractor = (item, index) => item.id;
|
||||||
|
|
||||||
_onPressItem = (id: string) => {
|
_onPressItem = (id: string) => {
|
||||||
this.setState((state) => {
|
this.setState((state) => {
|
||||||
const selected = new Map(state.selected);
|
const selected = new Map(state.selected);
|
||||||
selected.set(id, !selected.get(id)); // toggle
|
selected.set(id, !selected.get(id)); // toggle
|
||||||
return {selected};
|
return { selected };
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
_renderItem = ({item}) => (
|
_renderItem = ({ item }) => (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
title={item.title}
|
title={item.title}
|
||||||
description={item.description}
|
description={item.description}
|
||||||
time={item.time}
|
time={item.time}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<FlatList
|
||||||
data={[{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
data={[{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
{title:'titre de la demande',description:'test description de la demande',time:'Hier'},
|
{ title: 'titre de la demande', description: 'test description de la demande', time: 'Hier' },
|
||||||
]}
|
]}
|
||||||
extraData={this.state}
|
extraData={this.state}
|
||||||
keyExtractor={this._keyExtractor}
|
keyExtractor={this._keyExtractor}
|
||||||
renderItem={this._renderItem}
|
renderItem={this._renderItem}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const style=StyleSheet.create({
|
const style = StyleSheet.create({
|
||||||
content:{
|
content: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
height:responsiveHeight(12),
|
height: responsiveHeight(12),
|
||||||
borderBottomColor: '#FFFFFF',
|
borderBottomColor: '#FFFFFF',
|
||||||
flex:1,
|
flex: 1,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
|
|
||||||
},
|
},
|
||||||
bottomSeparator:{
|
bottomSeparator: {
|
||||||
width:responsiveWidth(80),
|
width: responsiveWidth(80),
|
||||||
height:1,
|
height: 1,
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
|
|
||||||
backgroundColor:'#4f5b62',
|
backgroundColor: '#4f5b62',
|
||||||
},
|
},
|
||||||
title:{
|
title: {
|
||||||
color:'#000',
|
color: '#000',
|
||||||
fontSize:responsiveFontSize(2.2)
|
fontSize: responsiveFontSize(2.2)
|
||||||
},
|
},
|
||||||
description:{
|
description: {
|
||||||
fontSize:responsiveFontSize(1.8),
|
fontSize: responsiveFontSize(1.8),
|
||||||
color:'#4f5b62',
|
color: '#4f5b62',
|
||||||
|
|
||||||
},
|
},
|
||||||
timeContent:{
|
timeContent: {
|
||||||
justifyContent:'flex-end',
|
justifyContent: 'flex-end',
|
||||||
flex:1,
|
flex: 1,
|
||||||
alignItems: 'flex-end',
|
alignItems: 'flex-end',
|
||||||
},
|
},
|
||||||
time:{
|
time: {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color:'#263238',
|
color: '#263238',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -1,58 +1,57 @@
|
||||||
import React, { Component,PureComponent } from 'react';
|
import React, { Component, PureComponent } from 'react';
|
||||||
|
|
||||||
import {Platform, StyleSheet,FlatList, Text, View} from 'react-native';
|
import { Platform, StyleSheet, FlatList, Text, View } from 'react-native';
|
||||||
import ActionButton from 'react-native-action-button';
|
import ActionButton from 'react-native-action-button';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Ionicons';
|
||||||
import {responsiveFontSize,responsiveHeight,responsiveWidth} from 'react-native-responsive-dimensions';
|
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
import {HistoryListItem} from '../history-request/HistoryItem';
|
import { HistoryListItem } from '../history-request/HistoryItem';
|
||||||
|
|
||||||
|
|
||||||
export class ListOptions extends Component{
|
export class ListOptions extends Component {
|
||||||
|
|
||||||
render () {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<HistoryListItem
|
<HistoryListItem
|
||||||
style={styles.listbackground}/>
|
style={styles.listbackground} />
|
||||||
<ActionButton>
|
<ActionButton>
|
||||||
<ActionButton.Item buttonColor='#9b59b6' title="Faire une demande" onPress={() => console.log("notes tapped!")}>
|
<ActionButton.Item buttonColor='#9b59b6' title="Faire une demande" onPress={() => console.log("notes tapped!")}>
|
||||||
<Icon name="md-create" style={styles.actionButtonIcon} />
|
<Icon name="md-create" style={styles.actionButtonIcon} />
|
||||||
</ActionButton.Item>
|
</ActionButton.Item>
|
||||||
<ActionButton.Item buttonColor='#3498db' title="Enregistrer l'historique" onPress={() => {}}>
|
<ActionButton.Item buttonColor='#3498db' title="Enregistrer l'historique" onPress={() => { }}>
|
||||||
<Icon name="md-save" style={styles.actionButtonIcon} />
|
<Icon name="md-save" style={styles.actionButtonIcon} />
|
||||||
</ActionButton.Item>
|
</ActionButton.Item>
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
backgroundd_drawer:{
|
|
||||||
backgroundColor:'#000',
|
|
||||||
},
|
|
||||||
listbackground:{
|
|
||||||
},
|
|
||||||
actionButtonIcon: {
|
|
||||||
fontSize: 20,
|
|
||||||
height: 22,
|
|
||||||
color: 'white',
|
|
||||||
},
|
|
||||||
welcome: {
|
|
||||||
fontSize: 20,
|
|
||||||
textAlign: 'center',
|
|
||||||
margin: 10,
|
|
||||||
},
|
|
||||||
instructions: {
|
|
||||||
textAlign: 'center',
|
|
||||||
color: '#333333',
|
|
||||||
marginBottom: 5,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
backgroundd_drawer: {
|
||||||
|
backgroundColor: '#000',
|
||||||
|
},
|
||||||
|
listbackground: {
|
||||||
|
},
|
||||||
|
actionButtonIcon: {
|
||||||
|
fontSize: 20,
|
||||||
|
height: 22,
|
||||||
|
color: 'white',
|
||||||
|
},
|
||||||
|
welcome: {
|
||||||
|
fontSize: 20,
|
||||||
|
textAlign: 'center',
|
||||||
|
margin: 10,
|
||||||
|
},
|
||||||
|
instructions: {
|
||||||
|
textAlign: 'center',
|
||||||
|
color: '#333333',
|
||||||
|
marginBottom: 5,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ require("./../../utils/Translations");
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
const route = require('./../../route.json')
|
const route = require('./../../route.json')
|
||||||
import LottieView from 'lottie-react-native'; // if you have "esModuleInterop": true
|
import LottieView from 'lottie-react-native'; // if you have "esModuleInterop": true
|
||||||
import { IndicatorViewPager } from 'react-native-best-viewpager';
|
import { IndicatorViewPager, PagerTabIndicator } from 'react-native-best-viewpager';
|
||||||
|
|
||||||
import { Card, CardTitle, CardContent, CardAction, CardButton, CardImage } from 'react-native-material-cards'
|
import { Card, CardTitle, CardContent, CardAction, CardButton, CardImage } from 'react-native-material-cards'
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import React, { Component,PureComponent } from 'react';
|
import React, { Component, PureComponent } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {StyleSheet,Text,View,FlatList,TouchableOpacity,SectionList,RefreshControl} from 'react-native';
|
import { StyleSheet, Text, View, FlatList, TouchableOpacity, SectionList, RefreshControl } from 'react-native';
|
||||||
import {responsiveFontSize,responsiveWidth,responsiveHeight} from 'react-native-responsive-dimensions';
|
import { responsiveFontSize, responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions';
|
||||||
import {convertDateToHumanText} from './../../utils/DateUtils';
|
import { convertDateToHumanText } from './../../utils/DateUtils';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
var moment=require('moment-timezone')
|
var moment = require('moment-timezone')
|
||||||
const momentJS=require('moment')
|
const momentJS = require('moment')
|
||||||
import I18n from "react-native-i18n"
|
import I18n from "react-native-i18n"
|
||||||
|
|
||||||
import 'moment/locale/fr'
|
import 'moment/locale/fr'
|
||||||
|
|
@ -16,230 +16,232 @@ import 'moment/locale/en-ie'
|
||||||
import 'moment/locale/en-il'
|
import 'moment/locale/en-il'
|
||||||
import 'moment/locale/en-nz'
|
import 'moment/locale/en-nz'
|
||||||
|
|
||||||
let route=require('./../../route.json');
|
let route = require('./../../route.json');
|
||||||
var theme=require('./../../utils/theme.json');
|
var theme = require('./../../utils/theme.json');
|
||||||
|
|
||||||
export class HistoryItem extends React.Component{
|
export class HistoryItem extends React.Component {
|
||||||
|
|
||||||
constructor(props){
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state=this.initState();
|
this.state = this.initState();
|
||||||
}
|
}
|
||||||
initState(){
|
initState() {
|
||||||
var textTitle=' Transaction '+this.props.selfData.id;
|
var textTitle = ' Transaction ' + this.props.selfData.id;
|
||||||
var textDescription=I18n.t('PHONE')+' '+this.props.selfData.phone+" "+I18n.t('DEMAND_TEXT_FIRST_PART')+' '+(this.props.selfData.montant)+' '+I18n.t('TO_')+' ';
|
var textDescription = I18n.t('PHONE') + ' ' + this.props.selfData.phone + " " + I18n.t('DEMAND_TEXT_FIRST_PART') + ' ' + (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ';
|
||||||
textDescription+=this.props.selfData.reseau;
|
textDescription += this.props.selfData.reseau;
|
||||||
var today=new Date();
|
var today = new Date();
|
||||||
var l=this.props.selfData.date_creation;
|
var l = this.props.selfData.date_creation;
|
||||||
let t=this.props.selfData.status;
|
let t = this.props.selfData.status;
|
||||||
moment.locale(I18n.locale)
|
moment.locale(I18n.locale)
|
||||||
var re= moment.tz(this.props.selfData.date_creation,'Etc/GMT+0').format();
|
var re = moment.tz(this.props.selfData.date_creation, 'Etc/GMT+0').format();
|
||||||
re=moment(re)
|
re = moment(re)
|
||||||
return {
|
return {
|
||||||
title:textTitle,
|
title: textTitle,
|
||||||
description:textDescription,
|
description: textDescription,
|
||||||
status:this.props.selfData.status==='1'?I18n.t('TREAT'):I18n.t('NO_TREAT'),
|
status: this.props.selfData.status === '1' ? I18n.t('TREAT') : I18n.t('NO_TREAT'),
|
||||||
time:re.fromNow(),
|
time: re.fromNow(),
|
||||||
navigator:this.props.navigator,
|
navigator: this.props.navigator,
|
||||||
type:t,
|
type: t,
|
||||||
colorstate:t==='1'?'green':'red'
|
colorstate: t === '1' ? 'green' : 'red'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render(){
|
render() {
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={()=>
|
<TouchableOpacity onPress={() =>
|
||||||
this.props.navigator.navigate(route.historyItemDetails,
|
this.props.navigator.navigate(route.historyItemDetails,
|
||||||
{item:this.props.selfData}
|
{ item: this.props.selfData }
|
||||||
|
|
||||||
)}>
|
)}>
|
||||||
<View style={style.content}>
|
<View style={style.content}>
|
||||||
<Text style={style.title}>{this.state.title}</Text>
|
<Text style={style.title}>{this.state.title}</Text>
|
||||||
<Text style={style.description}>{this.state.description}</Text>
|
<Text style={style.description}>{this.state.description}</Text>
|
||||||
<View style={style.timeContent}>
|
<View style={style.timeContent}>
|
||||||
<Text style={{
|
<Text style={{
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
marginLeft: 20,
|
marginLeft: 20,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color:this.state.colorstate,
|
color: this.state.colorstate,
|
||||||
|
|
||||||
}}>{this.state.status}</Text>
|
}}>{this.state.status}</Text>
|
||||||
<Text style={style.time}>{this.state.time}</Text>
|
<Text style={style.time}>{this.state.time}</Text>
|
||||||
</View>
|
</View>
|
||||||
<View style={style.bottomSeparator}/>
|
<View style={style.bottomSeparator} />
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export class HistoryItemSectionned extends PureComponent{
|
export class HistoryItemSectionned extends PureComponent {
|
||||||
_keyExtractor = (item, index) => item.id;
|
_keyExtractor = (item, index) => item.id;
|
||||||
_renderItem = ({item}) => (
|
_renderItem = ({ item }) => (
|
||||||
<HistoryItem
|
<HistoryItem
|
||||||
navigator={this.props.navigator}
|
navigator={this.props.navigator}
|
||||||
selfData={item}
|
selfData={item}
|
||||||
/>
|
|
||||||
);
|
|
||||||
constructor(props){
|
|
||||||
super(props);
|
|
||||||
this.state=this.initState();
|
|
||||||
}
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
|
|
||||||
<SectionList
|
|
||||||
sections={[
|
|
||||||
{title:'Demande traité',type:0,data:this.state.treat,size:this.state.conservetreat.length,expandState:this.state.istreatexpand},
|
|
||||||
{title:'Demande non traité',type:1,data:this.state.untreat,size:this.state.conserveuntreat.length,expandState:this.state.isuntreatexpand}
|
|
||||||
]}
|
|
||||||
renderSectionHeader={({section: {title,type,data,size,expandState}}) => (
|
|
||||||
<TouchableOpacity onPress={()=>this.onPressedHeader(type)} style={{
|
|
||||||
backgroundColor:theme.accent,
|
|
||||||
justifyContent:'center',
|
|
||||||
alignItems:'center',
|
|
||||||
flexDirection:'row',flex:1,height:70,width:responsiveWidth(100)}}>
|
|
||||||
<View style={{
|
|
||||||
height:70,
|
|
||||||
justifyContent:'center',
|
|
||||||
flex:1,
|
|
||||||
width:responsiveWidth(100),
|
|
||||||
}}>
|
|
||||||
<Text style={{fontWeight: 'bold',
|
|
||||||
marginLeft:20,
|
|
||||||
fontSize:20,
|
|
||||||
color:'white'
|
|
||||||
}}>{title}</Text>
|
|
||||||
<Text style={{
|
|
||||||
fontWeight: 'bold',
|
|
||||||
marginLeft: 20,
|
|
||||||
fontSize: 16,
|
|
||||||
color: 'white'
|
|
||||||
}}>{size} demande(s)</Text>
|
|
||||||
</View>
|
|
||||||
<Icon name={expandState?'sort-up':'sort-down'} size={30} color={'white'} style={{marginRight:20}}/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)}
|
|
||||||
style={style.listStyle}
|
|
||||||
extraData={this.state}
|
|
||||||
keyExtractor={this._keyExtractor}
|
|
||||||
renderItem={this._renderItem}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
onPressedHeader(type){
|
|
||||||
if(type===0){
|
|
||||||
this.setState({istreatexpand:!this.state.istreatexpand,treat:this.state.istreatexpand?[]:this.state.conservetreat})
|
|
||||||
}else{
|
|
||||||
this.setState({isuntreatexpand:!this.state.isuntreatexpand,untreat:this.state.isuntreatexpand?[]:this.state.conserveuntreat})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
initState(){
|
|
||||||
let data=this.props.list
|
|
||||||
|
|
||||||
return {
|
|
||||||
conservetreat: data.filter(item=>item.statut===I18n.t('TREAT')),
|
|
||||||
treat: data.filter(item=>item.statut===I18n.t('TREAT')),
|
|
||||||
istreatexpand:true,
|
|
||||||
conserveuntreat: data.filter(item=>item.statut!==I18n.t('TREAT')),
|
|
||||||
untreat: data.filter(item=>item.statut!==I18n.t('TREAT')),
|
|
||||||
isuntreatexpand:true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export class HistoryListItem extends React.Component{
|
|
||||||
_keyExtractor = (item, index) => item.id;
|
|
||||||
|
|
||||||
_onPressItem = (id: string) => {
|
|
||||||
|
|
||||||
};
|
|
||||||
_renderItem = ({item}) => (
|
|
||||||
<HistoryItem
|
|
||||||
navigator={this.props.navigator}
|
|
||||||
selfData={item}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
constructor(props){
|
|
||||||
super(props);
|
|
||||||
this.state=this.initState();
|
|
||||||
}
|
|
||||||
initState(){
|
|
||||||
return {
|
|
||||||
refreshing:false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<FlatList
|
|
||||||
style={style.listStyle}
|
|
||||||
data={this.props.list}
|
|
||||||
extraData={this.state}
|
|
||||||
keyExtractor={this._keyExtractor}
|
|
||||||
renderItem={this._renderItem}
|
|
||||||
refreshControl={
|
|
||||||
<RefreshControl
|
|
||||||
refreshing={this.props.isRefreshing}
|
|
||||||
colors={[theme.primary,theme.purpleLight,theme.reddeconnect,theme.accentLight]}
|
|
||||||
onRefresh={this.props.refreshing}
|
|
||||||
/>
|
/>
|
||||||
}
|
);
|
||||||
/>
|
constructor(props) {
|
||||||
);
|
super(props);
|
||||||
}
|
this.state = this.initState();
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
|
||||||
_onRefresh(){
|
<SectionList
|
||||||
this.setState({refreshing:true})
|
sections={[
|
||||||
setTimeout(()=>{this.setState({refreshing:false})},5000);
|
{ title: 'Demande traité', type: 0, data: this.state.treat, size: this.state.conservetreat.length, expandState: this.state.istreatexpand },
|
||||||
}
|
{ title: 'Demande non traité', type: 1, data: this.state.untreat, size: this.state.conserveuntreat.length, expandState: this.state.isuntreatexpand }
|
||||||
|
]}
|
||||||
|
renderSectionHeader={({ section: { title, type, data, size, expandState } }) => (
|
||||||
|
<TouchableOpacity onPress={() => this.onPressedHeader(type)} style={{
|
||||||
|
backgroundColor: theme.accent,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
flexDirection: 'row', flex: 1, height: 70, width: responsiveWidth(100)
|
||||||
|
}}>
|
||||||
|
<View style={{
|
||||||
|
height: 70,
|
||||||
|
justifyContent: 'center',
|
||||||
|
flex: 1,
|
||||||
|
width: responsiveWidth(100),
|
||||||
|
}}>
|
||||||
|
<Text style={{
|
||||||
|
fontWeight: 'bold',
|
||||||
|
marginLeft: 20,
|
||||||
|
fontSize: 20,
|
||||||
|
color: 'white'
|
||||||
|
}}>{title}</Text>
|
||||||
|
<Text style={{
|
||||||
|
fontWeight: 'bold',
|
||||||
|
marginLeft: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
color: 'white'
|
||||||
|
}}>{size} demande(s)</Text>
|
||||||
|
</View>
|
||||||
|
<Icon name={expandState ? 'sort-up' : 'sort-down'} size={30} color={'white'} style={{ marginRight: 20 }} />
|
||||||
|
</TouchableOpacity>
|
||||||
|
)}
|
||||||
|
style={style.listStyle}
|
||||||
|
extraData={this.state}
|
||||||
|
keyExtractor={this._keyExtractor}
|
||||||
|
renderItem={this._renderItem}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
onPressedHeader(type) {
|
||||||
|
if (type === 0) {
|
||||||
|
this.setState({ istreatexpand: !this.state.istreatexpand, treat: this.state.istreatexpand ? [] : this.state.conservetreat })
|
||||||
|
} else {
|
||||||
|
this.setState({ isuntreatexpand: !this.state.isuntreatexpand, untreat: this.state.isuntreatexpand ? [] : this.state.conserveuntreat })
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
initState() {
|
||||||
|
let data = this.props.list
|
||||||
|
|
||||||
|
return {
|
||||||
|
conservetreat: data.filter(item => item.statut === I18n.t('TREAT')),
|
||||||
|
treat: data.filter(item => item.statut === I18n.t('TREAT')),
|
||||||
|
istreatexpand: true,
|
||||||
|
conserveuntreat: data.filter(item => item.statut !== I18n.t('TREAT')),
|
||||||
|
untreat: data.filter(item => item.statut !== I18n.t('TREAT')),
|
||||||
|
isuntreatexpand: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class HistoryListItem extends React.Component {
|
||||||
|
_keyExtractor = (item, index) => item.id;
|
||||||
|
|
||||||
|
_onPressItem = (id: string) => {
|
||||||
|
|
||||||
|
};
|
||||||
|
_renderItem = ({ item }) => (
|
||||||
|
<HistoryItem
|
||||||
|
navigator={this.props.navigator}
|
||||||
|
selfData={item}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = this.initState();
|
||||||
|
}
|
||||||
|
initState() {
|
||||||
|
return {
|
||||||
|
refreshing: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<FlatList
|
||||||
|
style={style.listStyle}
|
||||||
|
data={this.props.list}
|
||||||
|
extraData={this.state}
|
||||||
|
keyExtractor={this._keyExtractor}
|
||||||
|
renderItem={this._renderItem}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={this.props.isRefreshing}
|
||||||
|
colors={[theme.primary, theme.purpleLight, theme.reddeconnect, theme.accentLight]}
|
||||||
|
onRefresh={this.props.refreshing}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onRefresh() {
|
||||||
|
this.setState({ refreshing: true })
|
||||||
|
setTimeout(() => { this.setState({ refreshing: false }) }, 5000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const style=StyleSheet.create({
|
const style = StyleSheet.create({
|
||||||
content:{
|
content: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
borderBottomColor: '#FFFFFF',
|
borderBottomColor: '#FFFFFF',
|
||||||
flex:1,
|
flex: 1,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
|
|
||||||
},
|
},
|
||||||
listStyle:{
|
listStyle: {
|
||||||
backgroundColor:'white'
|
backgroundColor: 'white'
|
||||||
},
|
},
|
||||||
bottomSeparator:{
|
bottomSeparator: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
height:5,
|
height: 5,
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
backgroundColor:'#EEE',
|
backgroundColor: '#EEE',
|
||||||
},
|
},
|
||||||
title:{
|
title: {
|
||||||
color:'#000',
|
color: '#000',
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
fontSize:responsiveFontSize(2.2)
|
fontSize: responsiveFontSize(2.2)
|
||||||
},
|
},
|
||||||
description:{
|
description: {
|
||||||
fontSize:responsiveFontSize(1.8),
|
fontSize: responsiveFontSize(1.8),
|
||||||
color:'#4f5b62',
|
color: '#4f5b62',
|
||||||
paddingLeft: 10,
|
paddingLeft: 10,
|
||||||
|
|
||||||
},
|
},
|
||||||
timeContent:{
|
timeContent: {
|
||||||
justifyContent:'space-between',
|
justifyContent: 'space-between',
|
||||||
flex:1,
|
flex: 1,
|
||||||
marginTop: 10,
|
marginTop: 10,
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
flexDirection:'row',
|
flexDirection: 'row',
|
||||||
},
|
},
|
||||||
time:{
|
time: {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
marginRight: 20,
|
marginRight: 20,
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color:theme.accent,
|
color: theme.accent,
|
||||||
},
|
},
|
||||||
treat:{
|
treat: {
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
4394
screens/home/Home.js
|
|
@ -1,281 +1,286 @@
|
||||||
import React,{PureComponent} from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import MapView,{Marker,MarkerAnimated} from "react-native-maps"
|
import MapView, { Marker, MarkerAnimated } from "react-native-maps"
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {
|
import {
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
View,
|
View,
|
||||||
Image,
|
Image,
|
||||||
Text,
|
Text,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
const theme=require("../../utils/theme");
|
const theme = require("../../utils/theme");
|
||||||
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
|
import { responsiveHeight, responsiveWidth } from "react-native-responsive-dimensions";
|
||||||
import IMarker from "./IMarker";
|
import IMarker from "./IMarker";
|
||||||
import I18n from "react-native-i18n";
|
import I18n from "react-native-i18n";
|
||||||
import MapViewDirections from 'react-native-maps-directions';
|
import MapViewDirections from 'react-native-maps-directions';
|
||||||
const API_KEY="AIzaSyAYOEp-Pckvc3TwOIulCICokKgmp14rGHI";
|
const API_KEY = "AIzaSyAYOEp-Pckvc3TwOIulCICokKgmp14rGHI";
|
||||||
const mnetwork=require('./../../datas/img/png/home_network.png');
|
const mnetwork = require('./../../datas/img/png/home_network.png');
|
||||||
const othernetwork=require('./../../datas/img/png/other_net.png');
|
const othernetwork = require('./../../datas/img/png/other_net.png');
|
||||||
import { copilot, CopilotStep } from 'react-native-copilot';
|
import { copilot, CopilotStep } from 'react-native-copilot';
|
||||||
|
|
||||||
class IMap extends PureComponent {
|
class IMap extends PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
markers: PropTypes.array,
|
markers: PropTypes.array,
|
||||||
map:PropTypes.object,
|
map: PropTypes.object,
|
||||||
network:PropTypes.object,
|
network: PropTypes.object,
|
||||||
myNetwork:PropTypes.object,
|
myNetwork: PropTypes.object,
|
||||||
selectedMarker:PropTypes.object,
|
selectedMarker: PropTypes.object,
|
||||||
myPosition:PropTypes.object,
|
myPosition: PropTypes.object,
|
||||||
onMarkerClick:PropTypes.func,
|
onMarkerClick: PropTypes.func,
|
||||||
initialRegion:PropTypes.object,
|
initialRegion: PropTypes.object,
|
||||||
typeMap:PropTypes.string,
|
typeMap: PropTypes.string,
|
||||||
needRoad:PropTypes.bool,
|
needRoad: PropTypes.bool,
|
||||||
isNeedUserFocus:PropTypes.bool,
|
isNeedUserFocus: PropTypes.bool,
|
||||||
onNeedRoadReady:PropTypes.func,
|
onNeedRoadReady: PropTypes.func,
|
||||||
onNeedRoadError:PropTypes.func,
|
onNeedRoadError: PropTypes.func,
|
||||||
onMapReady:PropTypes.func
|
onMapReady: PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
isNeedUserFocus:false
|
isNeedUserFocus: false
|
||||||
};
|
};
|
||||||
constructor(props){
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state={
|
this.state = {
|
||||||
markers:[],
|
markers: [],
|
||||||
roadReady:false,
|
roadReady: false,
|
||||||
isNeedUserFocus:false,
|
isNeedUserFocus: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mapRef = (ref) => {
|
mapRef = (ref) => {
|
||||||
this.mapview = ref
|
this.mapview = ref
|
||||||
}
|
}
|
||||||
|
|
||||||
getMapRef = () => this.mapview
|
getMapRef = () => this.mapview
|
||||||
componentWillReceiveProps(nextProps: Readonly<P>, nextContext: any): void {
|
componentWillReceiveProps(nextProps: Readonly<P>, nextContext: any): void {
|
||||||
const markers=this.state.markers
|
const markers = this.state.markers
|
||||||
const newmarkers=nextProps.markers
|
const newmarkers = nextProps.markers
|
||||||
if(markers.length<=0)
|
if (markers.length <= 0)
|
||||||
this.setState({markers:newmarkers})
|
this.setState({ markers: newmarkers })
|
||||||
else if(markers.length!==newmarkers){
|
else if (markers.length !== newmarkers) {
|
||||||
this.setState({markers:newmarkers})
|
this.setState({ markers: newmarkers })
|
||||||
}
|
}
|
||||||
this.setState({isNeedUserFocus:nextProps.isNeedUserFocus})
|
this.setState({ isNeedUserFocus: nextProps.isNeedUserFocus })
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render() {
|
||||||
const {markers,initialRegion,myPosition,myNetwork,typeMap,selectedMarker}=this.props
|
const { markers, initialRegion, myPosition, myNetwork, typeMap, selectedMarker } = this.props
|
||||||
if(initialRegion!==null && myNetwork!==null)
|
if (initialRegion !== null && myNetwork !== null)
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<MapView
|
<MapView
|
||||||
style={{flex: 1}}
|
style={{ flex: 1 }}
|
||||||
initialRegion={initialRegion}
|
initialRegion={initialRegion}
|
||||||
mapType={typeMap}
|
mapType={typeMap}
|
||||||
ref={(re) => this.mapview = re}
|
ref={(re) => this.mapview = re}
|
||||||
onMapReady={this.props.onMapReady}
|
onMapReady={this.props.onMapReady}
|
||||||
onRegionChangeComplete={(re)=>{this.onRegionChangeOver(re)}}>
|
onRegionChangeComplete={(re) => { this.onRegionChangeOver(re) }}>
|
||||||
{this.state.markers.map((item,index)=>{
|
{this.state.markers.map((item, index) => {
|
||||||
|
return (
|
||||||
|
<IMarker
|
||||||
|
isUser={false}
|
||||||
|
title={item.lastname}
|
||||||
|
isSelected={(selectedMarker && selectedMarker.id === item.id)}
|
||||||
|
data={item}
|
||||||
|
onPress={(e, marker) => this.props.onMarkerClick(e, marker)}
|
||||||
|
network={myNetwork}
|
||||||
|
/>)
|
||||||
|
})}
|
||||||
|
{this.renderMyPosition()}
|
||||||
|
{this.makeDirection()}
|
||||||
|
|
||||||
|
</MapView>
|
||||||
|
</View>)
|
||||||
|
else return (<View />)
|
||||||
|
}
|
||||||
|
focusToUser() {
|
||||||
|
this.setState({ isNeedUserFocus: true })
|
||||||
|
}
|
||||||
|
closeUserFocus() {
|
||||||
|
this.setState({ isNeedUserFocus: false })
|
||||||
|
}
|
||||||
|
onRegionChangeOver(region) {
|
||||||
|
|
||||||
|
}
|
||||||
|
makeDirection() {
|
||||||
|
let { myPosition, selectedMarker, needRoad } = this.props
|
||||||
|
if (myPosition !== null && selectedMarker !== null && selectedMarker !== undefined && myPosition !== undefined && needRoad) {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (!this.state.roadReady) {
|
||||||
|
this.setState({ roadReady: true })
|
||||||
|
this.props.onNeedRoadError()
|
||||||
|
}
|
||||||
|
}, 10000)
|
||||||
|
|
||||||
|
return (<MapViewDirections
|
||||||
|
origin={myPosition}
|
||||||
|
destination={selectedMarker}
|
||||||
|
apikey={API_KEY}
|
||||||
|
strokeWidth={3}
|
||||||
|
onReady={(data) => {
|
||||||
|
this.setState({ roadReady: true })
|
||||||
|
this.props.onNeedRoadReady(data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onError={() => {
|
||||||
|
this.setState({ roadReady: true })
|
||||||
|
this.props.onNeedRoadError()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
strokeColor={theme.primary}
|
||||||
|
/>)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
renderMyPosition() {
|
||||||
|
const { myPosition, myNetwork } = this.props
|
||||||
|
if (myPosition != null) {
|
||||||
|
if (false) {
|
||||||
return (
|
return (
|
||||||
<IMarker
|
<CopilotStep>
|
||||||
isUser={false}
|
<IMarker
|
||||||
title={item.lastname}
|
|
||||||
isSelected={(selectedMarker && selectedMarker.id===item.id)}
|
isUser={true}
|
||||||
data={item}
|
lang={this.props.lang}
|
||||||
onPress={(e,marker)=>this.props.onMarkerClick(e,marker)}
|
isNeedFocus={this.state.isNeedUserFocus}
|
||||||
network={myNetwork}
|
title={I18n.t("YOUR_THERE")}
|
||||||
|
data={{
|
||||||
|
longitude: myPosition.longitude,
|
||||||
|
latitude: myPosition.latitude
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</CopilotStep>
|
||||||
|
)
|
||||||
|
} else
|
||||||
|
return (<IMarker
|
||||||
|
isUser={true}
|
||||||
|
lang={this.props.lang}
|
||||||
|
isNeedFocus={this.state.isNeedUserFocus}
|
||||||
|
title={I18n.t("YOUR_THERE")}
|
||||||
|
data={{
|
||||||
|
longitude: myPosition.longitude,
|
||||||
|
latitude: myPosition.latitude
|
||||||
|
}}
|
||||||
/>)
|
/>)
|
||||||
})}
|
}
|
||||||
{this.renderMyPosition()}
|
}
|
||||||
{this.makeDirection()}
|
}
|
||||||
|
|
||||||
</MapView>
|
|
||||||
</View>)
|
|
||||||
else return(<View/>)
|
|
||||||
}
|
|
||||||
focusToUser(){
|
|
||||||
this.setState({isNeedUserFocus:true})
|
|
||||||
}
|
|
||||||
closeUserFocus(){
|
|
||||||
this.setState({isNeedUserFocus:false})
|
|
||||||
}
|
|
||||||
onRegionChangeOver(region){
|
|
||||||
|
|
||||||
}
|
|
||||||
makeDirection() {
|
|
||||||
let {myPosition, selectedMarker,needRoad} = this.props
|
|
||||||
if (myPosition !== null && selectedMarker !== null && selectedMarker !== undefined && myPosition !== undefined && needRoad) {
|
|
||||||
setTimeout(()=>{
|
|
||||||
if(!this.state.roadReady){
|
|
||||||
this.setState({roadReady:true})
|
|
||||||
this.props.onNeedRoadError()}
|
|
||||||
},10000)
|
|
||||||
|
|
||||||
return (<MapViewDirections
|
|
||||||
origin={myPosition}
|
|
||||||
destination={selectedMarker}
|
|
||||||
apikey={API_KEY}
|
|
||||||
strokeWidth={3}
|
|
||||||
onReady={(data)=>{
|
|
||||||
this.setState({roadReady:true})
|
|
||||||
this.props.onNeedRoadReady(data)}
|
|
||||||
}
|
|
||||||
onError={()=>{
|
|
||||||
this.setState({roadReady:true})
|
|
||||||
this.props.onNeedRoadError()}
|
|
||||||
}
|
|
||||||
strokeColor={theme.primary}
|
|
||||||
/>)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
renderMyPosition() {
|
|
||||||
const {myPosition,myNetwork}=this.props
|
|
||||||
if(myPosition!=null){
|
|
||||||
if(false){
|
|
||||||
return (
|
|
||||||
<CopilotStep>
|
|
||||||
<IMarker
|
|
||||||
|
|
||||||
isUser={true}
|
|
||||||
lang={this.props.lang}
|
|
||||||
isNeedFocus={this.state.isNeedUserFocus}
|
|
||||||
title={I18n.t("YOUR_THERE")}
|
|
||||||
data={{
|
|
||||||
longitude:myPosition.longitude,
|
|
||||||
latitude:myPosition.latitude}}
|
|
||||||
/>
|
|
||||||
</CopilotStep>
|
|
||||||
)
|
|
||||||
}else
|
|
||||||
return (<IMarker
|
|
||||||
isUser={true}
|
|
||||||
lang={this.props.lang}
|
|
||||||
isNeedFocus={this.state.isNeedUserFocus}
|
|
||||||
title={I18n.t("YOUR_THERE")}
|
|
||||||
data={{
|
|
||||||
longitude:myPosition.longitude,
|
|
||||||
latitude:myPosition.latitude}}
|
|
||||||
/>)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export default IMap;
|
export default IMap;
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: '#FFF',
|
backgroundColor: '#FFF',
|
||||||
},
|
},
|
||||||
myClusterTextStyle:{
|
myClusterTextStyle: {
|
||||||
color:"white"
|
color: "white"
|
||||||
},
|
},
|
||||||
myClusterStyle: {
|
myClusterStyle: {
|
||||||
backgroundColor:theme.accent,
|
backgroundColor: theme.accent,
|
||||||
height:32,
|
height: 32,
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignItems:'center',
|
alignItems: 'center',
|
||||||
width:32,
|
width: 32,
|
||||||
borderRadius:16
|
borderRadius: 16
|
||||||
},
|
},
|
||||||
rowContainer: {
|
rowContainer: {
|
||||||
height: 52,
|
height: 52,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'flex-start',
|
justifyContent: 'flex-start',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
iconContainer: {
|
iconContainer: {
|
||||||
marginRight: 16,
|
marginRight: 16,
|
||||||
},
|
},
|
||||||
mapmarker:{
|
mapmarker: {
|
||||||
width:52,
|
width: 52,
|
||||||
height:52,
|
height: 52,
|
||||||
},
|
},
|
||||||
slidingup:{
|
slidingup: {
|
||||||
backgroundColor:"transparent",
|
backgroundColor: "transparent",
|
||||||
position:"absolute",
|
position: "absolute",
|
||||||
height:300,
|
height: 300,
|
||||||
bottom:0,
|
bottom: 0,
|
||||||
right:35,
|
right: 35,
|
||||||
zIndex: 1
|
zIndex: 1
|
||||||
},
|
},
|
||||||
panel: {
|
panel: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
position: 'relative'
|
position: 'relative'
|
||||||
},
|
},
|
||||||
panelHeader: {
|
panelHeader: {
|
||||||
height: 120,
|
height: 120,
|
||||||
backgroundColor: '#b197fc',
|
backgroundColor: '#b197fc',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'center'
|
justifyContent: 'center'
|
||||||
},
|
},
|
||||||
favoriteIcon: {
|
favoriteIcon: {
|
||||||
left: responsiveWidth(75),
|
left: responsiveWidth(75),
|
||||||
backgroundColor: theme.primary,
|
backgroundColor: theme.primary,
|
||||||
width: 64,
|
width: 64,
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignContent: 'center',
|
alignContent: 'center',
|
||||||
bottom:-64,
|
bottom: -64,
|
||||||
position:'absolute',
|
position: 'absolute',
|
||||||
height: 64,
|
height: 64,
|
||||||
padding: 8,
|
padding: 8,
|
||||||
zIndex:1,
|
zIndex: 1,
|
||||||
borderRadius: 32,
|
borderRadius: 32,
|
||||||
},
|
},
|
||||||
hambuger:{
|
hambuger: {
|
||||||
},
|
},
|
||||||
topBar:{
|
topBar: {
|
||||||
position:'absolute',
|
position: 'absolute',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
marginTop:responsiveHeight(4),
|
marginTop: responsiveHeight(4),
|
||||||
width:responsiveWidth(95),
|
width: responsiveWidth(95),
|
||||||
|
|
||||||
},
|
},
|
||||||
searchInput:{
|
searchInput: {
|
||||||
width:responsiveWidth(70),
|
width: responsiveWidth(70),
|
||||||
fontSize:14
|
fontSize: 14
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
width:responsiveWidth(70),
|
width: responsiveWidth(70),
|
||||||
height:responsiveHeight(10),
|
height: responsiveHeight(10),
|
||||||
backgroundColor:'#00000000',
|
backgroundColor: '#00000000',
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
map:{
|
map: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
height:responsiveHeight(100),
|
height: responsiveHeight(100),
|
||||||
},
|
},
|
||||||
backgroundd_drawer:{
|
backgroundd_drawer: {
|
||||||
backgroundColor:'#000',
|
backgroundColor: '#000',
|
||||||
},
|
},
|
||||||
cardsearch:{
|
cardsearch: {
|
||||||
width:responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
height:responsiveHeight(10),
|
height: responsiveHeight(10),
|
||||||
position:'absolute',
|
position: 'absolute',
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
marginTop: 5,
|
marginTop: 5,
|
||||||
|
|
||||||
},
|
},
|
||||||
actionButtonIcon: {
|
actionButtonIcon: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
height: 22,
|
height: 22,
|
||||||
|
|
||||||
color: 'white',
|
color: 'white',
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
instructions: {
|
instructions: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,246 +7,249 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Platform, StyleSheet,Alert,FlatList, Text, View,TouchableOpacity,Linking} from 'react-native';
|
import { Platform, StyleSheet, Alert, FlatList, Text, View, TouchableOpacity, Linking } from 'react-native';
|
||||||
import ActionButton from 'react-native-action-button';
|
import ActionButton from 'react-native-action-button';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Ionicons';
|
||||||
import {responsiveFontSize,responsiveHeight,responsiveWidth} from 'react-native-responsive-dimensions';
|
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
import HeaderMenu from './HeaderMenu';
|
import HeaderMenu from './HeaderMenu';
|
||||||
import {historiques as histo,first,useraccount,notification,configurations} from './../../route.json';
|
import { historiques as histo, first, useraccount, notification, configurations } from './../../route.json';
|
||||||
import {primary,primaryDarkAdvanced} from './../../utils/theme.json';
|
import { primary, primaryDarkAdvanced } from './../../utils/theme.json';
|
||||||
import {readUser,disconnect} from './../../webservice/AuthApi';
|
import { readUser, disconnect } from './../../webservice/AuthApi';
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
const route=require("./../../route.json")
|
const route = require("./../../route.json")
|
||||||
require('./../../utils/Translations')
|
require('./../../utils/Translations')
|
||||||
var DBEvents = require('react-native-db-models').DBEvents
|
var DBEvents = require('react-native-db-models').DBEvents
|
||||||
type Props = {};
|
type Props = {};
|
||||||
let theme=require('./../../utils/theme.json')
|
let theme = require('./../../utils/theme.json')
|
||||||
import Button from 'apsl-react-native-button'
|
import Button from 'apsl-react-native-button'
|
||||||
import {IlinkEmitter} from "./../../utils/events"
|
import { IlinkEmitter } from "./../../utils/events"
|
||||||
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
||||||
import DeviceInfo from "react-native-device-info"
|
import DeviceInfo from "react-native-device-info"
|
||||||
import AppContainer, {AppNavigator} from "../../App";
|
import AppContainer, { AppNavigator } from "../../App";
|
||||||
import Configuration from "../../webservice/persistences/Configuration";
|
import Configuration from "../../webservice/persistences/Configuration";
|
||||||
import { ScrollView } from 'react-native-gesture-handler';
|
import { ScrollView } from 'react-native-gesture-handler';
|
||||||
|
|
||||||
export default class OptionsMenu extends Component<Props> {
|
export default class OptionsMenu extends Component<Props> {
|
||||||
|
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
statusBarColor: primaryDarkAdvanced,
|
statusBarColor: primaryDarkAdvanced,
|
||||||
};
|
};
|
||||||
commandeListe
|
commandeListe
|
||||||
constructor(props){
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state=this.initState();
|
this.state = this.initState();
|
||||||
IlinkEmitter.on("menuLink", this.onMenuNavigationEvent.bind(this))
|
IlinkEmitter.on("menuLink", this.onMenuNavigationEvent.bind(this))
|
||||||
IlinkEmitter.on("userconnect", this.onUserConnect.bind(this))
|
IlinkEmitter.on("userconnect", this.onUserConnect.bind(this))
|
||||||
IlinkEmitter.on("userdisconnect", this.hideSideMenu.bind(this))
|
IlinkEmitter.on("userdisconnect", this.hideSideMenu.bind(this))
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
this.configuration=new Configuration();
|
this.configuration = new Configuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
retrieveAndroidInformation() {
|
retrieveAndroidInformation() {
|
||||||
this.configuration._getData().then((lang)=>{
|
this.configuration._getData().then((lang) => {
|
||||||
if(lang){
|
if (lang) {
|
||||||
I18n.locale=lang
|
I18n.locale = lang
|
||||||
readUser().then((result) => {
|
readUser().then((result) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateUser(result);
|
this.updateUser(result);
|
||||||
}, 3000)})
|
}, 3000)
|
||||||
}else{
|
})
|
||||||
let code= DeviceInfo.getDeviceLocale();
|
} else {
|
||||||
I18n.locale=code.toLowerCase()
|
let code = DeviceInfo.getDeviceLocale();
|
||||||
readUser().then((result) => {
|
I18n.locale = code.toLowerCase()
|
||||||
setTimeout(() => {
|
readUser().then((result) => {
|
||||||
this.updateUser(result);
|
setTimeout(() => {
|
||||||
}, 3000)
|
this.updateUser(result);
|
||||||
}).catch((e) => {
|
}, 3000)
|
||||||
this.props.navigation.navigate("Auth")
|
}).catch((e) => {
|
||||||
});
|
this.props.navigation.navigate("Auth")
|
||||||
}
|
});
|
||||||
}).catch((e)=>{
|
}
|
||||||
let code=DeviceInfo.getDeviceLocale()
|
}).catch((e) => {
|
||||||
I18n.locale=code.toLowerCase()
|
let code = DeviceInfo.getDeviceLocale()
|
||||||
readUser().then((result) => {
|
I18n.locale = code.toLowerCase()
|
||||||
setTimeout(() => {
|
readUser().then((result) => {
|
||||||
this.updateUser(result);
|
setTimeout(() => {
|
||||||
|
this.updateUser(result);
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.props.navigation.navigate("Auth")
|
this.props.navigation.navigate("Auth")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const items=this.props.navigation.router.childRouters.sta.childRouters;
|
const items = this.props.navigation.router.childRouters.sta.childRouters;
|
||||||
// items.filter((item)=>item.)
|
// items.filter((item)=>item.)
|
||||||
this.setState({items:items})
|
this.setState({ items: items })
|
||||||
this.retrieveAndroidInformation()
|
this.retrieveAndroidInformation()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
updateLangue(){
|
updateLangue() {
|
||||||
this.setState({lang:"change"})
|
this.setState({ lang: "change" })
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
onMenuNavigationEvent(menuOption){
|
onMenuNavigationEvent(menuOption) {
|
||||||
/* Navigation.mergeOptions(this.props.componentId,{
|
/* Navigation.mergeOptions(this.props.componentId,{
|
||||||
sideMenu: {
|
sideMenu: {
|
||||||
left: {
|
left: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
switch (menuOption){
|
||||||
|
case "home":{
|
||||||
|
this.setState({currentId:0})
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "userInfo":{
|
||||||
|
this.setState({currentId:1})
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
onUserConnect() {
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user !== null && user !== undefined) {
|
||||||
|
this.updateUser(user);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onNavigatorEvent(event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
hideSideMenu() {
|
||||||
|
/* Navigation.mergeOptions("drawer", {
|
||||||
|
sideMenu: {
|
||||||
|
left: {
|
||||||
|
visible: false,
|
||||||
|
enabled:false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});*/
|
||||||
})
|
}
|
||||||
switch (menuOption){
|
initState() {
|
||||||
case "home":{
|
return {
|
||||||
this.setState({currentId:0})
|
user: null,
|
||||||
}
|
menu: [],
|
||||||
break;
|
currentId: 0,
|
||||||
case "userInfo":{
|
|
||||||
this.setState({currentId:1})
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
onUserConnect() {
|
|
||||||
readUser().then((user) => {
|
|
||||||
if (user !== null && user !== undefined) {
|
|
||||||
this.updateUser(user);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
onNavigatorEvent(event) {
|
|
||||||
|
|
||||||
}
|
|
||||||
hideSideMenu() {
|
|
||||||
/* Navigation.mergeOptions("drawer", {
|
|
||||||
sideMenu: {
|
|
||||||
left: {
|
|
||||||
visible: false,
|
|
||||||
enabled:false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
}
|
|
||||||
initState(){
|
|
||||||
return {
|
|
||||||
user:null,
|
|
||||||
menu:[],
|
|
||||||
currentId:0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
getGeolocatedUserMenu(){
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('ADD_NETWORK'),id:11,key:11,icon:'md-people',active:false}
|
|
||||||
, {title:I18n.t('CHANGE_INFORMATION'),id:13,key:13,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
getSuperUserMenu(){
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
getHyperUsermenu() {
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
updateUser(user){
|
|
||||||
let menu=[];
|
|
||||||
if(user!==undefined) {
|
|
||||||
/* Navigation.mergeOptions("drawer", {
|
|
||||||
sideMenu: {
|
|
||||||
left: {
|
|
||||||
visible: false,
|
|
||||||
enabled:true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});*/
|
}
|
||||||
if(user.category!==undefined) {
|
getGeolocatedUserMenu() {
|
||||||
switch(user.category){
|
return [
|
||||||
case "geolocated":
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
menu=this.getGeolocatedUserMenu();
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
break;
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
case "super":
|
, { title: I18n.t('ADD_NETWORK'), id: 11, key: 11, icon: 'md-people', active: false }
|
||||||
menu = this.getSuperUserMenu();
|
, { title: I18n.t('CHANGE_INFORMATION'), id: 13, key: 13, icon: 'md-person', active: false }
|
||||||
break;
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
case "hyper":
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
menu=this.getHyperUsermenu();
|
}
|
||||||
break;
|
getSuperUserMenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
|
, { title: I18n.t('GROUP_MANAGE'), id: 5, key: 5, icon: 'md-people', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
getHyperUsermenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
|
, { title: I18n.t('GROUP_MANAGE'), id: 5, key: 5, icon: 'md-people', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
updateUser(user) {
|
||||||
|
let menu = [];
|
||||||
|
if (user !== undefined) {
|
||||||
|
/* Navigation.mergeOptions("drawer", {
|
||||||
|
sideMenu: {
|
||||||
|
left: {
|
||||||
|
visible: false,
|
||||||
|
enabled:true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
if (user.category !== undefined) {
|
||||||
|
switch (user.category) {
|
||||||
|
case "geolocated":
|
||||||
|
menu = this.getGeolocatedUserMenu();
|
||||||
|
break;
|
||||||
|
case "super":
|
||||||
|
menu = this.getSuperUserMenu();
|
||||||
|
break;
|
||||||
|
case "hyper":
|
||||||
|
menu = this.getHyperUsermenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
menu = this.getUserMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else
|
|
||||||
{
|
|
||||||
menu = this.getUserMenu();
|
this.setState({ user: user, menu: menu });
|
||||||
|
}
|
||||||
|
getUserMenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
_renderItem = (item) => {
|
||||||
|
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks') {
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.props.navigation.toggleDrawer();
|
||||||
|
this.setState({ currentId: item.id })
|
||||||
|
this.props.navigation.navigate(item)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={items.content}
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name={this.getIcon(item)}
|
||||||
|
size={32}
|
||||||
|
/>
|
||||||
|
<Text style={{
|
||||||
|
marginLeft: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
}}>{this.getNameItems(item)}
|
||||||
|
</Text>
|
||||||
|
</View></TouchableOpacity>)
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
_onPress = ((item) => {
|
||||||
|
|
||||||
|
this.setState({ currentId: item.id })
|
||||||
this.setState({user: user, menu: menu});
|
let current = this.state.menu.filter((item) => { return item.active })[0]
|
||||||
}
|
current.active = false;
|
||||||
getUserMenu(){
|
item.active = true;
|
||||||
return [
|
let newMenu = [];
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
this.state.menu.forEach(function (it) {
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
if (it.id === current.id) newMenu.push(current)
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
else if (it.id === item.id) newMenu.push(item)
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
else newMenu.push(it)
|
||||||
}
|
}
|
||||||
_renderItem = (item) =>{
|
)
|
||||||
if(item==="creditrequest" || item==='historyItemDetails' || item==='filter' || item==='networks'){
|
this.setState({ menu: newMenu })
|
||||||
return null
|
|
||||||
}else{
|
|
||||||
const color= this.state.currentId===item.id?theme.accent:"grey"
|
|
||||||
return (
|
|
||||||
<TouchableOpacity onPress={() => {
|
|
||||||
this.props.navigation.toggleDrawer();
|
|
||||||
this.setState({currentId:item.id})
|
|
||||||
this.props.navigation.navigate(item)}}
|
|
||||||
>
|
|
||||||
<View
|
|
||||||
style={items.content}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={this.getIcon(item)}
|
|
||||||
size={32}
|
|
||||||
/>
|
|
||||||
<Text style={{
|
|
||||||
marginLeft:20,
|
|
||||||
fontSize:16,
|
|
||||||
}}>{this.getNameItems(item)}
|
|
||||||
</Text>
|
|
||||||
</View></TouchableOpacity>)}};
|
|
||||||
_onPress=((item)=>{
|
|
||||||
|
|
||||||
this.setState({currentId:item.id})
|
|
||||||
let current=this.state.menu.filter((item)=>{return item.active})[0]
|
|
||||||
current.active=false;
|
|
||||||
item.active=true;
|
|
||||||
let newMenu=[];
|
|
||||||
this.state.menu.forEach(function (it) {
|
|
||||||
if(it.id===current.id)newMenu.push(current)
|
|
||||||
else if(it.id===item.id)newMenu.push(item)
|
|
||||||
else newMenu.push(it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.setState({menu:newMenu})
|
|
||||||
/* switch(item.id){
|
/* switch(item.id){
|
||||||
case 2:
|
case 2:
|
||||||
Navigation.push(route.stackRoot,{
|
Navigation.push(route.stackRoot,{
|
||||||
|
|
@ -391,189 +394,192 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
*/ });
|
*/ });
|
||||||
getNameItems(item){
|
getNameItems(item) {
|
||||||
|
|
||||||
let icon=item
|
let icon = item
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case "home":icon=I18n.t('MAP')
|
case "home": icon = I18n.t('MAP')
|
||||||
break
|
break
|
||||||
case 'useraccount':icon=I18n.t('MY_ACCOUNT')
|
case 'useraccount': icon = I18n.t('MY_ACCOUNT')
|
||||||
break
|
break
|
||||||
case 'Historique':icon=I18n.t('CREDIT_MANAGE')
|
case 'Historique': icon = I18n.t('CREDIT_MANAGE')
|
||||||
break
|
break
|
||||||
case "superviseurgroup":icon=I18n.t('GROUP_MANAGE')
|
case "superviseurgroup": icon = I18n.t('GROUP_MANAGE')
|
||||||
break
|
break
|
||||||
case "updateinformation":icon=I18n.t("CHANGE_INFORMATION")
|
case "updateinformation": icon = I18n.t("CHANGE_INFORMATION")
|
||||||
break
|
break
|
||||||
case 'notificationview':icon=I18n.t('NOTIFICATIONS')
|
case 'notificationview': icon = I18n.t('NOTIFICATIONS')
|
||||||
break
|
break
|
||||||
case 'configuration':icon=I18n.t('CONFIGURATIONS')
|
case 'configuration': icon = I18n.t('CONFIGURATIONS')
|
||||||
break;
|
break;
|
||||||
case 'addNetwork':icon=I18n.t('ADD_NETWORK')
|
case 'addNetwork': icon = I18n.t('ADD_NETWORK')
|
||||||
break
|
break
|
||||||
case 'about':icon=I18n.t('ABOUT_')
|
case 'about': icon = I18n.t('ABOUT')
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
getIcon(item){
|
getIcon(item) {
|
||||||
let icon="md-map"
|
let icon = "md-map"
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case "home":icon="md-map"
|
case "home": icon = "md-map"
|
||||||
break
|
break
|
||||||
case 'useraccount':icon="md-person"
|
case 'useraccount': icon = "md-person"
|
||||||
break
|
break
|
||||||
case 'Historique':icon="md-card"
|
case 'Historique': icon = "md-card"
|
||||||
break
|
break
|
||||||
case "superviseurgroup":icon="md-people"
|
case "superviseurgroup": icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'notificationview':icon="md-notifications";
|
case 'notificationview': icon = "md-notifications";
|
||||||
break
|
break
|
||||||
case "updateinformation":icon="md-people"
|
case "updateinformation": icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'configuration':icon='md-settings'
|
case 'configuration': icon = 'md-settings'
|
||||||
break;
|
break;
|
||||||
case 'addNetwork':icon="md-people"
|
case 'addNetwork': icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'about':icon='md-contacts';
|
case 'about': icon = 'md-contacts';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
render () {
|
render() {
|
||||||
var name=this.state.user?this.state.user.firstname:"";
|
var name = this.state.user ? this.state.user.firstname : "";
|
||||||
const surname=this.state.user? this.state.user.lastname:"";
|
const surname = this.state.user ? this.state.user.lastname : "";
|
||||||
if(!this.state.lang && this.state.lang!=="change")
|
if (!this.state.lang && this.state.lang !== "change")
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View
|
<View
|
||||||
style={styles.headercontent}
|
style={styles.headercontent}
|
||||||
>
|
>
|
||||||
<Text style={styles.headerTitle}>{name}</Text>
|
<Text style={styles.headerTitle}>{name}</Text>
|
||||||
<Text style={styles.headerTitle}>{surname}</Text>
|
<Text style={styles.headerTitle}>{surname}</Text>
|
||||||
<Text style={styles.headerPhone}>{this.state.user?""+this.state.user.phone:""}</Text>
|
<Text style={styles.headerPhone}>{this.state.user ? "" + this.state.user.phone : ""}</Text>
|
||||||
</View>
|
</View>
|
||||||
<ScrollView style={{flex:1,height:responsiveHeight(40)
|
<ScrollView style={{
|
||||||
}} >
|
flex: 1, height: responsiveHeight(40)
|
||||||
<SafeAreaView forceInset={{ top: 'always', horizontal: 'never' }}>
|
}} >
|
||||||
{
|
<SafeAreaView forceInset={{ top: 'always', horizontal: 'never' }}>
|
||||||
this.state.items && Object.keys(this.state.items).map((item,key)=>{
|
{
|
||||||
return this._renderItem(item)
|
this.state.items && Object.keys(this.state.items).map((item, key) => {
|
||||||
})
|
return this._renderItem(item)
|
||||||
}
|
})
|
||||||
</SafeAreaView>
|
}
|
||||||
</ScrollView>
|
</SafeAreaView>
|
||||||
<Button
|
</ScrollView>
|
||||||
textStyle={styles.btntext}
|
<Button
|
||||||
style={styles.btnDeconnect}
|
textStyle={styles.btntext}
|
||||||
onPress={()=>this.userDeconnect()}
|
style={styles.btnDeconnect}
|
||||||
>{I18n.t('DISCONNEXION')}</Button>
|
onPress={() => this.userDeconnect()}
|
||||||
</View>
|
>{I18n.t('DISCONNEXION')}</Button>
|
||||||
)
|
</View>
|
||||||
else {
|
)
|
||||||
setTimeout(() => this.setState({lang: ""}), 500)
|
else {
|
||||||
return (<View/>)
|
setTimeout(() => this.setState({ lang: "" }), 500)
|
||||||
}
|
return (<View />)
|
||||||
}
|
}
|
||||||
userDeconnect(){
|
}
|
||||||
Alert.alert(
|
userDeconnect() {
|
||||||
I18n.t('DISCONNEXION'),
|
Alert.alert(
|
||||||
I18n.t('DISCONNEXION_TEXT'),
|
I18n.t('DISCONNEXION'),
|
||||||
[
|
I18n.t('DISCONNEXION_TEXT'),
|
||||||
{},
|
[
|
||||||
{text: I18n.t('NO'), onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
|
{},
|
||||||
{text: I18n.t('YES'), onPress: () =>{
|
{ text: I18n.t('NO'), onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
|
||||||
disconnect().then(()=>{
|
{
|
||||||
IlinkEmitter.emit("userdisconnect");
|
text: I18n.t('YES'), onPress: () => {
|
||||||
this.props.navigation.navigate("Auth")
|
disconnect().then(() => {
|
||||||
})
|
IlinkEmitter.emit("userdisconnect");
|
||||||
}},
|
this.props.navigation.navigate("Auth")
|
||||||
],
|
})
|
||||||
{ cancelable: false }
|
}
|
||||||
)
|
},
|
||||||
}
|
],
|
||||||
watchUser() {
|
{ cancelable: false }
|
||||||
readUser().then((user)=> {
|
)
|
||||||
if(user.id!==this.state.user.id) {
|
}
|
||||||
if (user !== null && user !== undefined) {
|
watchUser() {
|
||||||
this.updateUser(user);
|
readUser().then((user) => {
|
||||||
}
|
if (user.id !== this.state.user.id) {
|
||||||
}
|
if (user !== null && user !== undefined) {
|
||||||
});
|
this.updateUser(user);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const items=StyleSheet.create({
|
const items = StyleSheet.create({
|
||||||
content:{
|
content: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
height:50,
|
height: 50,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
flexDirection:'row',
|
flexDirection: 'row',
|
||||||
alignItems:'center'
|
alignItems: 'center'
|
||||||
},
|
},
|
||||||
itemText:{
|
itemText: {
|
||||||
color:'#000000',
|
color: '#000000',
|
||||||
marginLeft:20,
|
marginLeft: 20,
|
||||||
fontSize:responsiveFontSize(2),
|
fontSize: responsiveFontSize(2),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor:"white",
|
backgroundColor: "white",
|
||||||
},
|
},
|
||||||
btnDeconnect:{
|
btnDeconnect: {
|
||||||
borderColor:"transparent",
|
borderColor: "transparent",
|
||||||
marginLeft:20,
|
marginLeft: 20,
|
||||||
marginRight:20,
|
marginRight: 20,
|
||||||
backgroundColor:theme.accent
|
backgroundColor: theme.accent
|
||||||
},
|
},
|
||||||
btntext:{
|
btntext: {
|
||||||
color:"white",
|
color: "white",
|
||||||
fontSize:17,
|
fontSize: 17,
|
||||||
fontWeight:"bold"
|
fontWeight: "bold"
|
||||||
},
|
},
|
||||||
headerTitle:{
|
headerTitle: {
|
||||||
fontSize:14,
|
fontSize: 14,
|
||||||
marginBottom:5,
|
marginBottom: 5,
|
||||||
color:"white",
|
color: "white",
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
headerPhone:{
|
headerPhone: {
|
||||||
fontSize:12,
|
fontSize: 12,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
color:"white",
|
color: "white",
|
||||||
justifyContent:'flex-end'
|
justifyContent: 'flex-end'
|
||||||
|
|
||||||
},
|
},
|
||||||
listMenu: {
|
listMenu: {
|
||||||
paddingTop: 15,
|
paddingTop: 15,
|
||||||
},
|
},
|
||||||
headercontent:{
|
headercontent: {
|
||||||
height:responsiveHeight(30),
|
height: responsiveHeight(30),
|
||||||
backgroundColor:primary,
|
backgroundColor: primary,
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
paddingLeft:20
|
paddingLeft: 20
|
||||||
|
|
||||||
},
|
},
|
||||||
backgroundd_drawer:{
|
backgroundd_drawer: {
|
||||||
backgroundColor:'#000',
|
backgroundColor: '#000',
|
||||||
},
|
},
|
||||||
listbackground:{
|
listbackground: {
|
||||||
},
|
},
|
||||||
actionButtonIcon: {
|
actionButtonIcon: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
height: 22,
|
height: 22,
|
||||||
color: 'white',
|
color: 'white',
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
instructions: {
|
instructions: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,246 +7,249 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Platform, StyleSheet,Alert,FlatList, Text, View,TouchableOpacity,Linking} from 'react-native';
|
import { Platform, StyleSheet, Alert, FlatList, Text, View, TouchableOpacity, Linking } from 'react-native';
|
||||||
import ActionButton from 'react-native-action-button';
|
import ActionButton from 'react-native-action-button';
|
||||||
import Icon from 'react-native-vector-icons/Ionicons';
|
import Icon from 'react-native-vector-icons/Ionicons';
|
||||||
import {responsiveFontSize,responsiveHeight,responsiveWidth} from 'react-native-responsive-dimensions';
|
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
import HeaderMenu from './HeaderMenu';
|
import HeaderMenu from './HeaderMenu';
|
||||||
import {historiques as histo,first,useraccount,notification,configurations} from './../../route.json';
|
import { historiques as histo, first, useraccount, notification, configurations } from './../../route.json';
|
||||||
import {primary,primaryDarkAdvanced} from './../../utils/theme.json';
|
import { primary, primaryDarkAdvanced } from './../../utils/theme.json';
|
||||||
import {readUser,disconnect} from './../../webservice/AuthApi';
|
import { readUser, disconnect } from './../../webservice/AuthApi';
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
const route=require("./../../route.json")
|
const route = require("./../../route.json")
|
||||||
require('./../../utils/Translations')
|
require('./../../utils/Translations')
|
||||||
var DBEvents = require('react-native-db-models').DBEvents
|
var DBEvents = require('react-native-db-models').DBEvents
|
||||||
type Props = {};
|
type Props = {};
|
||||||
let theme=require('./../../utils/theme.json')
|
let theme = require('./../../utils/theme.json')
|
||||||
import Button from 'apsl-react-native-button'
|
import Button from 'apsl-react-native-button'
|
||||||
import {IlinkEmitter} from "./../../utils/events"
|
import { IlinkEmitter } from "./../../utils/events"
|
||||||
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
import { DrawerItems, SafeAreaView } from 'react-navigation';
|
||||||
import RNDeviceInformation from "fm-react-native-device-info"
|
import RNDeviceInformation from "fm-react-native-device-info"
|
||||||
import AppContainer, {AppNavigator} from "../../App";
|
import AppContainer, { AppNavigator } from "../../App";
|
||||||
import Configuration from "../../webservice/persistences/Configuration";
|
import Configuration from "../../webservice/persistences/Configuration";
|
||||||
|
|
||||||
export default class OptionsMenu extends Component<Props> {
|
export default class OptionsMenu extends Component<Props> {
|
||||||
|
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
statusBarColor: primaryDarkAdvanced,
|
statusBarColor: primaryDarkAdvanced,
|
||||||
};
|
};
|
||||||
commandeListe
|
commandeListe
|
||||||
constructor(props){
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state=this.initState();
|
this.state = this.initState();
|
||||||
IlinkEmitter.on("menuLink", this.onMenuNavigationEvent.bind(this))
|
IlinkEmitter.on("menuLink", this.onMenuNavigationEvent.bind(this))
|
||||||
IlinkEmitter.on("userconnect", this.onUserConnect.bind(this))
|
IlinkEmitter.on("userconnect", this.onUserConnect.bind(this))
|
||||||
IlinkEmitter.on("userdisconnect", this.hideSideMenu.bind(this))
|
IlinkEmitter.on("userdisconnect", this.hideSideMenu.bind(this))
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
this.configuration=new Configuration();
|
this.configuration = new Configuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
retrieveAndroidInformation() {
|
retrieveAndroidInformation() {
|
||||||
this.configuration._getData().then((lang)=>{
|
this.configuration._getData().then((lang) => {
|
||||||
if(lang){
|
if (lang) {
|
||||||
I18n.locale=lang
|
I18n.locale = lang
|
||||||
readUser().then((result) => {
|
readUser().then((result) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateUser(result);
|
this.updateUser(result);
|
||||||
}, 3000)})
|
}, 3000)
|
||||||
}else{
|
})
|
||||||
RNDeviceInformation.getDeviceCountryCode().then((code)=> {
|
} else {
|
||||||
I18n.locale=code.toLowerCase()
|
RNDeviceInformation.getDeviceCountryCode().then((code) => {
|
||||||
readUser().then((result) => {
|
I18n.locale = code.toLowerCase()
|
||||||
|
readUser().then((result) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateUser(result);
|
this.updateUser(result);
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.props.navigation.navigate("Auth")
|
this.props.navigation.navigate("Auth")
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((e)=>{
|
}).catch((e) => {
|
||||||
RNDeviceInformation.getDeviceCountryCode().then((code)=> {
|
RNDeviceInformation.getDeviceCountryCode().then((code) => {
|
||||||
I18n.locale=code.toLowerCase()
|
I18n.locale = code.toLowerCase()
|
||||||
readUser().then((result) => {
|
readUser().then((result) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateUser(result);
|
this.updateUser(result);
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.props.navigation.navigate("Auth")
|
this.props.navigation.navigate("Auth")
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const items=this.props.navigation.router.childRouters.sta.childRouters;
|
const items = this.props.navigation.router.childRouters.sta.childRouters;
|
||||||
// items.filter((item)=>item.)
|
// items.filter((item)=>item.)
|
||||||
this.setState({items:items})
|
this.setState({ items: items })
|
||||||
this.retrieveAndroidInformation()
|
this.retrieveAndroidInformation()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
updateLangue(){
|
updateLangue() {
|
||||||
this.setState({lang:"change"})
|
this.setState({ lang: "change" })
|
||||||
this.forceUpdate()
|
this.forceUpdate()
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
||||||
}
|
}
|
||||||
onMenuNavigationEvent(menuOption){
|
onMenuNavigationEvent(menuOption) {
|
||||||
/* Navigation.mergeOptions(this.props.componentId,{
|
/* Navigation.mergeOptions(this.props.componentId,{
|
||||||
sideMenu: {
|
sideMenu: {
|
||||||
left: {
|
left: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
switch (menuOption){
|
||||||
|
case "home":{
|
||||||
|
this.setState({currentId:0})
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "userInfo":{
|
||||||
|
this.setState({currentId:1})
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
onUserConnect() {
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user !== null && user !== undefined) {
|
||||||
|
this.updateUser(user);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onNavigatorEvent(event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
hideSideMenu() {
|
||||||
|
/* Navigation.mergeOptions("drawer", {
|
||||||
|
sideMenu: {
|
||||||
|
left: {
|
||||||
|
visible: false,
|
||||||
|
enabled:false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});*/
|
||||||
})
|
}
|
||||||
switch (menuOption){
|
initState() {
|
||||||
case "home":{
|
return {
|
||||||
this.setState({currentId:0})
|
user: null,
|
||||||
}
|
menu: [],
|
||||||
break;
|
currentId: 0,
|
||||||
case "userInfo":{
|
|
||||||
this.setState({currentId:1})
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
onUserConnect() {
|
|
||||||
readUser().then((user) => {
|
|
||||||
if (user !== null && user !== undefined) {
|
|
||||||
this.updateUser(user);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
onNavigatorEvent(event) {
|
|
||||||
|
|
||||||
}
|
|
||||||
hideSideMenu() {
|
|
||||||
/* Navigation.mergeOptions("drawer", {
|
|
||||||
sideMenu: {
|
|
||||||
left: {
|
|
||||||
visible: false,
|
|
||||||
enabled:false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
}
|
|
||||||
initState(){
|
|
||||||
return {
|
|
||||||
user:null,
|
|
||||||
menu:[],
|
|
||||||
currentId:0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
getGeolocatedUserMenu(){
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('ADD_NETWORK'),id:11,key:11,icon:'md-people',active:false}
|
|
||||||
, {title:I18n.t('CHANGE_INFORMATION'),id:13,key:13,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
getSuperUserMenu(){
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
getHyperUsermenu() {
|
|
||||||
return [
|
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
|
||||||
,{title:I18n.t('CREDIT_MANAGE'),id:2,key:2,icon:'md-card',active:false}
|
|
||||||
,{title:I18n.t('GROUP_MANAGE'),id:5,key:5,icon:'md-people',active:false}
|
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
|
||||||
}
|
|
||||||
updateUser(user){
|
|
||||||
let menu=[];
|
|
||||||
if(user!==undefined) {
|
|
||||||
/* Navigation.mergeOptions("drawer", {
|
|
||||||
sideMenu: {
|
|
||||||
left: {
|
|
||||||
visible: false,
|
|
||||||
enabled:true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});*/
|
}
|
||||||
if(user.category!==undefined) {
|
getGeolocatedUserMenu() {
|
||||||
switch(user.category){
|
return [
|
||||||
case "geolocated":
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
menu=this.getGeolocatedUserMenu();
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
break;
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
case "super":
|
, { title: I18n.t('ADD_NETWORK'), id: 11, key: 11, icon: 'md-people', active: false }
|
||||||
menu = this.getSuperUserMenu();
|
, { title: I18n.t('CHANGE_INFORMATION'), id: 13, key: 13, icon: 'md-person', active: false }
|
||||||
break;
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
case "hyper":
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
menu=this.getHyperUsermenu();
|
}
|
||||||
break;
|
getSuperUserMenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
|
, { title: I18n.t('GROUP_MANAGE'), id: 5, key: 5, icon: 'md-people', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
getHyperUsermenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
||||||
|
, { title: I18n.t('GROUP_MANAGE'), id: 5, key: 5, icon: 'md-people', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
updateUser(user) {
|
||||||
|
let menu = [];
|
||||||
|
if (user !== undefined) {
|
||||||
|
/* Navigation.mergeOptions("drawer", {
|
||||||
|
sideMenu: {
|
||||||
|
left: {
|
||||||
|
visible: false,
|
||||||
|
enabled:true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
if (user.category !== undefined) {
|
||||||
|
switch (user.category) {
|
||||||
|
case "geolocated":
|
||||||
|
menu = this.getGeolocatedUserMenu();
|
||||||
|
break;
|
||||||
|
case "super":
|
||||||
|
menu = this.getSuperUserMenu();
|
||||||
|
break;
|
||||||
|
case "hyper":
|
||||||
|
menu = this.getHyperUsermenu();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
menu = this.getUserMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else
|
|
||||||
{
|
|
||||||
menu = this.getUserMenu();
|
this.setState({ user: user, menu: menu });
|
||||||
|
}
|
||||||
|
getUserMenu() {
|
||||||
|
return [
|
||||||
|
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
||||||
|
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
||||||
|
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
||||||
|
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
||||||
|
}
|
||||||
|
_renderItem = (item) => {
|
||||||
|
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks') {
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
return (
|
||||||
|
<TouchableOpacity onPress={() => {
|
||||||
|
this.props.navigation.toggleDrawer();
|
||||||
|
this.setState({ currentId: item.id })
|
||||||
|
this.props.navigation.navigate(item)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={items.content}
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
name={this.getIcon(item)}
|
||||||
|
size={32}
|
||||||
|
/>
|
||||||
|
<Text style={{
|
||||||
|
marginLeft: 20,
|
||||||
|
fontSize: 16,
|
||||||
|
}}>{this.getNameItems(item)}
|
||||||
|
</Text>
|
||||||
|
</View></TouchableOpacity>)
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
_onPress = ((item) => {
|
||||||
|
|
||||||
|
this.setState({ currentId: item.id })
|
||||||
this.setState({user: user, menu: menu});
|
let current = this.state.menu.filter((item) => { return item.active })[0]
|
||||||
}
|
current.active = false;
|
||||||
getUserMenu(){
|
item.active = true;
|
||||||
return [
|
let newMenu = [];
|
||||||
{title:I18n.t('MAP'),id:0,key:0,icon:'md-map',active:true}
|
this.state.menu.forEach(function (it) {
|
||||||
,{title:I18n.t('MY_ACCOUNT'),id:1,key:1,icon:'md-person',active:false}
|
if (it.id === current.id) newMenu.push(current)
|
||||||
,{title:I18n.t('NOTIFICATIONS'),id:3,key:3,icon:'md-notifications',active:false}
|
else if (it.id === item.id) newMenu.push(item)
|
||||||
,{title:I18n.t('CONFIGURATIONS'),id:4,icon:'md-settings',active:false}]
|
else newMenu.push(it)
|
||||||
}
|
}
|
||||||
_renderItem = (item) =>{
|
)
|
||||||
if(item==="creditrequest" || item==='historyItemDetails' || item==='filter' || item==='networks'){
|
this.setState({ menu: newMenu })
|
||||||
return null
|
|
||||||
}else{
|
|
||||||
const color= this.state.currentId===item.id?theme.accent:"grey"
|
|
||||||
return (
|
|
||||||
<TouchableOpacity onPress={() => {
|
|
||||||
this.props.navigation.toggleDrawer();
|
|
||||||
this.setState({currentId:item.id})
|
|
||||||
this.props.navigation.navigate(item)}}
|
|
||||||
>
|
|
||||||
<View
|
|
||||||
style={items.content}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
name={this.getIcon(item)}
|
|
||||||
size={32}
|
|
||||||
/>
|
|
||||||
<Text style={{
|
|
||||||
marginLeft:20,
|
|
||||||
fontSize:16,
|
|
||||||
}}>{this.getNameItems(item)}
|
|
||||||
</Text>
|
|
||||||
</View></TouchableOpacity>)}};
|
|
||||||
_onPress=((item)=>{
|
|
||||||
|
|
||||||
this.setState({currentId:item.id})
|
|
||||||
let current=this.state.menu.filter((item)=>{return item.active})[0]
|
|
||||||
current.active=false;
|
|
||||||
item.active=true;
|
|
||||||
let newMenu=[];
|
|
||||||
this.state.menu.forEach(function (it) {
|
|
||||||
if(it.id===current.id)newMenu.push(current)
|
|
||||||
else if(it.id===item.id)newMenu.push(item)
|
|
||||||
else newMenu.push(it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
this.setState({menu:newMenu})
|
|
||||||
/* switch(item.id){
|
/* switch(item.id){
|
||||||
case 2:
|
case 2:
|
||||||
Navigation.push(route.stackRoot,{
|
Navigation.push(route.stackRoot,{
|
||||||
|
|
@ -391,187 +394,190 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
*/ });
|
*/ });
|
||||||
getNameItems(item){
|
getNameItems(item) {
|
||||||
|
|
||||||
let icon=item
|
let icon = item
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case "home":icon=I18n.t('MAP')
|
case "home": icon = I18n.t('MAP')
|
||||||
break
|
break
|
||||||
case 'useraccount':icon=I18n.t('MY_ACCOUNT')
|
case 'useraccount': icon = I18n.t('MY_ACCOUNT')
|
||||||
break
|
break
|
||||||
case 'Historique':icon=I18n.t('CREDIT_MANAGE')
|
case 'Historique': icon = I18n.t('CREDIT_MANAGE')
|
||||||
break
|
break
|
||||||
case "superviseurgroup":icon=I18n.t('GROUP_MANAGE')
|
case "superviseurgroup": icon = I18n.t('GROUP_MANAGE')
|
||||||
break
|
break
|
||||||
case "updateinformation":icon=I18n.t("CHANGE_INFORMATION")
|
case "updateinformation": icon = I18n.t("CHANGE_INFORMATION")
|
||||||
break
|
break
|
||||||
case 'notificationview':icon=I18n.t('NOTIFICATIONS')
|
case 'notificationview': icon = I18n.t('NOTIFICATIONS')
|
||||||
break
|
break
|
||||||
case 'configuration':icon=I18n.t('CONFIGURATIONS')
|
case 'configuration': icon = I18n.t('CONFIGURATIONS')
|
||||||
break;
|
break;
|
||||||
case 'addNetwork':icon=I18n.t('ADD_NETWORK')
|
case 'addNetwork': icon = I18n.t('ADD_NETWORK')
|
||||||
break
|
break
|
||||||
case 'about':icon=I18n.t('ABOUT_')
|
case 'about': icon = I18n.t('ABOUT_')
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
getIcon(item){
|
getIcon(item) {
|
||||||
let icon="md-map"
|
let icon = "md-map"
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case "home":icon="md-map"
|
case "home": icon = "md-map"
|
||||||
break
|
break
|
||||||
case 'useraccount':icon="md-person"
|
case 'useraccount': icon = "md-person"
|
||||||
break
|
break
|
||||||
case 'Historique':icon="md-card"
|
case 'Historique': icon = "md-card"
|
||||||
break
|
break
|
||||||
case "superviseurgroup":icon="md-people"
|
case "superviseurgroup": icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'notificationview':icon="md-notifications";
|
case 'notificationview': icon = "md-notifications";
|
||||||
break
|
break
|
||||||
case "updateinformation":icon="md-people"
|
case "updateinformation": icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'configuration':icon='md-settings'
|
case 'configuration': icon = 'md-settings'
|
||||||
break;
|
break;
|
||||||
case 'addNetwork':icon="md-people"
|
case 'addNetwork': icon = "md-people"
|
||||||
break
|
break
|
||||||
case 'about':icon='md-contacts';
|
case 'about': icon = 'md-contacts';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
render () {
|
render() {
|
||||||
var name=this.state.user?this.state.user.firstname:"";
|
var name = this.state.user ? this.state.user.firstname : "";
|
||||||
const surname=this.state.user? this.state.user.lastname:"";
|
const surname = this.state.user ? this.state.user.lastname : "";
|
||||||
if(!this.state.lang && this.state.lang!=="change")
|
if (!this.state.lang && this.state.lang !== "change")
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View
|
<View
|
||||||
style={styles.headercontent}
|
style={styles.headercontent}
|
||||||
>
|
>
|
||||||
<Text style={styles.headerTitle}>{name}</Text>
|
<Text style={styles.headerTitle}>{name}</Text>
|
||||||
<Text style={styles.headerTitle}>{surname}</Text>
|
<Text style={styles.headerTitle}>{surname}</Text>
|
||||||
<Text style={styles.headerPhone}>{this.state.user?""+this.state.user.phone:""}</Text>
|
<Text style={styles.headerPhone}>{this.state.user ? "" + this.state.user.phone : ""}</Text>
|
||||||
</View>
|
</View>
|
||||||
<SafeAreaView style={{flex:1,
|
<SafeAreaView style={{
|
||||||
}} forceInset={{ top: 'always', horizontal: 'never' }}>
|
flex: 1,
|
||||||
{
|
}} forceInset={{ top: 'always', horizontal: 'never' }}>
|
||||||
this.state.items && Object.keys(this.state.items).map((item,key)=>{
|
{
|
||||||
return this._renderItem(item)
|
this.state.items && Object.keys(this.state.items).map((item, key) => {
|
||||||
})
|
return this._renderItem(item)
|
||||||
}
|
})
|
||||||
</SafeAreaView>
|
}
|
||||||
<Button
|
</SafeAreaView>
|
||||||
textStyle={styles.btntext}
|
<Button
|
||||||
style={styles.btnDeconnect}
|
textStyle={styles.btntext}
|
||||||
onPress={()=>this.userDeconnect()}
|
style={styles.btnDeconnect}
|
||||||
>{I18n.t('DISCONNEXION')}</Button>
|
onPress={() => this.userDeconnect()}
|
||||||
</View>
|
>{I18n.t('DISCONNEXION')}</Button>
|
||||||
)
|
</View>
|
||||||
else {
|
)
|
||||||
setTimeout(() => this.setState({lang: ""}), 500)
|
else {
|
||||||
return (<View/>)
|
setTimeout(() => this.setState({ lang: "" }), 500)
|
||||||
}
|
return (<View />)
|
||||||
}
|
}
|
||||||
userDeconnect(){
|
}
|
||||||
Alert.alert(
|
userDeconnect() {
|
||||||
I18n.t('DISCONNEXION'),
|
Alert.alert(
|
||||||
I18n.t('DISCONNEXION_TEXT'),
|
I18n.t('DISCONNEXION'),
|
||||||
[
|
I18n.t('DISCONNEXION_TEXT'),
|
||||||
{},
|
[
|
||||||
{text: I18n.t('NO'), onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
|
{},
|
||||||
{text: I18n.t('YES'), onPress: () =>{
|
{ text: I18n.t('NO'), onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
|
||||||
disconnect().then(()=>{
|
{
|
||||||
IlinkEmitter.emit("userdisconnect");
|
text: I18n.t('YES'), onPress: () => {
|
||||||
this.props.navigation.navigate("Auth")
|
disconnect().then(() => {
|
||||||
})
|
IlinkEmitter.emit("userdisconnect");
|
||||||
}},
|
this.props.navigation.navigate("Auth")
|
||||||
],
|
})
|
||||||
{ cancelable: false }
|
}
|
||||||
)
|
},
|
||||||
}
|
],
|
||||||
watchUser() {
|
{ cancelable: false }
|
||||||
readUser().then((user)=> {
|
)
|
||||||
if(user.id!==this.state.user.id) {
|
}
|
||||||
if (user !== null && user !== undefined) {
|
watchUser() {
|
||||||
this.updateUser(user);
|
readUser().then((user) => {
|
||||||
}
|
if (user.id !== this.state.user.id) {
|
||||||
}
|
if (user !== null && user !== undefined) {
|
||||||
});
|
this.updateUser(user);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const items=StyleSheet.create({
|
const items = StyleSheet.create({
|
||||||
content:{
|
content: {
|
||||||
width:responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
height:50,
|
height: 50,
|
||||||
paddingLeft: 20,
|
paddingLeft: 20,
|
||||||
flexDirection:'row',
|
flexDirection: 'row',
|
||||||
alignItems:'center'
|
alignItems: 'center'
|
||||||
},
|
},
|
||||||
itemText:{
|
itemText: {
|
||||||
color:'#000000',
|
color: '#000000',
|
||||||
marginLeft:20,
|
marginLeft: 20,
|
||||||
fontSize:responsiveFontSize(2),
|
fontSize: responsiveFontSize(2),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor:"white",
|
backgroundColor: "white",
|
||||||
},
|
},
|
||||||
btnDeconnect:{
|
btnDeconnect: {
|
||||||
borderColor:"transparent",
|
borderColor: "transparent",
|
||||||
marginLeft:20,
|
marginLeft: 20,
|
||||||
marginRight:20,
|
marginRight: 20,
|
||||||
backgroundColor:theme.accent
|
backgroundColor: theme.accent
|
||||||
},
|
},
|
||||||
btntext:{
|
btntext: {
|
||||||
color:"white",
|
color: "white",
|
||||||
fontSize:17,
|
fontSize: 17,
|
||||||
fontWeight:"bold"
|
fontWeight: "bold"
|
||||||
},
|
},
|
||||||
headerTitle:{
|
headerTitle: {
|
||||||
fontSize:14,
|
fontSize: 14,
|
||||||
marginBottom:5,
|
marginBottom: 5,
|
||||||
color:"white",
|
color: "white",
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
headerPhone:{
|
headerPhone: {
|
||||||
fontSize:12,
|
fontSize: 12,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
color:"white",
|
color: "white",
|
||||||
justifyContent:'flex-end'
|
justifyContent: 'flex-end'
|
||||||
|
|
||||||
},
|
},
|
||||||
listMenu: {
|
listMenu: {
|
||||||
paddingTop: 15,
|
paddingTop: 15,
|
||||||
},
|
},
|
||||||
headercontent:{
|
headercontent: {
|
||||||
height:responsiveHeight(30),
|
height: responsiveHeight(30),
|
||||||
backgroundColor:primary,
|
backgroundColor: primary,
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
alignItems: 'flex-start',
|
alignItems: 'flex-start',
|
||||||
paddingLeft:20
|
paddingLeft: 20
|
||||||
|
|
||||||
},
|
},
|
||||||
backgroundd_drawer:{
|
backgroundd_drawer: {
|
||||||
backgroundColor:'#000',
|
backgroundColor: '#000',
|
||||||
},
|
},
|
||||||
listbackground:{
|
listbackground: {
|
||||||
},
|
},
|
||||||
actionButtonIcon: {
|
actionButtonIcon: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
height: 22,
|
height: 22,
|
||||||
color: 'white',
|
color: 'white',
|
||||||
},
|
},
|
||||||
welcome: {
|
welcome: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
margin: 10,
|
margin: 10,
|
||||||
},
|
},
|
||||||
instructions: {
|
instructions: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
color: '#333333',
|
color: '#333333',
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {
|
import {
|
||||||
StyleSheet, View, Text, Image, ProgressBarAndroid,
|
StyleSheet, View, Text, Image, ProgressBarAndroid,
|
||||||
TouchableNativeFeedback,TouchableOpacity,
|
TouchableNativeFeedback, TouchableOpacity,
|
||||||
PermissionsAndroid, NativeModules, StatusBar, Platform,Animated
|
PermissionsAndroid, NativeModules, StatusBar, Platform, Animated
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {responsiveHeight,responsiveWidth,responsiveFontSize} from 'react-native-responsive-dimensions';
|
import { responsiveHeight, responsiveWidth, responsiveFontSize } from 'react-native-responsive-dimensions';
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
const theme=require('./../../utils/theme.json');
|
const theme = require('./../../utils/theme.json');
|
||||||
const route=require('./../../route.json');
|
const route = require('./../../route.json');
|
||||||
import {readUser,getPasObject,getPubActiveObject} from '../../webservice/AuthApi';
|
import { readUser, getPasObject, getPubActiveObject } from '../../webservice/AuthApi';
|
||||||
import { Bubbles, DoubleBounce, Bars, Pulse } from 'react-native-loader';
|
import { Bubbles, DoubleBounce, Bars, Pulse } from 'react-native-loader';
|
||||||
import Configuration from "../../webservice/persistences/Configuration";
|
import Configuration from "../../webservice/persistences/Configuration";
|
||||||
import '../ads/InterticielAds'
|
import '../ads/InterticielAds'
|
||||||
|
|
@ -17,241 +17,242 @@ import LottieView from 'lottie-react-native'; // if you have "esModuleInterop":
|
||||||
import InterticielAds from '../ads/InterticielAds';
|
import InterticielAds from '../ads/InterticielAds';
|
||||||
import Overlay from 'react-native-elements'
|
import Overlay from 'react-native-elements'
|
||||||
import DeviceInfo from 'react-native-device-info';
|
import DeviceInfo from 'react-native-device-info';
|
||||||
export default class SplashScreen extends Component{
|
export default class SplashScreen extends Component {
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
drawUnderNavBar: true,
|
drawUnderNavBar: true,
|
||||||
navBarHidden:true,
|
navBarHidden: true,
|
||||||
drawUnderStatusBar: false,
|
drawUnderStatusBar: false,
|
||||||
statusBarHidden: true,
|
statusBarHidden: false,
|
||||||
statusBarTextColorScheme: 'light',
|
statusBarTextColorScheme: 'light',
|
||||||
};
|
};
|
||||||
static options(passProps) {
|
static options(passProps) {
|
||||||
return {
|
return {
|
||||||
statusBar: {
|
statusBar: {
|
||||||
visible: false,
|
visible: false,
|
||||||
style: 'light' | 'dark',
|
style: 'light' | 'dark',
|
||||||
drawBehind:true
|
drawBehind: true
|
||||||
},
|
},
|
||||||
topBar: {
|
topBar: {
|
||||||
title: {
|
title: {
|
||||||
text: 'My Screen'
|
text: 'My Screen'
|
||||||
},
|
},
|
||||||
drawBehind: true,
|
drawBehind: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
animate: false
|
animate: false
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
constructor(props){
|
|
||||||
super(props);
|
|
||||||
this.state={
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
workUserResult(result){
|
|
||||||
var way="";
|
|
||||||
var way2="";
|
|
||||||
if(result===null || result===undefined ){
|
|
||||||
way="Auth"
|
|
||||||
way2=route.first
|
|
||||||
}else{
|
|
||||||
if(!result.category)
|
|
||||||
way="App"
|
|
||||||
else {
|
|
||||||
switch (result.category) {
|
|
||||||
case 'geolocated':way="AgentApp"
|
|
||||||
break;
|
|
||||||
case 'super':way="adminApp"
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
way="supAdminApp"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
way2=route.login
|
|
||||||
}
|
|
||||||
this.props.navigation.navigate(way)
|
|
||||||
|
|
||||||
/* Navigation.setStackRoot(route.stackRoot,
|
|
||||||
{ component: {
|
|
||||||
name: way,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
};
|
||||||
Navigation.showOverlay({
|
|
||||||
component: {
|
|
||||||
name: route.intersticielAds,
|
|
||||||
id:"interticiel",
|
|
||||||
options: {
|
|
||||||
overlay: {
|
|
||||||
interceptTouchOutside: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
componentDidMount(){
|
|
||||||
try {
|
|
||||||
this.requestCameraPermission()
|
|
||||||
}catch (e){
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
this.config=new Configuration();
|
|
||||||
this.retrieveAndroidInformation()
|
|
||||||
setTimeout(()=>this.bounce(),500)
|
|
||||||
this.bounce()
|
|
||||||
|
|
||||||
}
|
|
||||||
async requestCameraPermission() {
|
|
||||||
try {
|
|
||||||
const granted = await PermissionsAndroid.request(
|
|
||||||
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
|
||||||
{
|
|
||||||
'title': 'Cool Photo App Camera Permission',
|
|
||||||
'message': 'Cool Photo App needs access to your camera ' +
|
|
||||||
'so you can take awesome pictures.'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
console.log("try get information else")
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.log("try get information error")
|
|
||||||
console.log(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
handleViewRef = ref => this.view = ref;
|
|
||||||
|
|
||||||
bounce = () => this.view.transition({ translateX: 0},{ translateX: 700},5000);
|
|
||||||
|
|
||||||
render(){
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<StatusBar
|
|
||||||
translucent={true}
|
|
||||||
/>
|
|
||||||
<Image style={styles.logo} source={require('./../../datas/img/icon3up.png')}/>
|
|
||||||
<View style={{flexDirection:'row'}}>
|
|
||||||
<Image style={styles.logo} source={require('./../../datas/img/iconsub3.png')}/>
|
|
||||||
<Animatable.View
|
|
||||||
style={{width:responsiveWidth(90),height:92,backgroundColor:theme.primary,position:'absolute',zIndex:100}}
|
|
||||||
ref={this.handleViewRef}>
|
|
||||||
</Animatable.View>
|
|
||||||
|
|
||||||
|
|
||||||
</View>
|
//
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
|
||||||
</View>
|
}
|
||||||
)
|
};
|
||||||
}
|
workUserResult(result) {
|
||||||
|
var way = "";
|
||||||
retreiveIosInformation() {
|
var way2 = "";
|
||||||
readUser().then((result) => {
|
if (result === null || result === undefined) {
|
||||||
setTimeout(() => {
|
way = "Auth"
|
||||||
this.workUserResult(result)
|
way2 = route.first
|
||||||
}, 3000)
|
} else {
|
||||||
}).catch((e) => {
|
if (!result.category)
|
||||||
this.props.navigation.navigate("Auth")
|
way = "App"
|
||||||
});
|
else {
|
||||||
return "";
|
switch (result.category) {
|
||||||
}
|
case 'geolocated': way = "AgentApp"
|
||||||
|
break;
|
||||||
retrieveAndroidInformation() {
|
case 'super': way = "adminApp"
|
||||||
getPasObject().then((data)=>{
|
break
|
||||||
console.warn(data);
|
default:
|
||||||
this.config.setCurrentPas(data)
|
way = "supAdminApp"
|
||||||
})
|
|
||||||
|
|
||||||
this.config._getData().then((lang)=>{
|
|
||||||
if(lang){
|
|
||||||
I18n.locale=lang
|
|
||||||
readUser().then((result) => {
|
|
||||||
console.warn(result)
|
|
||||||
if(result){
|
|
||||||
getPubActiveObject(result['country_id']).then((data)=>{
|
|
||||||
console.warn(data)
|
|
||||||
this.config.setPubActive(data);
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
}
|
||||||
this.workUserResult(result)
|
way2 = route.login
|
||||||
}, 3000)})
|
}
|
||||||
}else{
|
this.props.navigation.navigate(way)
|
||||||
|
|
||||||
|
/* Navigation.setStackRoot(route.stackRoot,
|
||||||
|
{ component: {
|
||||||
|
name: way,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Navigation.showOverlay({
|
||||||
|
component: {
|
||||||
|
name: route.intersticielAds,
|
||||||
|
id:"interticiel",
|
||||||
|
options: {
|
||||||
|
overlay: {
|
||||||
|
interceptTouchOutside: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
|
}
|
||||||
|
componentDidMount() {
|
||||||
|
try {
|
||||||
|
this.requestCameraPermission()
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
this.config = new Configuration();
|
||||||
|
this.retrieveAndroidInformation()
|
||||||
|
setTimeout(() => this.bounce(), 500)
|
||||||
|
this.bounce()
|
||||||
|
|
||||||
|
}
|
||||||
|
async requestCameraPermission() {
|
||||||
|
try {
|
||||||
|
const granted = await PermissionsAndroid.request(
|
||||||
|
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
||||||
|
{
|
||||||
|
'title': 'Cool Photo App Camera Permission',
|
||||||
|
'message': 'Cool Photo App needs access to your camera ' +
|
||||||
|
'so you can take awesome pictures.'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log("try get information else")
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log("try get information error")
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
handleViewRef = ref => this.view = ref;
|
||||||
|
|
||||||
|
bounce = () => this.view.transition({ translateX: 0 }, { translateX: 700 }, 5000);
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<StatusBar
|
||||||
|
translucent={true}
|
||||||
|
/>
|
||||||
|
<Image style={styles.logo} source={require('./../../datas/img/icon3up.png')} />
|
||||||
|
<View style={{ flexDirection: 'row' }}>
|
||||||
|
<Image style={styles.logo} source={require('./../../datas/img/iconsub3.png')} />
|
||||||
|
<Animatable.View
|
||||||
|
style={{ width: responsiveWidth(90), height: 92, backgroundColor: theme.primary, position: 'absolute', zIndex: 100 }}
|
||||||
|
ref={this.handleViewRef}>
|
||||||
|
</Animatable.View>
|
||||||
|
|
||||||
|
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
retreiveIosInformation() {
|
||||||
|
readUser().then((result) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.workUserResult(result)
|
||||||
|
}, 3000)
|
||||||
|
}).catch((e) => {
|
||||||
|
this.props.navigation.navigate("Auth")
|
||||||
|
});
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
retrieveAndroidInformation() {
|
||||||
|
getPasObject().then((data) => {
|
||||||
|
console.warn(data);
|
||||||
|
this.config.setCurrentPas(data)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.config._getData().then((lang) => {
|
||||||
|
if (lang) {
|
||||||
|
I18n.locale = lang
|
||||||
|
readUser().then((result) => {
|
||||||
|
console.warn(result)
|
||||||
|
if (result) {
|
||||||
|
getPubActiveObject(result['country_id']).then((data) => {
|
||||||
|
console.warn(data)
|
||||||
|
this.config.setPubActive(data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.workUserResult(result)
|
||||||
|
}, 3000)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
const code = DeviceInfo.getDeviceLocale();
|
const code = DeviceInfo.getDeviceLocale();
|
||||||
console.warn(code)
|
console.warn(code)
|
||||||
I18n.locale=code.toLowerCase()
|
I18n.locale = code.toLowerCase()
|
||||||
readUser().then((result) => {
|
readUser().then((result) => {
|
||||||
console.warn(result)
|
console.warn(result)
|
||||||
if(result){
|
if (result) {
|
||||||
getPubActiveObject(result['country_id']).then((data)=>{
|
getPubActiveObject(result['country_id']).then((data) => {
|
||||||
console.warn(data)
|
console.warn(data)
|
||||||
this.config.setPubActive(data);
|
this.config.setPubActive(data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.workUserResult(result)
|
this.workUserResult(result)
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.setPubActive(data)
|
this.setPubActive(data)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}).catch((e)=>{
|
}).catch((e) => {
|
||||||
console.warn(e.message)
|
console.warn(e.message)
|
||||||
DeviceInfo.getDeviceLocale().then((code)=> {
|
DeviceInfo.getDeviceLocale().then((code) => {
|
||||||
console.warn(code)
|
console.warn(code)
|
||||||
|
|
||||||
I18n.locale=code.toLowerCase()
|
I18n.locale = code.toLowerCase()
|
||||||
readUser().then((result) => {
|
readUser().then((result) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.workUserResult(result)
|
this.workUserResult(result)
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
this.props.navigation.navigate("Auth")
|
this.props.navigation.navigate("Auth")
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const styles=StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container:{
|
container: {
|
||||||
flex:1,
|
flex: 1,
|
||||||
backgroundColor: theme.primary,
|
backgroundColor: theme.primary,
|
||||||
justifyContent:'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
logoContaner:{
|
logoContaner: {
|
||||||
|
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
marginTop: responsiveHeight(20),
|
marginTop: responsiveHeight(20),
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
logo:{
|
logo: {
|
||||||
width:responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
resizeMode:'contain'
|
resizeMode: 'contain'
|
||||||
},
|
},
|
||||||
lottie: {
|
lottie: {
|
||||||
width: 48
|
width: 48
|
||||||
,
|
,
|
||||||
height: 64
|
height: 64
|
||||||
},
|
},
|
||||||
title:{
|
title: {
|
||||||
fontSize:responsiveFontSize(4),
|
fontSize: responsiveFontSize(4),
|
||||||
alignSelf: 'center',
|
alignSelf: 'center',
|
||||||
fontWeight:'bold',
|
fontWeight: 'bold',
|
||||||
color:'white',
|
color: 'white',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
"WELCOME": "Welcome to iLink World !",
|
"WELCOME": "Welcome to iLink World !",
|
||||||
"HELP": "Help",
|
"HELP": "Help",
|
||||||
"SIMPLE_USER": "Simple User",
|
"SIMPLE_USER": "Simple User",
|
||||||
|
"ABOUT": "About us",
|
||||||
|
"ABOUT_TEXT": "iLink is an application that will facilitate your financial transactions near your location, and give you multiservice points near you.",
|
||||||
"GEOLOCATED_USER": "Geo located user",
|
"GEOLOCATED_USER": "Geo located user",
|
||||||
"SUPERVISOR": "Supervisor",
|
"SUPERVISOR": "Supervisor",
|
||||||
"AGENT": "Agent",
|
"AGENT": "Agent",
|
||||||
|
|
@ -15,6 +17,7 @@
|
||||||
"ACCOUNT_CREATED_SUCCESS": "Account created successfully.\nYou will receive in a few minutes an email and an SMS with your informations.\nWe will redirect you to the login page",
|
"ACCOUNT_CREATED_SUCCESS": "Account created successfully.\nYou will receive in a few minutes an email and an SMS with your informations.\nWe will redirect you to the login page",
|
||||||
"OR_BIG": "OR",
|
"OR_BIG": "OR",
|
||||||
"FOR_NUMB": "For the ",
|
"FOR_NUMB": "For the ",
|
||||||
|
"FILTER_DATE": "Filter date",
|
||||||
"SUBTITLE_ACTIVE_ACCOUNT": "Activate your account using the code that was sent on your email or phone number",
|
"SUBTITLE_ACTIVE_ACCOUNT": "Activate your account using the code that was sent on your email or phone number",
|
||||||
"ASK_FOR_CREDIT": "Apply for credit",
|
"ASK_FOR_CREDIT": "Apply for credit",
|
||||||
"ASK_CREDIT": "Credit applications",
|
"ASK_CREDIT": "Credit applications",
|
||||||
|
|
@ -26,14 +29,15 @@
|
||||||
"ASK_FOR_SUPERVISOR1": "Ask to become a supervisor",
|
"ASK_FOR_SUPERVISOR1": "Ask to become a supervisor",
|
||||||
"CREDIT_ASK_FROM_MEMBERS": "Credit requests from your members",
|
"CREDIT_ASK_FROM_MEMBERS": "Credit requests from your members",
|
||||||
"ASK_MEMBERS": "Membership applications",
|
"ASK_MEMBERS": "Membership applications",
|
||||||
"MY_ACCOUNT": "Mon compte",
|
"MY_ACCOUNT": "My account",
|
||||||
"THE_ACCOUNT": "Le compte ",
|
"THE_ACCOUNT": "Account ",
|
||||||
"NO_GEO_POINT_CODE": "You have no free geolocated point",
|
"NO_GEO_POINT_CODE": "You have no free geolocated point",
|
||||||
"NO_DEMAND_ADHESION": "You have no membership request",
|
"NO_DEMAND_ADHESION": "You have no membership request",
|
||||||
"ACTIVATED": "has been activated",
|
"ACTIVATED": "has been activated",
|
||||||
"CREDIT_MANAGE": "Credit Management",
|
"CREDIT_MANAGE": "Credit Management",
|
||||||
"GROUP_MANAGE": "Group Management",
|
"GROUP_MANAGE": "Group Management",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
|
"NO_NOTIFICATION": "You haven't any notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Sign Out",
|
"LOGOUT": "Sign Out",
|
||||||
"HINT_HOME_SEARCH": " Find a place, neighborhood or city ",
|
"HINT_HOME_SEARCH": " Find a place, neighborhood or city ",
|
||||||
|
|
@ -55,6 +59,7 @@
|
||||||
"CREDIT": "Credit",
|
"CREDIT": "Credit",
|
||||||
"NEXT": "Next",
|
"NEXT": "Next",
|
||||||
"SPONSOR_CODE": "Sponsor Code",
|
"SPONSOR_CODE": "Sponsor Code",
|
||||||
|
"SOLDE_UNVAIBLE": "solde unavailable",
|
||||||
"TEXT_BIG_CREATE_AGENT_1": "Register as Agent",
|
"TEXT_BIG_CREATE_AGENT_1": "Register as Agent",
|
||||||
"EMAIL": "Email",
|
"EMAIL": "Email",
|
||||||
"COUNTRY": "Country",
|
"COUNTRY": "Country",
|
||||||
|
|
@ -176,6 +181,8 @@
|
||||||
"SEARCH_20": "20 km",
|
"SEARCH_20": "20 km",
|
||||||
"SEARCH_25": "25 km",
|
"SEARCH_25": "25 km",
|
||||||
"SEARCH": "Search",
|
"SEARCH": "Search",
|
||||||
|
"SEE_VIDEO": "Watch the video",
|
||||||
|
"SEE_TUTO": "See the tutorial",
|
||||||
"DELETE": "Delete",
|
"DELETE": "Delete",
|
||||||
"FREE": "Available",
|
"FREE": "Available",
|
||||||
"SAVED": "Registered",
|
"SAVED": "Registered",
|
||||||
|
|
@ -195,12 +202,14 @@
|
||||||
"PHONE_TRANSACTION": "Transaction number",
|
"PHONE_TRANSACTION": "Transaction number",
|
||||||
"DEMAND_TEXT_FIRST_PART": "made a request for",
|
"DEMAND_TEXT_FIRST_PART": "made a request for",
|
||||||
"REQUEST_SEND": "Request Sent",
|
"REQUEST_SEND": "Request Sent",
|
||||||
|
"DEMAND_RECEIVE": "Requests received",
|
||||||
"TO_": "credit to",
|
"TO_": "credit to",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
||||||
"SAVE_HISTORY": "Save history",
|
"SAVE_HISTORY": "Save history",
|
||||||
"MAKE_REQUEST": "Make a request",
|
"MAKE_REQUEST": "Make a request",
|
||||||
"DATE_WRONG": "The end date can not be earlier than the start date",
|
"DATE_WRONG": "The end date can not be earlier than the start date",
|
||||||
"LOADING_DOTS": "Loads ...",
|
"LOADING_DOTS": "Loading...",
|
||||||
|
"LOADING_PROGRESS": "Loading",
|
||||||
"EMPTY_LIST_REQUEST": "No request",
|
"EMPTY_LIST_REQUEST": "No request",
|
||||||
"MEMBER_LIST": "List of members",
|
"MEMBER_LIST": "List of members",
|
||||||
"FREE_CODE_LIST": "List of available codes",
|
"FREE_CODE_LIST": "List of available codes",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"WELCOME": "Bienvenue sur iLink World !",
|
"WELCOME": "Bienvenue sur iLink World !",
|
||||||
"HELP": "Aide à l'utilisation",
|
"HELP": "Aide",
|
||||||
"SIMPLE_USER": "Utilisateur simple",
|
"SIMPLE_USER": "Utilisateur simple",
|
||||||
|
"ABOUT": "A Propos",
|
||||||
|
"ABOUT_TEXT": "iLink est une application qui facilitera vos transactions financières près de votre position, et vous donne les points multiservices prêt de chez vous.",
|
||||||
"GEOLOCATED_USER": "Utilisateur géo-localisé",
|
"GEOLOCATED_USER": "Utilisateur géo-localisé",
|
||||||
"SUPERVISOR": "Superviseur",
|
"SUPERVISOR": "Superviseur",
|
||||||
"AGENT": "Agent",
|
"AGENT": "Agent",
|
||||||
|
|
@ -15,6 +17,7 @@
|
||||||
"ACCOUNT_CREATED_SUCCESS": "Le compte a été crée avec succès.\nVous recevrez dans quelques minutes un email et un sms avec vos informations.\nNous allons vous rediriger vers la page de connexion",
|
"ACCOUNT_CREATED_SUCCESS": "Le compte a été crée avec succès.\nVous recevrez dans quelques minutes un email et un sms avec vos informations.\nNous allons vous rediriger vers la page de connexion",
|
||||||
"OR_BIG": "OU",
|
"OR_BIG": "OU",
|
||||||
"FOR_NUMB": "Pour le ",
|
"FOR_NUMB": "Pour le ",
|
||||||
|
"FILTER_DATE": "Filtre de date",
|
||||||
"SUBTITLE_ACTIVE_ACCOUNT": "Activez votre compte à l'aide du code qui a été envoyé sur votre mail ou votre numéro de téléphone",
|
"SUBTITLE_ACTIVE_ACCOUNT": "Activez votre compte à l'aide du code qui a été envoyé sur votre mail ou votre numéro de téléphone",
|
||||||
"ASK_FOR_CREDIT": "Demander du crédit",
|
"ASK_FOR_CREDIT": "Demander du crédit",
|
||||||
"ASK_CREDIT": "Demandes de crédit",
|
"ASK_CREDIT": "Demandes de crédit",
|
||||||
|
|
@ -34,6 +37,7 @@
|
||||||
"CREDIT_MANAGE": "Gestion de credit",
|
"CREDIT_MANAGE": "Gestion de credit",
|
||||||
"GROUP_MANAGE": "Gestion du groupe",
|
"GROUP_MANAGE": "Gestion du groupe",
|
||||||
"NOTIFICATIONS": "Notification",
|
"NOTIFICATIONS": "Notification",
|
||||||
|
"NO_NOTIFICATION": "Vous n'avez aucune notification",
|
||||||
"CONFIGURATIONS": "Configuration",
|
"CONFIGURATIONS": "Configuration",
|
||||||
"LOGOUT": "Déconnexion",
|
"LOGOUT": "Déconnexion",
|
||||||
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
"HINT_HOME_SEARCH": " Chercher un lieu, quartier ou ville ",
|
||||||
|
|
@ -55,6 +59,7 @@
|
||||||
"CREDIT": "Crédit",
|
"CREDIT": "Crédit",
|
||||||
"NEXT": "Suivant",
|
"NEXT": "Suivant",
|
||||||
"SPONSOR_CODE": "Code parrain",
|
"SPONSOR_CODE": "Code parrain",
|
||||||
|
"SOLDE_UNVAIBLE": "solde non disponible",
|
||||||
"TEXT_BIG_CREATE_AGENT_1": "Inscrivez-vous en comme Agent",
|
"TEXT_BIG_CREATE_AGENT_1": "Inscrivez-vous en comme Agent",
|
||||||
"EMAIL": "Email",
|
"EMAIL": "Email",
|
||||||
"COUNTRY": "Pays",
|
"COUNTRY": "Pays",
|
||||||
|
|
@ -176,6 +181,8 @@
|
||||||
"SEARCH_20": "20 km",
|
"SEARCH_20": "20 km",
|
||||||
"SEARCH_25": "25 km",
|
"SEARCH_25": "25 km",
|
||||||
"SEARCH": "Rechercher",
|
"SEARCH": "Rechercher",
|
||||||
|
"SEE_VIDEO": "Voir la vidéo",
|
||||||
|
"SEE_TUTO": "Voir le tutoriel",
|
||||||
"DELETE": "Supprimer",
|
"DELETE": "Supprimer",
|
||||||
"FREE": "disponibles",
|
"FREE": "disponibles",
|
||||||
"SAVED": "enregistrés",
|
"SAVED": "enregistrés",
|
||||||
|
|
@ -195,12 +202,14 @@
|
||||||
"PHONE_TRANSACTION": "Numéro de transaction",
|
"PHONE_TRANSACTION": "Numéro de transaction",
|
||||||
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
|
"DEMAND_TEXT_FIRST_PART": "a effectué une demande de ",
|
||||||
"DEMANDE_SEND": " Demande Envoyée",
|
"DEMANDE_SEND": " Demande Envoyée",
|
||||||
|
"DEMAND_RECEIVE": "Demandes reçues",
|
||||||
"TO_": " crédit auprès de ",
|
"TO_": " crédit auprès de ",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
||||||
"SAVE_HISTORY": "Enregistrer l'historique",
|
"SAVE_HISTORY": "Enregistrer l'historique",
|
||||||
"MAKE_REQUEST": "Faire une demande",
|
"MAKE_REQUEST": "Faire une demande",
|
||||||
"DATE_WRONG": "La date de fin ne peut être antérieure à la date de début",
|
"DATE_WRONG": "La date de fin ne peut être antérieure à la date de début",
|
||||||
"LOADING_DOTS": "Chargements...",
|
"LOADING_DOTS": "Chargement...",
|
||||||
|
"LOADING_PROGRESS": "Chargement en cours",
|
||||||
"EMPTY_LIST_REQUEST": "Aucune demande",
|
"EMPTY_LIST_REQUEST": "Aucune demande",
|
||||||
"MEMBER_LIST": "Liste des membres",
|
"MEMBER_LIST": "Liste des membres",
|
||||||
"FREE_CODE_LIST": "Liste des codes disponibles",
|
"FREE_CODE_LIST": "Liste des codes disponibles",
|
||||||
|
|
|
||||||
|
|
@ -1,236 +1,250 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
var DBEvents=require('react-native-db-models').DBEvents;
|
var DBEvents = require('react-native-db-models').DBEvents;
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n'
|
||||||
import {db} from './persistences/db';
|
import { db } from './persistences/db';
|
||||||
import {configActionUrl,isDebugMode,adhesionUrl,locationActionUrl,memberActionUrl,networkActionUrl,demandeActionUrl} from "./IlinkConstants"
|
import { configActionUrl, isDebugMode, adhesionUrl, locationActionUrl, memberActionUrl, networkActionUrl, demandeActionUrl } from "./IlinkConstants"
|
||||||
|
|
||||||
import Configuration from './persistences/Configuration';
|
import Configuration from './persistences/Configuration';
|
||||||
var serializeJSON = function(data) {
|
var serializeJSON = function (data) {
|
||||||
|
|
||||||
return Object.keys(data).map(function (keyName) {
|
return Object.keys(data).map(function (keyName) {
|
||||||
return encodeURIComponent(keyName) + '=' + encodeURIComponent(data[keyName])
|
return encodeURIComponent(keyName) + '=' + encodeURIComponent(data[keyName])
|
||||||
}).join('&');
|
}).join('&');
|
||||||
|
|
||||||
};
|
};
|
||||||
export const getCodeInformation=(code)=>{
|
export const getCodeInformation = (code) => {
|
||||||
var data={"tag":'member',"type":"agen_info_code","code":code,
|
var data = {
|
||||||
"lang":I18n.currentLocale()};
|
"tag": 'member', "type": "agen_info_code", "code": code,
|
||||||
|
"lang": I18n.currentLocale()
|
||||||
|
};
|
||||||
|
|
||||||
return queryData(data,memberActionUrl)
|
return queryData(data, memberActionUrl)
|
||||||
}
|
}
|
||||||
export const getPubActiveObject=(idcpuntry)=>{
|
export const getPubActiveObject = (idcpuntry) => {
|
||||||
return queryData({"tag":"get_pub","id_country":idcpuntry},configActionUrl);
|
return queryData({ "tag": "get_pub", "id_country": idcpuntry }, configActionUrl);
|
||||||
|
|
||||||
}
|
}
|
||||||
export const getPasObject=()=>{
|
export const getPasObject = () => {
|
||||||
return queryData({"tag":"get_pas"},configActionUrl);
|
return queryData({ "tag": "get_pas" }, configActionUrl);
|
||||||
}
|
}
|
||||||
function queryAuth(data) {
|
function queryAuth(data) {
|
||||||
return timeout(50000,queryData(data,adhesionUrl))
|
return timeout(50000, queryData(data, adhesionUrl))
|
||||||
}
|
}
|
||||||
async function queryData(data,url){
|
async function queryData(data, url) {
|
||||||
|
|
||||||
data["lang"]=I18n.currentLocale()
|
data["lang"] = I18n.currentLocale()
|
||||||
data["isTest"]=isDebugMode
|
data["isTest"] = isDebugMode
|
||||||
let response= await fetch(url,{
|
let response = await fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
});
|
});
|
||||||
let responseJson=null;
|
let responseJson = null;
|
||||||
let responseText=await response.text()
|
let responseText = await response.text()
|
||||||
try {
|
try {
|
||||||
responseJson =JSON.parse(responseText)
|
responseJson = JSON.parse(responseText)
|
||||||
}catch(e){
|
} catch (e) {
|
||||||
console.log(responseText)
|
console.log(responseText)
|
||||||
return {"error":"error","error_msg":responseText}
|
return { "error": "error", "error_msg": responseText }
|
||||||
}
|
}
|
||||||
return responseJson;
|
return responseJson;
|
||||||
|
|
||||||
}
|
}
|
||||||
function timeout(ms, promise) {
|
function timeout(ms, promise) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
setTimeout(function() {
|
setTimeout(function () {
|
||||||
reject(new Error(I18n.t("TEXT_NETWORK_UNABLE")))
|
reject(new Error(I18n.t("TEXT_NETWORK_UNABLE")))
|
||||||
}, ms)
|
}, ms)
|
||||||
promise.then(resolve, reject)
|
promise.then(resolve, reject)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export const validateUser=(user)=>{
|
export const validateUser = (user) => {
|
||||||
var data={"tag":'member',"type":"valider_simple","phone":user.phone,
|
var data = {
|
||||||
"lang":I18n.currentLocale()};
|
"tag": 'member', "type": "valider_simple", "phone": user.phone,
|
||||||
return queryData(data,memberActionUrl)
|
"lang": I18n.currentLocale()
|
||||||
|
};
|
||||||
|
return queryData(data, memberActionUrl)
|
||||||
};
|
};
|
||||||
export const updatePosition=async (longitude,latitude)=>{
|
export const updatePosition = async (longitude, latitude) => {
|
||||||
const user=await readUser()
|
const user = await readUser()
|
||||||
const data={'tag':'member','type':'update_position',"agentId":user['agentId'],"longitude":longitude,latitude:latitude}
|
const data = { 'tag': 'member', 'type': 'update_position', "agentId": user['agentId'], "longitude": longitude, latitude: latitude }
|
||||||
return queryData(data,memberActionUrl)
|
return queryData(data, memberActionUrl)
|
||||||
}
|
}
|
||||||
export const valifateAgent=(user,info)=>{
|
export const valifateAgent = (user, info) => {
|
||||||
var data=info;
|
var data = info;
|
||||||
if(data===null)data={}
|
if (data === null) data = {}
|
||||||
data["tag"]="member";
|
data["tag"] = "member";
|
||||||
data['type']="validate_agent";
|
data['type'] = "validate_agent";
|
||||||
data["phone"]=user.phone;
|
data["phone"] = user.phone;
|
||||||
data['code_validation']=user.validation_code;
|
data['code_validation'] = user.validation_code;
|
||||||
if(user.category==="super" && (info===null || (info!==null && (info.nbre_code===undefined || info.nbr_code===null)))){
|
if (user.category === "super" && (info === null || (info !== null && (info.nbre_code === undefined || info.nbr_code === null)))) {
|
||||||
data["nbre_code"]=10;
|
data["nbre_code"] = 10;
|
||||||
data["nbre_code_superviseur"]=0
|
data["nbre_code_superviseur"] = 0
|
||||||
}else if(info===null || (info!==null && (info.nbre_code===undefined || info.nbre_code===null))){
|
} else if (info === null || (info !== null && (info.nbre_code === undefined || info.nbre_code === null))) {
|
||||||
data["nbre_code"]=0;
|
data["nbre_code"] = 0;
|
||||||
data["nbre_code_superviseur"]=0
|
data["nbre_code_superviseur"] = 0
|
||||||
}
|
}
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
||||||
return queryData(data,memberActionUrl)
|
return queryData(data, memberActionUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const disconnect=()=>{
|
export const disconnect = () => {
|
||||||
return new Promise((resolve,reject)=>{
|
return new Promise((resolve, reject) => {
|
||||||
readBrutUser().then((user)=>{
|
readBrutUser().then((user) => {
|
||||||
|
|
||||||
db.remove({"_id": user._id},{multi:true},(error,numRemoved)=>{
|
db.remove({ "_id": user._id }, { multi: true }, (error, numRemoved) => {
|
||||||
if(error!==null){
|
if (error !== null) {
|
||||||
reject(error)
|
reject(error)
|
||||||
}else {
|
} else {
|
||||||
console.log(numRemoved)
|
console.log(numRemoved)
|
||||||
if (numRemoved > 0) {
|
if (numRemoved > 0) {
|
||||||
resolve()
|
resolve()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const login=(phone:String,password:String,type:Number)=>{
|
export const login = (phone: String, password: String, type: Number) => {
|
||||||
const configuration=new Configuration()
|
console.log("CURRENT_LANG", I18n.currentLocale());
|
||||||
var data={"tag":type===0?"login_user":"login_agent","phone":phone,"password":password,"lang":configuration.getCurrentLangue()};
|
var data = {
|
||||||
|
tag: type === 0 ? "login_user" : "login_agent",
|
||||||
|
phone: phone,
|
||||||
|
password: password,
|
||||||
|
lang: I18n.currentLocale()
|
||||||
|
};
|
||||||
|
|
||||||
return queryAuth(data)
|
return queryAuth(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const reinitpassword = ($phone, $type) => {
|
||||||
|
var data = { "tag": "forgot_pass", "number": $phone, "typeaccount": $type, "lang": I18n.currentLocale() };
|
||||||
|
return queryAuth(data)
|
||||||
}
|
}
|
||||||
|
export const updateUserData = async (data) => {
|
||||||
|
const user = await readUser()
|
||||||
|
user.longitude = data.longitude
|
||||||
|
user.latitude = data.latitude
|
||||||
|
db.update({ "user": { $exists: true } }, { user: user }, {}, function (err, numReplaced) {
|
||||||
|
console.warn(err, numReplaced)
|
||||||
|
})
|
||||||
|
/* new Promise((resolve,reject)=>{
|
||||||
|
readBrutUser().then((user)=>{
|
||||||
|
db.remove({"_id": user._id},{multi:true},(error,numRemoved)=>{
|
||||||
|
if(error!==null){
|
||||||
|
reject(error)
|
||||||
|
}else {
|
||||||
|
let muser=user
|
||||||
|
|
||||||
export const reinitpassword=($phone,$type)=>{
|
db.insert(muser, function(err){
|
||||||
var data={"tag":"forgot_pass","number":$phone,"typeaccount":$type,"lang":I18n.currentLocale()};
|
if(err!==null) {
|
||||||
return queryAuth(data)
|
console.log("error when save user")
|
||||||
}
|
console.log(err)
|
||||||
export const updateUserData=async (data)=>{
|
}
|
||||||
const user=await readUser()
|
|
||||||
user.longitude=data.longitude
|
|
||||||
user.latitude=data.latitude
|
|
||||||
db.update({"user":{$exists:true}},{user:user},{}, function (err, numReplaced) {
|
|
||||||
console.warn(err,numReplaced)
|
|
||||||
})
|
|
||||||
/* new Promise((resolve,reject)=>{
|
|
||||||
readBrutUser().then((user)=>{
|
|
||||||
db.remove({"_id": user._id},{multi:true},(error,numRemoved)=>{
|
|
||||||
if(error!==null){
|
|
||||||
reject(error)
|
|
||||||
}else {
|
|
||||||
let muser=user
|
|
||||||
|
|
||||||
db.insert(muser, function(err){
|
})
|
||||||
if(err!==null) {
|
console.log(numRemoved)
|
||||||
console.log("error when save user")
|
if (numRemoved > 0) {
|
||||||
console.log(err)
|
resolve()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
console.log(numRemoved)
|
})
|
||||||
if (numRemoved > 0) {
|
})*/
|
||||||
resolve()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
export const saveNewuser=(muser)=>{
|
export const saveNewuser = (muser) => {
|
||||||
let user={
|
let user = {
|
||||||
user:muser
|
user: muser
|
||||||
}
|
}
|
||||||
db.insert(user, function(err){
|
db.insert(user, function (err) {
|
||||||
if(err!==null) {
|
if (err !== null) {
|
||||||
console.log("error when save user")
|
console.log("error when save user")
|
||||||
console.log(err)
|
console.log(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const readBrutUser=()=>{
|
const readBrutUser = () => {
|
||||||
return new Promise((resolve, reject)=> {
|
return new Promise((resolve, reject) => {
|
||||||
db.findOne({"user":{$exists:true}},(err,result)=>{
|
db.findOne({ "user": { $exists: true } }, (err, result) => {
|
||||||
if(err!==null || result===null || result.user===undefined) {
|
if (err !== null || result === null || result.user === undefined) {
|
||||||
resolve(null)
|
|
||||||
}else{
|
|
||||||
if(result.user===null){resolve(null)}
|
|
||||||
else
|
|
||||||
resolve(result)};})});
|
|
||||||
}
|
|
||||||
|
|
||||||
export const readUser=()=>{
|
|
||||||
return new Promise((resolve, reject)=> {
|
|
||||||
db.findOne({"user":{$exists:true}},async (err,result)=>{
|
|
||||||
if(err!==null || result===null || result.user===undefined) {
|
|
||||||
resolve(null)
|
|
||||||
}else {
|
|
||||||
if (result.user === null) {
|
|
||||||
resolve(null)
|
resolve(null)
|
||||||
}
|
} else {
|
||||||
else {
|
if (result.user === null) { resolve(null) }
|
||||||
|
else
|
||||||
resolve(result.user)
|
resolve(result)
|
||||||
}
|
};
|
||||||
}})});
|
})
|
||||||
}
|
});
|
||||||
export const createGeolocatedAccount=(user)=>{
|
|
||||||
|
|
||||||
return queryData(user,memberActionUrl)
|
|
||||||
}
|
|
||||||
export const createUserAccount=(user)=>{
|
|
||||||
return queryData(user,memberActionUrl)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const acceptDemandAdhesion=(data)=>{
|
export const readUser = () => {
|
||||||
return queryData({"tag":"member","type":"activeSupervisor","code":data.code_membre,"phone":data.phone},memberActionUrl)
|
return new Promise((resolve, reject) => {
|
||||||
}
|
db.findOne({ "user": { $exists: true } }, async (err, result) => {
|
||||||
export const deleteUser=async (data)=>{
|
if (err !== null || result === null || result.user === undefined) {
|
||||||
return queryData({"tag":"member","type":"deleteAgent","code":data.code_membre,"phone":data.phone},memberActionUrl)
|
resolve(null)
|
||||||
}
|
} else {
|
||||||
export const listDemandAdhesion=async ()=>{
|
if (result.user === null) {
|
||||||
const user=await readUser();
|
resolve(null)
|
||||||
const items=await queryData({"type":"list_demande_adhesion","tag":"member","codeparrain":user.code_membre},memberActionUrl)
|
}
|
||||||
return items;
|
else {
|
||||||
}
|
|
||||||
export const categoryChild=async (code)=>{
|
|
||||||
const codes=await queryData({"type":"get_category_child","tag":"member","codeparrain":code},memberActionUrl)
|
|
||||||
|
|
||||||
return codes;
|
resolve(result.user)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
export const getListCountriesActive=async ()=>{
|
export const createGeolocatedAccount = (user) => {
|
||||||
const countries=await queryData({"tag":"avail_countries"},networkActionUrl);
|
|
||||||
return countries;
|
return queryData(user, memberActionUrl)
|
||||||
|
}
|
||||||
|
export const createUserAccount = (user) => {
|
||||||
|
return queryData(user, memberActionUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const acceptDemandAdhesion = (data) => {
|
||||||
|
return queryData({ "tag": "member", "type": "activeSupervisor", "code": data.code_membre, "phone": data.phone }, memberActionUrl)
|
||||||
|
}
|
||||||
|
export const deleteUser = async (data) => {
|
||||||
|
return queryData({ "tag": "member", "type": "deleteAgent", "code": data.code_membre, "phone": data.phone }, memberActionUrl)
|
||||||
|
}
|
||||||
|
export const listDemandAdhesion = async () => {
|
||||||
|
const user = await readUser();
|
||||||
|
const items = await queryData({ "type": "list_demande_adhesion", "tag": "member", "codeparrain": user.code_membre }, memberActionUrl)
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
export const categoryChild = async (code) => {
|
||||||
|
const codes = await queryData({ "type": "get_category_child", "tag": "member", "codeparrain": code }, memberActionUrl)
|
||||||
|
|
||||||
|
return codes;
|
||||||
|
}
|
||||||
|
export const getListCountriesActive = async () => {
|
||||||
|
const countries = await queryData({ "tag": "avail_countries" }, networkActionUrl);
|
||||||
|
return countries;
|
||||||
|
|
||||||
}
|
}
|
||||||
export const getCountryNetwork=(country)=>{
|
export const getCountryNetwork = (country) => {
|
||||||
console.warn(country)
|
console.warn(country)
|
||||||
return queryData({"tag":'listnetworkscountryindicatif', 'indicatif':country},networkActionUrl)
|
return queryData({ "tag": 'listnetworkscountryindicatif', 'indicatif': country }, networkActionUrl)
|
||||||
}
|
}
|
||||||
export const getTownInformationName=(town)=>{
|
export const getTownInformationName = (town) => {
|
||||||
return queryData({"tag":"town_information_name","name":town},locationActionUrl);
|
return queryData({ "tag": "town_information_name", "name": town }, locationActionUrl);
|
||||||
}
|
}
|
||||||
export const generateAgentGeo=async (newPhone)=>{
|
export const generateAgentGeo = async (newPhone) => {
|
||||||
const user=await readUser();
|
const user = await readUser();
|
||||||
const items=await queryData({"type":"generateNetworkAgentForGeo","tag":"member","code_parrain":user.code_membre,'phone':newPhone},memberActionUrl)
|
const items = await queryData({ "type": "generateNetworkAgentForGeo", "tag": "member", "code_parrain": user.code_membre, 'phone': newPhone }, memberActionUrl)
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
export const AssignAgentGeo=async (codeValidation,phone)=>{
|
export const AssignAgentGeo = async (codeValidation, phone) => {
|
||||||
const user=await readUser();
|
const user = await readUser();
|
||||||
const items=await queryData({"type":"assignNetworkAgentToGeo","tag":"member","agentId":user.agentId,'code_parrain':codeValidation,"phone":phone},memberActionUrl)
|
const items = await queryData({ "type": "assignNetworkAgentToGeo", "tag": "member", "agentId": user.agentId, 'code_parrain': codeValidation, "phone": phone }, memberActionUrl)
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
@ -2,13 +2,13 @@ export const isDebugMode = false
|
||||||
//base url test
|
//base url test
|
||||||
//const baseUrl="https://ilink-app.com/mobilebackendbeta"
|
//const baseUrl="https://ilink-app.com/mobilebackendbeta"
|
||||||
//base url production
|
//base url production
|
||||||
//const baseUrl = "https://ilink-app.com/mobilebackend"
|
const baseUrl = "https://ilink-app.com/mobilebackend"
|
||||||
|
|
||||||
//base url agent
|
//base url agent
|
||||||
//const baseUrl="https://ilink-app.com/mobilebackendtest2"
|
//const baseUrl="https://ilink-app.com/mobilebackendtest2"
|
||||||
|
|
||||||
//base url agent test
|
//base url agent test
|
||||||
const baseUrl = "https://ilink-app.com/mobilebackendtest"
|
//const baseUrl = "https://ilink-app.com/mobilebackendtest"
|
||||||
|
|
||||||
export const adhesionUrl = baseUrl + '/interacted/LoginAction.php';
|
export const adhesionUrl = baseUrl + '/interacted/LoginAction.php';
|
||||||
export const memberActionUrl = baseUrl + '/interacted/MembersAction.php';
|
export const memberActionUrl = baseUrl + '/interacted/MembersAction.php';
|
||||||
|
|
|
||||||