resolution du bug lier au bouton retour de credit management lors de la connection en tant que agent
This commit is contained in:
parent
78f21b52f4
commit
ce4897eaa2
|
@ -8,8 +8,8 @@
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
# Default value: -Xmx10248m -XX:MaxPermSize=256m
|
||||||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
|
||||||
org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
|
# org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
|
||||||
org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home
|
# org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
|
1113
app/App.js
1113
app/App.js
File diff suppressed because it is too large
Load Diff
|
@ -16,6 +16,7 @@
|
||||||
"modalhistoryfilter": "filterhistory",
|
"modalhistoryfilter": "filterhistory",
|
||||||
"superviseurgroup": "superviseurgroup",
|
"superviseurgroup": "superviseurgroup",
|
||||||
"historyItemDetails": "historyItemDetails",
|
"historyItemDetails": "historyItemDetails",
|
||||||
|
"myHistory": "MyHistory",
|
||||||
"forgotpass": "forgottenpass",
|
"forgotpass": "forgottenpass",
|
||||||
"confirmcode": "confirmcode",
|
"confirmcode": "confirmcode",
|
||||||
"creationstep2": "step2",
|
"creationstep2": "step2",
|
||||||
|
|
|
@ -1,22 +1,24 @@
|
||||||
|
/* eslint-disable react-native/no-inline-styles */
|
||||||
|
/* eslint-disable prettier/prettier */
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {Alert, Image, ProgressBarAndroid, ScrollView, StatusBar, StyleSheet, Text, View} from 'react-native';
|
import {Alert, Image, ProgressBarAndroid, ScrollView, StatusBar, StyleSheet, Text, View} from 'react-native';
|
||||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||||
import {deleteUser, readUser} from './../../webservice/AuthApi';
|
import {deleteUser, readUser} from './../../webservice/AuthApi';
|
||||||
import {getAgentNetworksList} from './../../webservice/NetworkApi'
|
import {getAgentNetworksList} from './../../webservice/NetworkApi';
|
||||||
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||||
import MapView, {Marker} from 'react-native-maps';
|
import MapView, {Marker} from 'react-native-maps';
|
||||||
import * as Utils from '../../utils/DeviceUtils';
|
import * as Utils from '../../utils/DeviceUtils';
|
||||||
import CardView from "react-native-cardview";
|
import CardView from 'react-native-cardview';
|
||||||
import I18n from 'react-native-i18n'
|
import I18n from 'react-native-i18n';
|
||||||
import {IlinkEmitter} from "../../utils/events";
|
import {IlinkEmitter} from '../../utils/events';
|
||||||
import {Card, CardAction, CardButton, CardContent, CardTitle} from 'react-native-material-cards'
|
import {Card, CardAction, CardButton, CardContent, CardTitle} from 'react-native-material-cards';
|
||||||
import {Color} from '../../config/Color';
|
import {Color} from '../../config/Color';
|
||||||
import Fontisto from "react-native-vector-icons/Fontisto";
|
import Fontisto from 'react-native-vector-icons/Fontisto';
|
||||||
|
|
||||||
let theme = require('./../../utils/theme.json');
|
let theme = require('./../../utils/theme.json');
|
||||||
let route = require('../../route.json');
|
let route = require('../../route.json');
|
||||||
|
|
||||||
require('./../../utils/Translations')
|
require('./../../utils/Translations');
|
||||||
const height = responsiveHeight(100) - 250;
|
const height = responsiveHeight(100) - 250;
|
||||||
/*
|
/*
|
||||||
var Fabric = require('react-native-fabric');
|
var Fabric = require('react-native-fabric');
|
||||||
|
@ -36,10 +38,10 @@ export default class UserAccount extends Component {
|
||||||
headerTitle: I18n.t('USER_ACCOUNT'),
|
headerTitle: I18n.t('USER_ACCOUNT'),
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
backgroundColor: theme.primary,
|
backgroundColor: theme.primary,
|
||||||
paddingTop: 10
|
paddingTop: 10,
|
||||||
},
|
},
|
||||||
headerTitleStyle: {
|
headerTitleStyle: {
|
||||||
color: "white"
|
color: 'white',
|
||||||
},
|
},
|
||||||
drawerIcon: ({tintColor}) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
|
@ -47,7 +49,7 @@ export default class UserAccount extends Component {
|
||||||
size={24}
|
size={24}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
static options(passProps) {
|
static options(passProps) {
|
||||||
|
@ -60,49 +62,49 @@ export default class UserAccount extends Component {
|
||||||
background: {
|
background: {
|
||||||
color: theme.primaryDark,
|
color: theme.primaryDark,
|
||||||
},
|
},
|
||||||
rightButtons: []
|
rightButtons: [],
|
||||||
},
|
},
|
||||||
backButton: {
|
backButton: {
|
||||||
visible: true,
|
visible: true,
|
||||||
color: "white"
|
color: 'white',
|
||||||
},
|
},
|
||||||
buttonColor: "white",
|
buttonColor: 'white',
|
||||||
background: {
|
background: {
|
||||||
color: theme.primaryDark
|
color: theme.primaryDark,
|
||||||
},
|
},
|
||||||
statusBar: {
|
statusBar: {
|
||||||
drawBehind: false,
|
drawBehind: false,
|
||||||
visible: true,
|
visible: true,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props);
|
||||||
this.state = this.initState();
|
this.state = this.initState();
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
IlinkEmitter.on('langueChange', this.updateLangue.bind(this));
|
||||||
readUser().then((user) => {
|
readUser().then((user) => {
|
||||||
if (user !== null) {
|
if (user !== null) {
|
||||||
this.setState({user: user})
|
this.setState({user: user});
|
||||||
|
|
||||||
this.updateContent(user)
|
this.updateContent(user);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLangue() {
|
updateLangue() {
|
||||||
|
|
||||||
this.props.navigation.setParams({name: I18n.t('USER_ACCOUNT')})
|
this.props.navigation.setParams({name: I18n.t('USER_ACCOUNT')});
|
||||||
this.forceUpdate()
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateContent(user) {
|
updateContent(user) {
|
||||||
getAgentNetworksList(user.agentId).then((networks) => {
|
getAgentNetworksList(user.agentId).then((networks) => {
|
||||||
console.log("networks", networks.networks);
|
console.log('networks', networks.networks);
|
||||||
if (networks['success'] !== undefined) {
|
if (networks.success !== undefined) {
|
||||||
this.setState({mynetworks: networks.networks})
|
this.setState({mynetworks: networks.networks});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -112,22 +114,22 @@ export default class UserAccount extends Component {
|
||||||
initState() {
|
initState() {
|
||||||
return {
|
return {
|
||||||
user: {},
|
user: {},
|
||||||
mynetworks: []
|
mynetworks: [],
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
let cat = "";
|
let cat = '';
|
||||||
|
|
||||||
const {user} = this.state
|
const {user} = this.state;
|
||||||
|
|
||||||
if (user.category !== undefined || user.category !== null)
|
if (user.category !== undefined || user.category !== null)
|
||||||
cat = user.category === 'super' ? I18n.t("ADMIN") : user.category === 'hyper' ?
|
{cat = user.category === 'super' ? I18n.t('ADMIN') : user.category === 'hyper' ?
|
||||||
I18n.t("SUPER_ADMIN") : user.category === 'geolocated' ?
|
I18n.t('SUPER_ADMIN') : user.category === 'geolocated' ?
|
||||||
I18n.t("GEOLOCATED") : I18n.t("SIMPLE_USER")
|
I18n.t('GEOLOCATED') : I18n.t('SIMPLE_USER');}
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<StatusBar
|
<StatusBar
|
||||||
|
@ -137,7 +139,7 @@ export default class UserAccount extends Component {
|
||||||
/>
|
/>
|
||||||
<ScrollView style={{
|
<ScrollView style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
marginTop: -5
|
marginTop: -5,
|
||||||
}}>
|
}}>
|
||||||
<View style={styles.userInformation}>
|
<View style={styles.userInformation}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
|
@ -156,7 +158,7 @@ export default class UserAccount extends Component {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center'
|
textAlign: 'center',
|
||||||
}}>{cat}</Text>
|
}}>{cat}</Text>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,29 +175,29 @@ export default class UserAccount extends Component {
|
||||||
|
|
||||||
<Text style={{
|
<Text style={{
|
||||||
marginLeft: 10, marginRight: 10, marginTop: 15, marginBottom: 5, fontSize: 17,
|
marginLeft: 10, marginRight: 10, marginTop: 15, marginBottom: 5, fontSize: 17,
|
||||||
fontWeight: 'bold', color: 'black'
|
fontWeight: 'bold', color: 'black',
|
||||||
}}>{I18n.t("ACCOUNT_INFO")}</Text>
|
}}>{I18n.t('ACCOUNT_INFO')}</Text>
|
||||||
<CardView style={{marginLeft: 10, marginRight: 10, paddingBottom: 20}}>
|
<CardView style={{marginLeft: 10, marginRight: 10, paddingBottom: 20}}>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
{user.category !== undefined && user.category !== null ? this
|
{user.category !== undefined && user.category !== null ? this
|
||||||
.addAgentInformation(user) : null}
|
.addAgentInformation(user) : null}
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
<Icon name={"location-on"} size={18}/>{" " + this.state.user.country}</Text>
|
<Icon name={'location-on'} size={18}/>{' ' + this.state.user.country}</Text>
|
||||||
|
|
||||||
{user.balance !== undefined && user.balance !== null ? this.showBalance(user) : null}
|
{user.balance !== undefined && user.balance !== null ? this.showBalance(user) : null}
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
<Icon name={"mail"} size={18}/>{" " + this.state.user.email}</Text>
|
<Icon name={'mail'} size={18}/>{' ' + this.state.user.email}</Text>
|
||||||
|
|
||||||
|
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
<Icon name={"phone"} size={18}/>
|
<Icon name={'phone'} size={18}/>
|
||||||
{" " + this.state.user.phone}</Text>
|
{' ' + this.state.user.phone}</Text>
|
||||||
{this.showPhoneSup()}
|
{this.showPhoneSup()}
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
<Icon name={"account-balance-wallet"} size={18}/>
|
<Icon name={'account-balance-wallet'} size={18}/>
|
||||||
{" " + this.state.user.network}</Text>
|
{' ' + this.state.user.network}</Text>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
|
||||||
|
@ -207,8 +209,8 @@ export default class UserAccount extends Component {
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
color: 'black'
|
color: 'black',
|
||||||
}}>{I18n.t("MY_NETWORK")}</Text>)
|
}}>{I18n.t('MY_NETWORK')}</Text>)
|
||||||
|
|
||||||
: null}
|
: null}
|
||||||
{user.category === 'geolocated' ? (this.state.mynetworks.length > 0 ? this.state.mynetworks.map(item => this.generateItemNetwork(item)) : this.showLoader()) : null}
|
{user.category === 'geolocated' ? (this.state.mynetworks.length > 0 ? this.state.mynetworks.map(item => this.generateItemNetwork(item)) : this.showLoader()) : null}
|
||||||
|
@ -216,7 +218,7 @@ export default class UserAccount extends Component {
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showPhoneSup() {
|
showPhoneSup() {
|
||||||
|
@ -224,9 +226,9 @@ export default class UserAccount extends Component {
|
||||||
|
|
||||||
return (<Text style={styles.textInformation2}>
|
return (<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
<Icon name={"phone"} size={18}/>
|
<Icon name={'phone'} size={18}/>
|
||||||
{" " + this.state.user.phoneTransaction}</Text>
|
{' ' + this.state.user.phoneTransaction}</Text>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,15 +238,14 @@ export default class UserAccount extends Component {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center'
|
textAlign: 'center',
|
||||||
}}>{I18n.t("NETWORK")}</Text>
|
}}>{I18n.t('NETWORK')}</Text>
|
||||||
<Text style={{color: 'white', fontSize: 15, textAlign: 'center'}}>{user.network}</Text>
|
<Text style={{color: 'white', fontSize: 15, textAlign: 'center'}}>{user.network}</Text>
|
||||||
</View>)
|
</View>);
|
||||||
}
|
}
|
||||||
|
|
||||||
getHeaderRight(user) {
|
getHeaderRight(user) {
|
||||||
return (<View style={{flex: 0}}>
|
return (<View style={{flex: 0}} />);
|
||||||
</View>)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getHeaderRightAgent(user) {
|
getHeaderRightAgent(user) {
|
||||||
|
@ -254,10 +255,10 @@ export default class UserAccount extends Component {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold',
|
||||||
}}>{I18n.t("MEMBER_CODE")}</Text>
|
}}>{I18n.t('MEMBER_CODE')}</Text>
|
||||||
<Text style={{color: 'white', fontSize: 13, textAlign: 'center'}}>{user.code_membre}</Text>
|
<Text style={{color: 'white', fontSize: 13, textAlign: 'center'}}>{user.code_membre}</Text>
|
||||||
</View>)
|
</View>);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,69 +268,69 @@ export default class UserAccount extends Component {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
textAlign: 'center'
|
textAlign: 'center',
|
||||||
}}>{I18n.t("NETWORK")}</Text>
|
}}>{I18n.t('NETWORK')}</Text>
|
||||||
<Text style={{color: 'white', fontSize: 13, textAlign: 'center'}}>{user.network}</Text>
|
<Text style={{color: 'white', fontSize: 13, textAlign: 'center'}}>{user.network}</Text>
|
||||||
</View>)
|
</View>);
|
||||||
}
|
}
|
||||||
|
|
||||||
addAgentInformation(user) {
|
addAgentInformation(user) {
|
||||||
console.log(user)
|
console.log(user);
|
||||||
if (user.category === "geolocated") {
|
if (user.category === 'geolocated') {
|
||||||
(<View>
|
(<View>
|
||||||
<Text style={{marginLeft: 10, marginTop: 10, color: theme.primaryDark}}>
|
<Text style={{marginLeft: 10, marginTop: 10, color: theme.primaryDark}}>
|
||||||
<Icon name={'code'} size={18} color={theme.primaryDark} style={{paddingRight: 10}}/>
|
<Icon name={'code'} size={18} color={theme.primaryDark} style={{paddingRight: 10}}/>
|
||||||
{" " + user.code_parrain}</Text>
|
{' ' + user.code_parrain}</Text>
|
||||||
</View>)
|
</View>);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
return (<View>
|
{return (<View>
|
||||||
|
|
||||||
<Text style={{marginLeft: 10, marginTop: 10, color: theme.primaryDark}}>
|
<Text style={{marginLeft: 10, marginTop: 10, color: theme.primaryDark}}>
|
||||||
<Icon name={'code'} size={18} color={theme.primaryDark} style={{paddingRight: 10}}/>
|
<Icon name={'code'} size={18} color={theme.primaryDark} style={{paddingRight: 10}}/>
|
||||||
{" " + user.code_parrain}</Text>
|
{' ' + user.code_parrain}</Text>
|
||||||
<View style={{
|
<View style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
width: responsiveWidth(90),
|
width: responsiveWidth(90),
|
||||||
marginRight: 50
|
marginRight: 50,
|
||||||
}}>
|
}}>
|
||||||
<Text style={{marginLeft: 12, marginTop: 10, color: theme.primaryDark}}>
|
<Text style={{marginLeft: 12, marginTop: 10, color: theme.primaryDark}}>
|
||||||
<Icon name={"group-work"} color={theme.primaryDark} size={18}/>
|
<Icon name={'group-work'} color={theme.primaryDark} size={18}/>
|
||||||
{" " + ((user.nbre_reseau === null || user.nbre_reseau === undefined) ? 0 : user.nbre_reseau) + " " + I18n.t("FREE")}
|
{' ' + ((user.nbre_reseau === null || user.nbre_reseau === undefined) ? 0 : user.nbre_reseau) + ' ' + I18n.t('FREE')}
|
||||||
</Text>
|
</Text>
|
||||||
<Text style={{marginLeft: 12, marginTop: 10, color: theme.primaryDark}}>
|
<Text style={{marginLeft: 12, marginTop: 10, color: theme.primaryDark}}>
|
||||||
<Icon name={"book"} color={theme.primaryDark}
|
<Icon name={'book'} color={theme.primaryDark}
|
||||||
size={18}/>{" " + ((user.nbre_reseau === null || user.nbre_membre === undefined) ? 0 : user.nbre_membre) + " " + I18n.t("SAVED")}
|
size={18}/>{' ' + ((user.nbre_reseau === null || user.nbre_membre === undefined) ? 0 : user.nbre_membre) + ' ' + I18n.t('SAVED')}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>)
|
</View>);}
|
||||||
}
|
}
|
||||||
|
|
||||||
mapUser(user) {
|
mapUser(user) {
|
||||||
const myPosition = {latitude: parseFloat(user.latitude), longitude: parseFloat(user.longitude)}
|
const myPosition = {latitude: parseFloat(user.latitude), longitude: parseFloat(user.longitude)};
|
||||||
|
|
||||||
return (<MapView
|
return (<MapView
|
||||||
liteMode
|
liteMode
|
||||||
ref={(ref) => {
|
ref={(ref) => {
|
||||||
this.mapRef = ref
|
this.mapRef = ref;
|
||||||
}}
|
}}
|
||||||
style={styles.map}
|
style={styles.map}
|
||||||
>
|
>
|
||||||
{this.state.myPosition !== undefined ?
|
{this.state.myPosition !== undefined ?
|
||||||
<Marker
|
<Marker
|
||||||
title={"Vous êtes ici"}
|
title={'Vous êtes ici'}
|
||||||
minZoomLevel={10}
|
minZoomLevel={10}
|
||||||
coordinate={{longitude: myPosition.longitude, latitude: myPosition.latitude}}
|
coordinate={{longitude: myPosition.longitude, latitude: myPosition.latitude}}
|
||||||
/> :
|
/> :
|
||||||
null}
|
null}
|
||||||
</MapView>
|
</MapView>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showBalance(user) {
|
showBalance(user) {
|
||||||
return <Text style={styles.textInformation2}>
|
return <Text style={styles.textInformation2}>
|
||||||
<Icon name={"folder"} size={18}/>{" " + this.state.user.balance + " "}</Text>
|
<Icon name={'folder'} size={18}/>{' ' + this.state.user.balance + ' '}</Text>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,10 +344,10 @@ export default class UserAccount extends Component {
|
||||||
marginBottom: 5,
|
marginBottom: 5,
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
color: 'black'
|
color: 'black',
|
||||||
}}>Mes reseaux</Text>
|
}}>Mes reseaux</Text>
|
||||||
|
|
||||||
</View>)
|
</View>);
|
||||||
}
|
}
|
||||||
|
|
||||||
generateItemNetwork(item) {
|
generateItemNetwork(item) {
|
||||||
|
@ -361,13 +362,13 @@ export default class UserAccount extends Component {
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<View Style={{flex: 1}}>
|
<View Style={{flex: 1}}>
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
<Icon name={"code"} size={18}/>{" " + item.code_membre + " "}</Text>
|
<Icon name={'code'} size={18}/>{' ' + item.code_membre + ' '}</Text>
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
<Icon name={"people"} size={18}/>{" " + item.code_parrain + " "}</Text>
|
<Icon name={'people'} size={18}/>{' ' + item.code_parrain + ' '}</Text>
|
||||||
{item.provider_class !== null && (
|
{item.provider_class !== null && (
|
||||||
<>
|
<>
|
||||||
<Text style={styles.textInformation2}>
|
<Text style={styles.textInformation2}>
|
||||||
<Fontisto name={"doctor"} size={18}/>{" " + item.provider_class + " "}</Text>
|
<Fontisto name={'doctor'} size={18}/>{' ' + item.provider_class + ' '}</Text>
|
||||||
</>
|
</>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
|
@ -380,37 +381,37 @@ export default class UserAccount extends Component {
|
||||||
<CardButton
|
<CardButton
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t("TITLE_SUPPRESS_CONFIRM"),
|
I18n.t('TITLE_SUPPRESS_CONFIRM'),
|
||||||
I18n.t("TEXT_SUPPRESS_CONFIRM"),
|
I18n.t('TEXT_SUPPRESS_CONFIRM'),
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: I18n.t('NO'), onPress: () => {
|
text: I18n.t('NO'), onPress: () => {
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: I18n.t("YES"), onPress: () => {
|
text: I18n.t('YES'), onPress: () => {
|
||||||
deleteUser(item).then(() => {
|
deleteUser(item).then(() => {
|
||||||
this.setState({isLoading: true})
|
this.setState({isLoading: true});
|
||||||
this.updateContent(this.state.user)
|
this.updateContent(this.state.user);
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
style: 'cancel'
|
style: 'cancel',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
)
|
);
|
||||||
}}
|
}}
|
||||||
title={I18n.t('DELETE_GEOLOCATED_USER')}
|
title={I18n.t('DELETE_GEOLOCATED_USER')}
|
||||||
color="crimson"
|
color="crimson"
|
||||||
/>
|
/>
|
||||||
</CardAction>
|
</CardAction>
|
||||||
</Card>)
|
</Card>);
|
||||||
}
|
}
|
||||||
|
|
||||||
showLoader() {
|
showLoader() {
|
||||||
return (<View style={{height: responsiveHeight(20)}}><ProgressBarAndroid
|
return (<View style={{height: responsiveHeight(20)}}><ProgressBarAndroid
|
||||||
|
|
||||||
style={{justifyContent: "center", alignItems: "center"}}
|
style={{justifyContent: 'center', alignItems: 'center'}}
|
||||||
/></View>)
|
/></View>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +421,7 @@ const styles = StyleSheet.create({
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
paddingTop: responsiveHeight(2),
|
paddingTop: responsiveHeight(2),
|
||||||
paddingBottom: responsiveHeight(5)
|
paddingBottom: responsiveHeight(5),
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
height: 200,
|
height: 200,
|
||||||
|
@ -431,7 +432,7 @@ const styles = StyleSheet.create({
|
||||||
networkInformation: {
|
networkInformation: {
|
||||||
width: responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
backgroundColor: '#EEEEEE',
|
backgroundColor: '#EEEEEE',
|
||||||
flex: 1
|
flex: 1,
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
@ -458,7 +459,7 @@ const styles = StyleSheet.create({
|
||||||
shadowOpacity: 1.0,
|
shadowOpacity: 1.0,
|
||||||
elevation: 5,
|
elevation: 5,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
backgroundColor: Color.cardBackgroundColor
|
backgroundColor: Color.cardBackgroundColor,
|
||||||
},
|
},
|
||||||
contain: {
|
contain: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
@ -468,7 +469,7 @@ const styles = StyleSheet.create({
|
||||||
marginTop: 15,
|
marginTop: 15,
|
||||||
marginLeft: 5,
|
marginLeft: 5,
|
||||||
width: Utils.scaleWithPixel(30),
|
width: Utils.scaleWithPixel(30),
|
||||||
height: Utils.scaleWithPixel(30)
|
height: Utils.scaleWithPixel(30),
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
height: Utils.scaleWithPixel(60),
|
height: Utils.scaleWithPixel(60),
|
||||||
|
@ -483,7 +484,7 @@ const styles = StyleSheet.create({
|
||||||
textInformation: {
|
textInformation: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: 'white',
|
color: 'white',
|
||||||
textAlign: 'center'
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
textInformation2: {
|
textInformation2: {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
|
@ -494,12 +495,12 @@ const styles = StyleSheet.create({
|
||||||
textTitle: {
|
textTitle: {
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
color: 'white',
|
color: 'white',
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
|
|
||||||
textTitle2: {
|
textTitle2: {
|
||||||
fontSize: 25,
|
fontSize: 25,
|
||||||
color: theme.primaryDark,
|
color: theme.primaryDark,
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable prettier/prettier */
|
||||||
/**
|
/**
|
||||||
* Sample React Native App
|
* Sample React Native App
|
||||||
* https://github.com/facebook/react-native
|
* https://github.com/facebook/react-native
|
||||||
|
@ -41,9 +42,9 @@ class History extends BaseScreen {
|
||||||
navBarButtonColor: '#FFFFFF',
|
navBarButtonColor: '#FFFFFF',
|
||||||
contextualMenuStatusBarColor: theme.accent,
|
contextualMenuStatusBarColor: theme.accent,
|
||||||
contextualMenuBackgroundColor: theme.accentLight,
|
contextualMenuBackgroundColor: theme.accentLight,
|
||||||
contextualMenuButtonsColor: '#ffffff'
|
contextualMenuButtonsColor: '#ffffff',
|
||||||
|
|
||||||
};
|
};
|
||||||
static navigationOptions = ({ navigation }) => {
|
static navigationOptions = ({ navigation }) => {
|
||||||
return {
|
return {
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
|
@ -63,9 +64,9 @@ class History extends BaseScreen {
|
||||||
visible: true,
|
visible: true,
|
||||||
drawBehind: false,
|
drawBehind: false,
|
||||||
background: {
|
background: {
|
||||||
color: theme.primaryDark
|
color: theme.primaryDark,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +103,6 @@ class History extends BaseScreen {
|
||||||
case 'willAppear':
|
case 'willAppear':
|
||||||
this.refreshData()
|
this.refreshData()
|
||||||
break;
|
break;
|
||||||
break;
|
|
||||||
case 'didAppear':
|
case 'didAppear':
|
||||||
break;
|
break;
|
||||||
case 'willDisappear':
|
case 'willDisappear':
|
||||||
|
@ -282,7 +282,7 @@ class History extends BaseScreen {
|
||||||
isLoaded: false,
|
isLoaded: false,
|
||||||
isSectionned: false,
|
isSectionned: false,
|
||||||
isDateTimePickerVisible: false,
|
isDateTimePickerVisible: false,
|
||||||
isDateEndTimePickerVisible: false
|
isDateEndTimePickerVisible: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,10 +491,10 @@ class History extends BaseScreen {
|
||||||
_showDateTimePicker = (type) => {
|
_showDateTimePicker = (type) => {
|
||||||
if (type === 1)
|
if (type === 1)
|
||||||
this.setState({
|
this.setState({
|
||||||
isDateTimePickerVisible: true
|
isDateTimePickerVisible: true,
|
||||||
});
|
});
|
||||||
else this.setState({
|
else this.setState({
|
||||||
isDateEndTimePickerVisible: true
|
isDateEndTimePickerVisible: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_showDateEndPicker = () => this.setState({ isDateEndTimePickerVisible: true });
|
_showDateEndPicker = () => this.setState({ isDateEndTimePickerVisible: true });
|
||||||
|
@ -507,7 +507,7 @@ class History extends BaseScreen {
|
||||||
datestart: fromdate,
|
datestart: fromdate,
|
||||||
datestartformated: moment(fromdate).format('dddd Do ,MMMM YYYY'),
|
datestartformated: moment(fromdate).format('dddd Do ,MMMM YYYY'),
|
||||||
dateend: enddate,
|
dateend: enddate,
|
||||||
dateendformated: moment(enddate).format('dddd Do ,MMMM YYYY')
|
dateendformated: moment(enddate).format('dddd Do ,MMMM YYYY'),
|
||||||
});
|
});
|
||||||
let startdate = this.state.datestart;
|
let startdate = this.state.datestart;
|
||||||
let enddatemo = moment(enddate);
|
let enddatemo = moment(enddate);
|
||||||
|
@ -518,7 +518,7 @@ class History extends BaseScreen {
|
||||||
text: I18n.t('DATE_WRONG'),
|
text: I18n.t('DATE_WRONG'),
|
||||||
duration: 'long',
|
duration: 'long',
|
||||||
backgroundColor: 'red',
|
backgroundColor: 'red',
|
||||||
textColor: 'white'
|
textColor: 'white',
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({ filder_disable: false });
|
this.setState({ filder_disable: false });
|
||||||
|
@ -541,7 +541,7 @@ class History extends BaseScreen {
|
||||||
<ActionButton.Item buttonColor={primary} title={I18n.t('MAKE_REQUEST')}
|
<ActionButton.Item buttonColor={primary} title={I18n.t('MAKE_REQUEST')}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
this.props.navigation.push(route.credrequester, {
|
this.props.navigation.push(route.credrequester, {
|
||||||
onGoBack: () => this.refreshData()
|
onGoBack: () => this.refreshData(),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -590,7 +590,7 @@ class History extends BaseScreen {
|
||||||
}]
|
}]
|
||||||
return <PagerTabIndicator
|
return <PagerTabIndicator
|
||||||
style={{
|
style={{
|
||||||
height: responsiveHeight(8)
|
height: responsiveHeight(8),
|
||||||
}}
|
}}
|
||||||
tabs={tabs} />;
|
tabs={tabs} />;
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,7 @@ class History extends BaseScreen {
|
||||||
}]
|
}]
|
||||||
return <PagerTabIndicator
|
return <PagerTabIndicator
|
||||||
style={{
|
style={{
|
||||||
height: responsiveHeight(8)
|
height: responsiveHeight(8),
|
||||||
}}
|
}}
|
||||||
tabs={tabs} />;
|
tabs={tabs} />;
|
||||||
}
|
}
|
||||||
|
@ -609,14 +609,14 @@ class History extends BaseScreen {
|
||||||
_renderTabs() {
|
_renderTabs() {
|
||||||
let tabs = [{
|
let tabs = [{
|
||||||
text: I18n.t('MY_DEMANDE'),
|
text: I18n.t('MY_DEMANDE'),
|
||||||
iconSource: this.state.usersicon
|
iconSource: this.state.usersicon,
|
||||||
}, {
|
}, {
|
||||||
text: I18n.t('DEMANDE_RECEIVE'),
|
text: I18n.t('DEMANDE_RECEIVE'),
|
||||||
iconSource: this.state.charticon
|
iconSource: this.state.charticon,
|
||||||
}]
|
}]
|
||||||
return <PagerTabIndicator
|
return <PagerTabIndicator
|
||||||
style={{
|
style={{
|
||||||
height: responsiveHeight(8)
|
height: responsiveHeight(8),
|
||||||
}}
|
}}
|
||||||
tabs={tabs} />;
|
tabs={tabs} />;
|
||||||
}
|
}
|
||||||
|
@ -653,7 +653,7 @@ const datefilter = StyleSheet.create({
|
||||||
},
|
},
|
||||||
datetext: {
|
datetext: {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginLeft: responsiveWidth(5)
|
marginLeft: responsiveWidth(5),
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
flex: 2,
|
flex: 2,
|
||||||
|
@ -672,12 +672,12 @@ const datefilter = StyleSheet.create({
|
||||||
},
|
},
|
||||||
btntext: {
|
btntext: {
|
||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
color: accent
|
color: accent,
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'space-evenly'
|
justifyContent: 'space-evenly',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
slidingup: {
|
slidingup: {
|
||||||
|
@ -695,7 +695,7 @@ const styles = StyleSheet.create({
|
||||||
emptylist: {
|
emptylist: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center'
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
backgroundd_drawer: {
|
backgroundd_drawer: {
|
||||||
backgroundColor: '#000',
|
backgroundColor: '#000',
|
||||||
|
@ -727,10 +727,10 @@ const styles = StyleSheet.create({
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
marginLeft: responsiveWidth(10),
|
marginLeft: responsiveWidth(10),
|
||||||
|
|
||||||
color: 'black'
|
color: 'black',
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
flex: 8
|
flex: 8,
|
||||||
},
|
},
|
||||||
|
|
||||||
title: {
|
title: {
|
||||||
|
@ -738,6 +738,6 @@ const styles = StyleSheet.create({
|
||||||
marginLeft: 20,
|
marginLeft: 20,
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
color: 'black',
|
color: 'black',
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,8 +1,22 @@
|
||||||
|
/* eslint-disable react/jsx-no-duplicate-props */
|
||||||
|
/* eslint-disable react-native/no-inline-styles */
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
import React, {PureComponent} from 'react';
|
import React, {PureComponent} from 'react';
|
||||||
import {FlatList, RefreshControl, SectionList, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
|
import {
|
||||||
import {responsiveFontSize, responsiveWidth} from 'react-native-responsive-dimensions';
|
FlatList,
|
||||||
|
RefreshControl,
|
||||||
|
SectionList,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import {
|
||||||
|
responsiveFontSize,
|
||||||
|
responsiveWidth,
|
||||||
|
} from 'react-native-responsive-dimensions';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import I18n from "react-native-i18n"
|
import I18n from 'react-native-i18n';
|
||||||
|
|
||||||
import 'moment/locale/fr';
|
import 'moment/locale/fr';
|
||||||
import 'moment/locale/es-us';
|
import 'moment/locale/es-us';
|
||||||
|
@ -21,312 +35,343 @@ 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) {
|
||||||
|
super(props);
|
||||||
|
this.currentLocale = I18n.locale.includes('fr') ? 'fr' : 'en-gb';
|
||||||
|
console.log('Current Locale item', this.currentLocale);
|
||||||
|
moment.locale(this.currentLocale);
|
||||||
|
this.state = this.initState();
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
statusLabel = status => {
|
||||||
super(props);
|
switch (status) {
|
||||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
|
case '0':
|
||||||
console.log("Current Locale item", this.currentLocale);
|
return I18n.t('NO_TREAT');
|
||||||
moment.locale(this.currentLocale);
|
case '1':
|
||||||
this.state = this.initState();
|
return I18n.t('TREAT');
|
||||||
|
case '2':
|
||||||
|
return I18n.t('REFUSED');
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
statusLabel = (status) => {
|
colorLabel = status => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case '0':
|
case '0':
|
||||||
return I18n.t('NO_TREAT');
|
return Color.accentColor;
|
||||||
case '1':
|
case '1':
|
||||||
return I18n.t('TREAT');
|
return Color.greenColor;
|
||||||
case '2':
|
case '2':
|
||||||
return I18n.t('REFUSED');
|
return Color.redColor;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
colorLabel = (status) => {
|
descriptionLabelUserType = user => {
|
||||||
switch (status) {
|
let textDescription =
|
||||||
case '0':
|
this.props.selfData.montant +
|
||||||
return Color.accentColor;
|
' ' +
|
||||||
case '1':
|
I18n.t('TO_') +
|
||||||
return Color.greenColor;
|
' ' +
|
||||||
case '2':
|
this.props.selfData.reseau;
|
||||||
return Color.redColor;
|
|
||||||
}
|
switch (user.category) {
|
||||||
|
case 'geolocated':
|
||||||
|
return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
|
||||||
|
case 'super':
|
||||||
|
return this.props.isDemandSend
|
||||||
|
? `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`
|
||||||
|
: `${I18n.t('THE_AGENT')} ${this.props.selfData.lastname} (${
|
||||||
|
this.props.selfData.phone
|
||||||
|
}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
||||||
|
|
||||||
|
case 'hyper':
|
||||||
|
return `${I18n.t('THE_SUPERVISOR')} ${this.props.selfData.lastname} (${
|
||||||
|
this.props.selfData.phone
|
||||||
|
}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
descriptionLabelUserType = (user) => {
|
initState() {
|
||||||
let textDescription = (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ' + this.props.selfData.reseau;
|
var textTitle = ' Transaction ' + this.props.selfData.id;
|
||||||
|
var textDescription =
|
||||||
switch (user.category) {
|
I18n.t('PHONE') +
|
||||||
case 'geolocated':
|
' ' +
|
||||||
return `${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`;
|
this.props.selfData.phone +
|
||||||
case 'super':
|
' ' +
|
||||||
return this.props.isDemandSend ?
|
I18n.t('DEMAND_TEXT_FIRST_PART') +
|
||||||
`${I18n.t('DEMAND_TEXT_FIRST_PART_YOU')} ${textDescription}`
|
' ' +
|
||||||
:
|
this.props.selfData.montant +
|
||||||
`${I18n.t('THE_AGENT')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
' ' +
|
||||||
|
I18n.t('TO_') +
|
||||||
case 'hyper':
|
' ';
|
||||||
return `${I18n.t('THE_SUPERVISOR')} ${this.props.selfData.lastname} (${this.props.selfData.phone}) ${I18n.t('DEMAND_TEXT_FIRST_PART')} ${textDescription}`;
|
textDescription += this.props.selfData.reseau;
|
||||||
}
|
var today = new Date();
|
||||||
}
|
var l = this.props.selfData.date_creation;
|
||||||
|
let t = this.props.selfData.status;
|
||||||
initState() {
|
var re = moment
|
||||||
var textTitle = ' Transaction ' + this.props.selfData.id;
|
.tz(this.props.selfData.date_creation, moment.tz.guess())
|
||||||
var textDescription = I18n.t('PHONE') + ' ' + this.props.selfData.phone + " " + I18n.t('DEMAND_TEXT_FIRST_PART') + ' ' + (this.props.selfData.montant) + ' ' + I18n.t('TO_') + ' ';
|
.format();
|
||||||
textDescription += this.props.selfData.reseau;
|
re = moment(re);
|
||||||
var today = new Date();
|
return {
|
||||||
var l = this.props.selfData.date_creation;
|
title: textTitle,
|
||||||
let t = this.props.selfData.status;
|
description: this.descriptionLabelUserType(this.props.user),
|
||||||
var re = moment.tz(this.props.selfData.date_creation, moment.tz.guess()).format();
|
status: this.statusLabel(this.props.selfData.status),
|
||||||
re = moment(re)
|
time: re.fromNow(),
|
||||||
return {
|
navigator: this.props.navigator,
|
||||||
title: textTitle,
|
type: t,
|
||||||
description: this.descriptionLabelUserType(this.props.user),
|
colorstate: this.colorLabel(t),
|
||||||
status: this.statusLabel(this.props.selfData.status),
|
|
||||||
time: re.fromNow(),
|
|
||||||
navigator: this.props.navigator,
|
|
||||||
type: t,
|
|
||||||
colorstate: this.colorLabel(t)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
//console.log("ITEM RENDER", this.props.selfData)
|
//console.log("ITEM RENDER", this.props.selfData)
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity onPress={() =>
|
<TouchableOpacity
|
||||||
this.props.navigator.navigate(route.historyItemDetails, {
|
onPress={() =>
|
||||||
item: this.props.selfData,
|
this.props.navigator.navigate(route.historyItemDetails, {
|
||||||
onGoBack: () => this.props.refresh(),
|
item: this.props.selfData,
|
||||||
}
|
onGoBack: () => this.props.refresh(),
|
||||||
)}>
|
})
|
||||||
<View style={style.content}>
|
}>
|
||||||
<Text style={style.title}>{this.state.title}</Text>
|
<View style={style.content}>
|
||||||
<Text style={style.description}>{this.state.description}</Text>
|
<Text style={style.title}>{this.state.title}</Text>
|
||||||
<View style={style.timeContent}>
|
<Text style={style.description}>{this.state.description}</Text>
|
||||||
<Text style={{
|
<View style={style.timeContent}>
|
||||||
fontWeight: 'bold',
|
<Text
|
||||||
marginLeft: 20,
|
style={{
|
||||||
marginBottom: 10,
|
fontWeight: 'bold',
|
||||||
color: this.state.colorstate,
|
marginLeft: 20,
|
||||||
|
marginBottom: 10,
|
||||||
}}>{this.statusLabel(this.props.selfData.status)}</Text>
|
color: this.state.colorstate,
|
||||||
<Text style={style.time}>{this.state.time}</Text>
|
}}>
|
||||||
</View>
|
{this.statusLabel(this.props.selfData.status)}
|
||||||
<View style={style.bottomSeparator}/>
|
</Text>
|
||||||
|
<Text style={style.time}>{this.state.time}</Text>
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
<View style={style.bottomSeparator} />
|
||||||
)
|
</View>
|
||||||
|
</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} selfData={item} />
|
||||||
navigator={this.props.navigator}
|
);
|
||||||
selfData={item}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = this.initState();
|
this.state = this.initState();
|
||||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
|
this.currentLocale = I18n.locale.includes('fr') ? 'fr' : 'en-gb';
|
||||||
moment.locale(this.currentLocale);
|
moment.locale(this.currentLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
<SectionList
|
||||||
<SectionList
|
sections={[
|
||||||
sections={[
|
{
|
||||||
{
|
title: 'Demande traité',
|
||||||
title: 'Demande traité',
|
type: 0,
|
||||||
type: 0,
|
data: this.state.treat,
|
||||||
data: this.state.treat,
|
size: this.state.conservetreat.length,
|
||||||
size: this.state.conservetreat.length,
|
expandState: this.state.istreatexpand,
|
||||||
expandState: this.state.istreatexpand
|
},
|
||||||
},
|
{
|
||||||
{
|
title: 'Demande non traité',
|
||||||
title: 'Demande non traité',
|
type: 1,
|
||||||
type: 1,
|
data: this.state.untreat,
|
||||||
data: this.state.untreat,
|
size: this.state.conserveuntreat.length,
|
||||||
size: this.state.conserveuntreat.length,
|
expandState: this.state.isuntreatexpand,
|
||||||
expandState: this.state.isuntreatexpand
|
},
|
||||||
}
|
]}
|
||||||
]}
|
renderSectionHeader={({
|
||||||
renderSectionHeader={({section: {title, type, data, size, expandState}}) => (
|
section: {title, type, data, size, expandState},
|
||||||
<TouchableOpacity onPress={() => this.onPressedHeader(type)} style={{
|
}) => (
|
||||||
backgroundColor: theme.accent,
|
<TouchableOpacity
|
||||||
justifyContent: 'center',
|
onPress={() => this.onPressedHeader(type)}
|
||||||
alignItems: 'center',
|
style={{
|
||||||
flexDirection: 'row', flex: 1, height: 70, width: responsiveWidth(100)
|
backgroundColor: theme.accent,
|
||||||
}}>
|
justifyContent: 'center',
|
||||||
<View style={{
|
alignItems: 'center',
|
||||||
height: 70,
|
flexDirection: 'row',
|
||||||
justifyContent: 'center',
|
flex: 1,
|
||||||
flex: 1,
|
height: 70,
|
||||||
width: responsiveWidth(100),
|
width: responsiveWidth(100),
|
||||||
}}>
|
}}>
|
||||||
<Text style={{
|
<View
|
||||||
fontWeight: 'bold',
|
style={{
|
||||||
marginLeft: 20,
|
height: 70,
|
||||||
fontSize: 20,
|
justifyContent: 'center',
|
||||||
color: 'white'
|
flex: 1,
|
||||||
}}>{title}</Text>
|
width: responsiveWidth(100),
|
||||||
<Text style={{
|
}}>
|
||||||
fontWeight: 'bold',
|
<Text
|
||||||
marginLeft: 20,
|
style={{
|
||||||
fontSize: 16,
|
fontWeight: 'bold',
|
||||||
color: 'white'
|
marginLeft: 20,
|
||||||
}}>{size} demande(s)</Text>
|
fontSize: 20,
|
||||||
</View>
|
color: 'white',
|
||||||
<Icon name={expandState ? 'sort-up' : 'sort-down'} size={30} color={'white'}
|
}}>
|
||||||
style={{marginRight: 20}}/>
|
{title}
|
||||||
</TouchableOpacity>
|
</Text>
|
||||||
)}
|
<Text
|
||||||
style={style.listStyle}
|
style={{
|
||||||
extraData={this.state}
|
fontWeight: 'bold',
|
||||||
keyExtractor={this._keyExtractor}
|
marginLeft: 20,
|
||||||
renderItem={this._renderItem}
|
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,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPressedHeader(type) {
|
initState() {
|
||||||
if (type === 0) {
|
let data = this.props.list;
|
||||||
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
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
return {
|
||||||
}
|
conservetreat: data.filter(item => item.statut === I18n.t('TREAT')),
|
||||||
|
treat: data.filter(item => item.statut === I18n.t('TREAT')),
|
||||||
initState() {
|
istreatexpand: true,
|
||||||
let data = this.props.list
|
conserveuntreat: data.filter(item => item.statut !== I18n.t('TREAT')),
|
||||||
|
untreat: data.filter(item => item.statut !== I18n.t('TREAT')),
|
||||||
return {
|
isuntreatexpand: true,
|
||||||
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 {
|
export class HistoryListItem extends React.Component {
|
||||||
_keyExtractor = (item, index) => item.id;
|
_keyExtractor = (item, index) => item.id;
|
||||||
|
|
||||||
_onPressItem = (id: string) => {
|
_onPressItem = id => {};
|
||||||
|
_renderItem = ({item}) => {
|
||||||
|
//console.log('ITEM ', item);
|
||||||
|
return (
|
||||||
|
<HistoryItem
|
||||||
|
isDemandSend={this.props.isDemandSend}
|
||||||
|
user={this.props.user}
|
||||||
|
refresh={this.props.refresh}
|
||||||
|
navigator={this.props.navigator}
|
||||||
|
selfData={item}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = this.initState();
|
||||||
|
this.currentLocale = I18n.locale.includes('fr') ? 'fr' : 'en-gb';
|
||||||
|
moment.locale(this.currentLocale);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState() {
|
||||||
|
return {
|
||||||
|
refreshing: false,
|
||||||
};
|
};
|
||||||
_renderItem = ({item}) => {
|
}
|
||||||
//console.log('ITEM ', item);
|
|
||||||
return (
|
|
||||||
<HistoryItem
|
|
||||||
isDemandSend={this.props.isDemandSend}
|
|
||||||
user={this.props.user}
|
|
||||||
refresh={this.props.refresh}
|
|
||||||
navigator={this.props.navigator}
|
|
||||||
selfData={item}
|
|
||||||
refresh={this.props.refresh}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(props) {
|
render() {
|
||||||
super(props);
|
return (
|
||||||
this.state = this.initState();
|
<FlatList
|
||||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
|
style={style.listStyle}
|
||||||
moment.locale(this.currentLocale);
|
data={this.props.list}
|
||||||
}
|
extraData={this.state}
|
||||||
|
keyExtractor={this._keyExtractor}
|
||||||
initState() {
|
renderItem={this._renderItem}
|
||||||
return {
|
refreshControl={
|
||||||
refreshing: false,
|
<RefreshControl
|
||||||
|
refreshing={this.props.isRefreshing}
|
||||||
|
colors={[
|
||||||
|
theme.primary,
|
||||||
|
theme.purpleLight,
|
||||||
|
theme.reddeconnect,
|
||||||
|
theme.accentLight,
|
||||||
|
]}
|
||||||
|
onRefresh={this.props.refreshing}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
}
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
_onRefresh() {
|
||||||
return (
|
this.setState({refreshing: true});
|
||||||
<FlatList
|
setTimeout(() => {
|
||||||
style={style.listStyle}
|
this.setState({refreshing: false});
|
||||||
data={this.props.list}
|
}, 5000);
|
||||||
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: {
|
||||||
},
|
justifyContent: 'space-between',
|
||||||
timeContent: {
|
flex: 1,
|
||||||
justifyContent: 'space-between',
|
marginTop: 10,
|
||||||
flex: 1,
|
marginBottom: 5,
|
||||||
marginTop: 10,
|
flexDirection: 'row',
|
||||||
marginBottom: 5,
|
},
|
||||||
flexDirection: 'row',
|
time: {
|
||||||
},
|
fontWeight: 'bold',
|
||||||
time: {
|
marginRight: 20,
|
||||||
fontWeight: 'bold',
|
marginBottom: 10,
|
||||||
marginRight: 20,
|
color: theme.accent,
|
||||||
marginBottom: 10,
|
},
|
||||||
color: theme.accent,
|
treat: {},
|
||||||
},
|
|
||||||
treat: {},
|
|
||||||
|
|
||||||
});
|
});
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -36,6 +36,7 @@ import WalletRetrait from './wallet/WalletRetrait';
|
||||||
import WalletSelect from './wallet/WalletSelect';
|
import WalletSelect from './wallet/WalletSelect';
|
||||||
import CreateIdentification from './identification/createIdentification';
|
import CreateIdentification from './identification/createIdentification';
|
||||||
import DemandGroupNanoCredit from './nano-credit/DemandGroupNanoCredit';
|
import DemandGroupNanoCredit from './nano-credit/DemandGroupNanoCredit';
|
||||||
|
import MyHistory from './history-request/MyHistory';
|
||||||
let route = require('./../route.json')
|
let route = require('./../route.json')
|
||||||
export function registerScreens() {
|
export function registerScreens() {
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,99 +6,118 @@
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React, {Component} from 'react';
|
||||||
import React, { Component } from 'react';
|
import {
|
||||||
import { Platform, StyleSheet, Alert, FlatList, Text, View, TouchableOpacity, Linking } from 'react-native';
|
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 {
|
||||||
import { primary, primaryDarkAdvanced } from './../../utils/theme.json';
|
historiques as histo,
|
||||||
import { readUser, disconnect } from './../../webservice/AuthApi';
|
first,
|
||||||
import I18n from 'react-native-i18n'
|
useraccount,
|
||||||
const route = require("./../../route.json")
|
notification,
|
||||||
require('./../../utils/Translations')
|
configurations,
|
||||||
var DBEvents = require('react-native-db-models').DBEvents
|
} from './../../route.json';
|
||||||
|
import {primary, primaryDarkAdvanced} from './../../utils/theme.json';
|
||||||
|
import {readUser, disconnect} from './../../webservice/AuthApi';
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
const route = require('./../../route.json');
|
||||||
|
require('./../../utils/Translations');
|
||||||
|
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 = {
|
||||||
|
statusBarColor: primaryDarkAdvanced,
|
||||||
|
};
|
||||||
|
commandeListe;
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = this.initState();
|
||||||
|
IlinkEmitter.on('menuLink', this.onMenuNavigationEvent.bind(this));;
|
||||||
|
IlinkEmitter.on('userconnect', this.onUserConnect.bind(this));;
|
||||||
|
IlinkEmitter.on('userdisconnect', this.hideSideMenu.bind(this));;
|
||||||
|
IlinkEmitter.on('langueChange', this.updateLangue.bind(this));;
|
||||||
|
this.configuration = new Configuration();
|
||||||
|
}
|
||||||
|
|
||||||
static navigatorStyle = {
|
retrieveAndroidInformation() {
|
||||||
statusBarColor: primaryDarkAdvanced,
|
this.configuration
|
||||||
};
|
._getData()
|
||||||
commandeListe
|
.then(lang => {
|
||||||
constructor(props) {
|
if (lang) {
|
||||||
super(props);
|
I18n.locale = lang;;
|
||||||
this.state = this.initState();
|
readUser().then(result => {
|
||||||
IlinkEmitter.on("menuLink", this.onMenuNavigationEvent.bind(this))
|
setTimeout(() => {
|
||||||
IlinkEmitter.on("userconnect", this.onUserConnect.bind(this))
|
this.updateUser(result);
|
||||||
IlinkEmitter.on("userdisconnect", this.hideSideMenu.bind(this))
|
}, 3000);;
|
||||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
});;
|
||||||
this.configuration = new Configuration();
|
} else {
|
||||||
}
|
RNDeviceInformation.getDeviceCountryCode().then(code => {
|
||||||
|
I18n.locale = code.toLowerCase();;
|
||||||
|
readUser()
|
||||||
|
.then(result => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateUser(result);
|
||||||
|
}, 3000);;
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.props.navigation.navigate('Auth');;
|
||||||
|
});
|
||||||
|
});;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
RNDeviceInformation.getDeviceCountryCode().then(code => {
|
||||||
|
I18n.locale = code.toLowerCase();;
|
||||||
|
readUser()
|
||||||
|
.then(result => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.updateUser(result);
|
||||||
|
}, 3000);;
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.props.navigation.navigate('Auth');;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});;
|
||||||
|
|
||||||
retrieveAndroidInformation() {
|
return '';;
|
||||||
this.configuration._getData().then((lang) => {
|
}
|
||||||
if (lang) {
|
componentDidMount() {
|
||||||
I18n.locale = lang
|
const items = this.props.navigation.router.childRouters.sta.childRouters;
|
||||||
readUser().then((result) => {
|
// items.filter((item)=>item.)
|
||||||
setTimeout(() => {
|
this.setState({items: items});;
|
||||||
this.updateUser(result);
|
this.retrieveAndroidInformation();
|
||||||
}, 3000)
|
}
|
||||||
})
|
updateLangue() {
|
||||||
} else {
|
this.setState({lang: 'change'});;
|
||||||
RNDeviceInformation.getDeviceCountryCode().then((code) => {
|
this.forceUpdate();;
|
||||||
I18n.locale = code.toLowerCase()
|
}
|
||||||
readUser().then((result) => {
|
componentWillUnmount() {}
|
||||||
setTimeout(() => {
|
onMenuNavigationEvent(menuOption) {
|
||||||
this.updateUser(result);
|
/* Navigation.mergeOptions(this.props.componentId,{
|
||||||
}, 3000)
|
|
||||||
}).catch((e) => {
|
|
||||||
this.props.navigation.navigate("Auth")
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
RNDeviceInformation.getDeviceCountryCode().then((code) => {
|
|
||||||
I18n.locale = code.toLowerCase()
|
|
||||||
readUser().then((result) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.updateUser(result);
|
|
||||||
}, 3000)
|
|
||||||
}).catch((e) => {
|
|
||||||
this.props.navigation.navigate("Auth")
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
componentDidMount() {
|
|
||||||
const items = this.props.navigation.router.childRouters.sta.childRouters;
|
|
||||||
// items.filter((item)=>item.)
|
|
||||||
this.setState({ items: items })
|
|
||||||
this.retrieveAndroidInformation()
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
updateLangue() {
|
|
||||||
this.setState({ lang: "change" })
|
|
||||||
this.forceUpdate()
|
|
||||||
}
|
|
||||||
componentWillUnmount() {
|
|
||||||
|
|
||||||
}
|
|
||||||
onMenuNavigationEvent(menuOption) {
|
|
||||||
/* Navigation.mergeOptions(this.props.componentId,{
|
|
||||||
sideMenu: {
|
sideMenu: {
|
||||||
left: {
|
left: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -114,19 +133,17 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
this.setState({currentId:1})
|
this.setState({currentId:1})
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
onUserConnect() {
|
onUserConnect() {
|
||||||
readUser().then((user) => {
|
readUser().then(user => {
|
||||||
if (user !== null && user !== undefined) {
|
if (user !== null && user !== undefined) {
|
||||||
this.updateUser(user);
|
this.updateUser(user);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
onNavigatorEvent(event) {
|
onNavigatorEvent(event) {}
|
||||||
|
hideSideMenu() {
|
||||||
}
|
/* Navigation.mergeOptions("drawer", {
|
||||||
hideSideMenu() {
|
|
||||||
/* Navigation.mergeOptions("drawer", {
|
|
||||||
sideMenu: {
|
sideMenu: {
|
||||||
left: {
|
left: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -134,46 +151,142 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
}
|
}
|
||||||
initState() {
|
initState() {
|
||||||
return {
|
return {
|
||||||
user: null,
|
user: null,
|
||||||
menu: [],
|
menu: [],
|
||||||
currentId: 0,
|
currentId: 0,
|
||||||
}
|
};;
|
||||||
}
|
}
|
||||||
getGeolocatedUserMenu() {
|
getGeolocatedUserMenu() {
|
||||||
return [
|
return [
|
||||||
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
{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('MY_ACCOUNT'),
|
||||||
, { title: I18n.t('ADD_NETWORK'), id: 11, key: 11, icon: 'md-people', active: false }
|
id: 1,
|
||||||
, { title: I18n.t('CHANGE_INFORMATION'), id: 13, key: 13, icon: 'md-person', active: false }
|
key: 1,
|
||||||
, { title: I18n.t('NOTIFICATIONS'), id: 3, key: 3, icon: 'md-notifications', active: false }
|
icon: 'md-person',
|
||||||
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
active: false,
|
||||||
}
|
},
|
||||||
getSuperUserMenu() {
|
{
|
||||||
return [
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
id: 2,
|
||||||
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
key: 2,
|
||||||
, { title: I18n.t('CREDIT_MANAGE'), id: 2, key: 2, icon: 'md-card', active: false }
|
icon: 'md-card',
|
||||||
, { title: I18n.t('GROUP_MANAGE'), id: 5, key: 5, icon: 'md-people', active: false }
|
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 }]
|
{
|
||||||
}
|
title: I18n.t('ADD_NETWORK'),
|
||||||
getHyperUsermenu() {
|
id: 11,
|
||||||
return [
|
key: 11,
|
||||||
{ title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true }
|
icon: 'md-people',
|
||||||
, { title: I18n.t('MY_ACCOUNT'), id: 1, key: 1, icon: 'md-person', active: false }
|
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('CHANGE_INFORMATION'),
|
||||||
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
id: 13,
|
||||||
}
|
key: 13,
|
||||||
updateUser(user) {
|
icon: 'md-person',
|
||||||
let menu = [];
|
active: false,
|
||||||
if (user !== undefined) {
|
},
|
||||||
/* Navigation.mergeOptions("drawer", {
|
{
|
||||||
|
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: {
|
sideMenu: {
|
||||||
left: {
|
left: {
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -181,76 +294,97 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
if (user.category !== undefined) {
|
if (user.category !== undefined) {
|
||||||
switch (user.category) {
|
switch (user.category) {
|
||||||
case "geolocated":
|
case 'geolocated':
|
||||||
menu = this.getGeolocatedUserMenu();
|
menu = this.getGeolocatedUserMenu();
|
||||||
break;
|
break;
|
||||||
case "super":
|
case 'super':
|
||||||
menu = this.getSuperUserMenu();
|
menu = this.getSuperUserMenu();
|
||||||
break;
|
break;
|
||||||
case "hyper":
|
case 'hyper':
|
||||||
menu = this.getHyperUsermenu();
|
menu = this.getHyperUsermenu();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
menu = this.getUserMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
this.setState({user: user, menu: menu});
|
||||||
} else {
|
}
|
||||||
menu = this.getUserMenu();
|
getUserMenu() {
|
||||||
}
|
return [
|
||||||
}
|
{title: I18n.t('MAP'), id: 0, key: 0, icon: 'md-map', active: true},
|
||||||
|
{
|
||||||
|
title: I18n.t('MY_ACCOUNT'),
|
||||||
this.setState({ user: user, menu: menu });
|
id: 1,
|
||||||
}
|
key: 1,
|
||||||
getUserMenu() {
|
icon: 'md-person',
|
||||||
return [
|
active: false,
|
||||||
{ 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('NOTIFICATIONS'),
|
||||||
, { title: I18n.t('CONFIGURATIONS'), id: 4, icon: 'md-settings', active: false }]
|
id: 3,
|
||||||
}
|
key: 3,
|
||||||
_renderItem = (item) => {
|
icon: 'md-notifications',
|
||||||
if (item === "creditrequest" || item === 'historyItemDetails' || item === 'filter' || item === 'networks' || item === 'createIdentification') {
|
active: false,
|
||||||
return null
|
},
|
||||||
} else {
|
{
|
||||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
title: I18n.t('CONFIGURATIONS'),
|
||||||
return (
|
id: 4,
|
||||||
<TouchableOpacity onPress={() => {
|
icon: 'md-settings',
|
||||||
this.props.navigation.toggleDrawer();
|
active: false,
|
||||||
this.setState({ currentId: item.id })
|
},
|
||||||
this.props.navigation.navigate(item)
|
];
|
||||||
}}
|
}
|
||||||
>
|
_renderItem = item => {
|
||||||
<View
|
if (
|
||||||
style={items.content}
|
item === 'creditrequest' ||
|
||||||
>
|
item === 'historyItemDetails' ||
|
||||||
<Icon
|
item === 'filter' ||
|
||||||
name={this.getIcon(item)}
|
item === 'networks' ||
|
||||||
size={32}
|
item === 'createIdentification'
|
||||||
/>
|
) {
|
||||||
<Text style={{
|
return null;;
|
||||||
marginLeft: 20,
|
} else {
|
||||||
fontSize: 16,
|
const color = this.state.currentId === item.id ? theme.accent : 'grey';;
|
||||||
}}>{this.getNameItems(item)}
|
return (
|
||||||
</Text>
|
<TouchableOpacity
|
||||||
</View></TouchableOpacity>)
|
onPress={() => {
|
||||||
}
|
this.props.navigation.toggleDrawer();
|
||||||
};
|
this.setState({currentId: item.id});;
|
||||||
_onPress = ((item) => {
|
this.props.navigation.navigate(item);;
|
||||||
|
}}>
|
||||||
this.setState({ currentId: item.id })
|
<View style={items.content}>
|
||||||
let current = this.state.menu.filter((item) => { return item.active })[0]
|
<Icon name={this.getIcon(item)} size={32} />
|
||||||
current.active = false;
|
<Text
|
||||||
item.active = true;
|
style={{
|
||||||
let newMenu = [];
|
marginLeft: 20,
|
||||||
this.state.menu.forEach(function (it) {
|
fontSize: 16,
|
||||||
if (it.id === current.id) newMenu.push(current)
|
}}>
|
||||||
else if (it.id === item.id) newMenu.push(item)
|
{this.getNameItems(item)}
|
||||||
else newMenu.push(it)
|
</Text>
|
||||||
}
|
</View>
|
||||||
)
|
</TouchableOpacity>;
|
||||||
this.setState({ menu: newMenu })
|
);
|
||||||
/* switch(item.id){
|
}
|
||||||
|
};
|
||||||
|
_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){
|
||||||
case 2:
|
case 2:
|
||||||
Navigation.push(route.stackRoot,{
|
Navigation.push(route.stackRoot,{
|
||||||
component: {
|
component: {
|
||||||
|
@ -393,60 +527,80 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
*/ });
|
*/
|
||||||
getNameItems(item) {
|
};
|
||||||
|
getNameItems(item) {
|
||||||
|
let icon = item;;
|
||||||
|
switch (item) {
|
||||||
|
case 'home':
|
||||||
|
icon = I18n.t('MAP');;
|
||||||
|
break;;
|
||||||
|
case 'useraccount':
|
||||||
|
icon = I18n.t('MY_ACCOUNT');;
|
||||||
|
break;;
|
||||||
|
case 'Historique':
|
||||||
|
icon = I18n.t('CREDIT_MANAGE');;
|
||||||
|
break;;
|
||||||
|
case 'superviseurgroup':
|
||||||
|
icon = I18n.t('GROUP_MANAGE');;
|
||||||
|
break;;
|
||||||
|
case 'updateinformation':
|
||||||
|
icon = I18n.t('CHANGE_INFORMATION');;
|
||||||
|
break;;
|
||||||
|
case 'notificationview':
|
||||||
|
icon = I18n.t('NOTIFICATIONS');;
|
||||||
|
break;;
|
||||||
|
case 'configuration':
|
||||||
|
icon = I18n.t('CONFIGURATIONS');;
|
||||||
|
break;;
|
||||||
|
case 'addNetwork':
|
||||||
|
icon = I18n.t('ADD_NETWORK');;
|
||||||
|
break;;
|
||||||
|
case 'about':
|
||||||
|
icon = I18n.t('ABOUT_');;
|
||||||
|
|
||||||
|
|
||||||
let icon = item
|
|
||||||
switch (item) {
|
|
||||||
case "home": icon = I18n.t('MAP')
|
|
||||||
break
|
|
||||||
case 'useraccount': icon = I18n.t('MY_ACCOUNT')
|
|
||||||
break
|
|
||||||
case 'Historique': icon = I18n.t('CREDIT_MANAGE')
|
|
||||||
break
|
|
||||||
case "superviseurgroup": icon = I18n.t('GROUP_MANAGE')
|
|
||||||
break
|
|
||||||
case "updateinformation": icon = I18n.t("CHANGE_INFORMATION")
|
|
||||||
break
|
|
||||||
case 'notificationview': icon = I18n.t('NOTIFICATIONS')
|
|
||||||
break
|
|
||||||
case 'configuration': icon = I18n.t('CONFIGURATIONS')
|
|
||||||
break;
|
|
||||||
case 'addNetwork': icon = I18n.t('ADD_NETWORK')
|
|
||||||
break
|
|
||||||
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':
|
||||||
break
|
icon = 'md-map';;
|
||||||
case 'useraccount': icon = "md-person"
|
break;;
|
||||||
break
|
case 'useraccount':
|
||||||
case 'Historique': icon = "md-card"
|
icon = 'md-person';;
|
||||||
break
|
break;;
|
||||||
case "superviseurgroup": icon = "md-people"
|
case 'Historique':
|
||||||
break
|
icon = 'md-card';;
|
||||||
case 'notificationview': icon = "md-notifications";
|
break;;
|
||||||
break
|
case 'superviseurgroup':
|
||||||
case "updateinformation": icon = "md-people"
|
icon = 'md-people';;
|
||||||
break
|
break;;
|
||||||
case 'configuration': icon = 'md-settings'
|
case 'notificationview':
|
||||||
break;
|
icon = 'md-notifications';
|
||||||
case 'addNetwork': icon = "md-people"
|
break;;
|
||||||
break
|
case 'updateinformation':
|
||||||
case 'about': icon = 'md-contacts';
|
icon = 'md-people';;
|
||||||
break;
|
break;;
|
||||||
}
|
case 'configuration':
|
||||||
return icon;
|
icon = 'md-settings';;
|
||||||
}
|
break;
|
||||||
render() {
|
case 'addNetwork':
|
||||||
var name = this.state.user ? this.state.user.firstname : "";
|
icon = 'md-people';;
|
||||||
const surname = this.state.user ? this.state.user.lastname : "";
|
break;;
|
||||||
if (!this.state.lang && this.state.lang !== "change")
|
case 'about':
|
||||||
return (
|
icon = 'md-contacts';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
var name = this.state.user ? this.state.user.firstname : '';
|
||||||
|
const surname = this.state.user ? this.state.user.lastname : '';
|
||||||
|
if (!this.state.lang && this.state.lang !== 'change')
|
||||||
|
{return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<View
|
<View
|
||||||
style={styles.headercontent}
|
style={styles.headercontent}
|
||||||
|
@ -470,112 +624,114 @@ export default class OptionsMenu extends Component<Props> {
|
||||||
onPress={() => this.userDeconnect()}
|
onPress={() => this.userDeconnect()}
|
||||||
>{I18n.t('DISCONNEXION')}</Button>
|
>{I18n.t('DISCONNEXION')}</Button>
|
||||||
</View>
|
</View>
|
||||||
)
|
)};
|
||||||
else {
|
else {
|
||||||
setTimeout(() => this.setState({ lang: "" }), 500)
|
setTimeout(() => this.setState({lang: ''}), 500);;
|
||||||
return (<View />)
|
return <View />;;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userDeconnect() {
|
userDeconnect() {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
I18n.t('DISCONNEXION'),
|
I18n.t('DISCONNEXION'),
|
||||||
I18n.t('DISCONNEXION_TEXT'),
|
I18n.t('DISCONNEXION_TEXT'),
|
||||||
[
|
[
|
||||||
{},
|
{},
|
||||||
{ text: I18n.t('NO'), onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
|
{
|
||||||
{
|
text: I18n.t('NO'),
|
||||||
text: I18n.t('YES'), onPress: () => {
|
onPress: () => console.log('Cancel Pressed'),
|
||||||
disconnect().then(() => {
|
style: 'cancel',
|
||||||
IlinkEmitter.emit("userdisconnect");
|
},
|
||||||
this.props.navigation.navigate("Auth")
|
{
|
||||||
})
|
text: I18n.t('YES'),
|
||||||
}
|
onPress: () => {
|
||||||
},
|
disconnect().then(() => {
|
||||||
],
|
IlinkEmitter.emit('userdisconnect');
|
||||||
{ cancelable: false }
|
this.props.navigation.navigate('Auth');;
|
||||||
)
|
});;
|
||||||
}
|
},,
|
||||||
watchUser() {
|
},
|
||||||
readUser().then((user) => {
|
],
|
||||||
if (user !== null && user !== undefined) {
|
{cancelable: false},
|
||||||
this.updateUser(user);
|
);;
|
||||||
}
|
}
|
||||||
});
|
watchUser() {
|
||||||
}
|
readUser().then(user => {
|
||||||
|
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: {
|
||||||
},
|
backgroundColor: '#000',
|
||||||
backgroundd_drawer: {
|
},
|
||||||
backgroundColor: '#000',
|
listbackground: {},
|
||||||
},
|
actionButtonIcon: {
|
||||||
listbackground: {
|
fontSize: 20,
|
||||||
},
|
height: 22,
|
||||||
actionButtonIcon: {
|
color: 'white',
|
||||||
fontSize: 20,
|
},
|
||||||
height: 22,
|
welcome: {
|
||||||
color: 'white',
|
fontSize: 20,
|
||||||
},
|
textAlign: 'center',
|
||||||
welcome: {
|
margin: 10,
|
||||||
fontSize: 20,
|
},
|
||||||
textAlign: 'center',
|
instructions: {
|
||||||
margin: 10,
|
textAlign: 'center',
|
||||||
},
|
color: '#333333',
|
||||||
instructions: {
|
marginBottom: 5,
|
||||||
textAlign: 'center',
|
},
|
||||||
color: '#333333',
|
|
||||||
marginBottom: 5,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,99 +1,118 @@
|
||||||
|
/* eslint-disable react-native/no-inline-styles */
|
||||||
import React, {Component} from 'react';
|
import React, {Component} from 'react';
|
||||||
import {Image, PermissionsAndroid, StatusBar, StyleSheet, View} from 'react-native';
|
import {
|
||||||
import {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
Image,
|
||||||
import I18n from 'react-native-i18n'
|
PermissionsAndroid,
|
||||||
import {getPasObject, getPubActiveObject, readUser} from '../../webservice/AuthApi';
|
StatusBar,
|
||||||
import Configuration from "../../webservice/persistences/Configuration";
|
StyleSheet,
|
||||||
import '../ads/InterticielAds'
|
View,
|
||||||
|
} from 'react-native';
|
||||||
|
import {
|
||||||
|
responsiveFontSize,
|
||||||
|
responsiveHeight,
|
||||||
|
responsiveWidth,
|
||||||
|
} from 'react-native-responsive-dimensions';
|
||||||
|
import I18n from 'react-native-i18n';
|
||||||
|
import {
|
||||||
|
getPasObject,
|
||||||
|
getPubActiveObject,
|
||||||
|
readUser,
|
||||||
|
} from '../../webservice/AuthApi';
|
||||||
|
import Configuration from '../../webservice/persistences/Configuration';
|
||||||
|
import '../ads/InterticielAds';
|
||||||
import * as Animatable from 'react-native-animatable';
|
import * as Animatable from 'react-native-animatable';
|
||||||
import DeviceInfo from 'react-native-device-info';
|
import DeviceInfo from 'react-native-device-info';
|
||||||
import {bindActionCreators} from "redux";
|
import {bindActionCreators} from 'redux';
|
||||||
import getAuthApiKey from "../../webservice/AuthKeyApi";
|
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
||||||
import {connect} from "react-redux";
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
const theme = require('./../../utils/theme.json');
|
const theme = require('./../../utils/theme.json');
|
||||||
const route = require('./../../route.json');
|
const route = require('./../../route.json');
|
||||||
|
|
||||||
class SplashScreen extends Component {
|
class SplashScreen extends Component {
|
||||||
static navigatorStyle = {
|
static navigatorStyle = {
|
||||||
drawUnderNavBar: true,
|
drawUnderNavBar: true,
|
||||||
navBarHidden: true,
|
navBarHidden: true,
|
||||||
drawUnderStatusBar: false,
|
drawUnderStatusBar: false,
|
||||||
statusBarHidden: false,
|
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) {
|
||||||
|
console.log('SPLASHSCREEN PROPS', this.props);
|
||||||
|
if (typeof this.props.navigation.state.params !== 'undefined') {
|
||||||
|
if (result === null || result === undefined) {
|
||||||
|
this.props.navigation.navigate('Auth');
|
||||||
|
} else {
|
||||||
|
switch (this.props.navigation.state.params.routeName) {
|
||||||
|
case 'historyItemDetails':
|
||||||
|
this.props.navigation.navigate(
|
||||||
|
this.props.navigation.state.params.routeName,
|
||||||
|
{
|
||||||
|
item: this.props.navigation.state.params.params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
//
|
default:
|
||||||
constructor(props) {
|
this.props.navigation.navigate(
|
||||||
super(props);
|
this.props.navigation.state.params.routeName,
|
||||||
this.state = {
|
{
|
||||||
|
id: this.props.navigation.state.params.params.id,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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';
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
workUserResult(result) {
|
way2 = route.login;
|
||||||
console.log("SPLASHSCREEN PROPS", this.props);
|
}
|
||||||
if (typeof this.props.navigation.state.params !== 'undefined') {
|
this.props.navigation.navigate(way);
|
||||||
if (result === null || result === undefined) {
|
}
|
||||||
this.props.navigation.navigate("Auth");
|
|
||||||
} else {
|
|
||||||
switch (this.props.navigation.state.params.routeName) {
|
|
||||||
case 'historyItemDetails':
|
|
||||||
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
|
||||||
item: this.props.navigation.state.params.params
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
/* Navigation.setStackRoot(route.stackRoot,
|
||||||
this.props.navigation.navigate(this.props.navigation.state.params.routeName, {
|
|
||||||
id: this.props.navigation.state.params.params.id
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
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: {
|
{ component: {
|
||||||
name: way,
|
name: way,
|
||||||
}
|
}
|
||||||
|
@ -112,187 +131,200 @@ class SplashScreen extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});*/
|
});*/
|
||||||
|
}
|
||||||
}
|
componentDidMount() {
|
||||||
componentDidMount() {
|
try {
|
||||||
try {
|
this.requestCameraPermission();
|
||||||
this.requestCameraPermission()
|
} catch (e) {
|
||||||
} catch (e) {
|
console.log(e);
|
||||||
console.log(e)
|
}
|
||||||
|
this.config = new Configuration();
|
||||||
|
this.retrieveAndroidInformation();
|
||||||
|
setTimeout(() => this.bounce(), 500);
|
||||||
|
this.bounce();
|
||||||
|
readUser().then(async user => {
|
||||||
|
if (user) {
|
||||||
|
if (user !== undefined) {
|
||||||
|
if (user.phone !== undefined) {
|
||||||
|
this.props.getAuthApiKey(user.phone);
|
||||||
}
|
}
|
||||||
this.config = new Configuration();
|
}
|
||||||
this.retrieveAndroidInformation()
|
}
|
||||||
setTimeout(() => this.bounce(), 500)
|
});
|
||||||
this.bounce()
|
}
|
||||||
readUser().then(async (user) => {
|
async requestCameraPermission() {
|
||||||
if (user) {
|
try {
|
||||||
if (user !== undefined) {
|
const granted = await PermissionsAndroid.request(
|
||||||
if (user.phone !== undefined)
|
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
||||||
this.props.getAuthApiKey(user.phone);
|
{
|
||||||
}
|
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}
|
||||||
|
/>
|
||||||
|
</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();
|
||||||
|
console.warn(code);
|
||||||
|
I18n.locale = code.toLowerCase();
|
||||||
|
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);
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.setPubActive(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.warn(e.message);
|
||||||
|
DeviceInfo.getDeviceLocale().then(code => {
|
||||||
|
console.warn(code);
|
||||||
|
|
||||||
}
|
I18n.locale = code.toLowerCase();
|
||||||
async requestCameraPermission() {
|
readUser()
|
||||||
try {
|
.then(result => {
|
||||||
const granted = await PermissionsAndroid.request(
|
setTimeout(() => {
|
||||||
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
|
this.workUserResult(result);
|
||||||
{
|
}, 3000);
|
||||||
'title': 'Cool Photo App Camera Permission',
|
})
|
||||||
'message': 'Cool Photo App needs access to your camera ' +
|
.catch(e => {
|
||||||
'so you can take awesome pictures.'
|
this.props.navigation.navigate('Auth');
|
||||||
}
|
});
|
||||||
)
|
});
|
||||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
});
|
||||||
|
|
||||||
} else {
|
return '';
|
||||||
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();
|
|
||||||
console.warn(code)
|
|
||||||
I18n.locale = code.toLowerCase()
|
|
||||||
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)
|
|
||||||
}).catch((e) => {
|
|
||||||
this.setPubActive(data)
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
}).catch((e) => {
|
|
||||||
console.warn(e.message)
|
|
||||||
DeviceInfo.getDeviceLocale().then((code) => {
|
|
||||||
console.warn(code)
|
|
||||||
|
|
||||||
I18n.locale = code.toLowerCase()
|
|
||||||
readUser().then((result) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.workUserResult(result)
|
|
||||||
}, 3000)
|
|
||||||
}).catch((e) => {
|
|
||||||
this.props.navigation.navigate("Auth")
|
|
||||||
});
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
const mapStateToProps = state => ({
|
||||||
loading: state.authKeyReducer.loading,
|
loading: state.authKeyReducer.loading,
|
||||||
authKey: state.authKeyReducer.authKey,
|
authKey: state.authKeyReducer.authKey,
|
||||||
error: state.authKeyReducer.error,
|
error: state.authKeyReducer.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
const mapDispatchToProps = dispatch =>
|
||||||
getAuthApiKey,
|
bindActionCreators(
|
||||||
}, dispatch);
|
{
|
||||||
|
getAuthApiKey,
|
||||||
|
},
|
||||||
|
dispatch,
|
||||||
|
);
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(SplashScreen);
|
export default connect(mapStateToProps, mapDispatchToProps)(SplashScreen);
|
||||||
|
|
||||||
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: {
|
||||||
},
|
fontSize: responsiveFontSize(4),
|
||||||
title: {
|
alignSelf: 'center',
|
||||||
fontSize: responsiveFontSize(4),
|
fontWeight: 'bold',
|
||||||
alignSelf: 'center',
|
color: 'white',
|
||||||
fontWeight: 'bold',
|
},
|
||||||
color: 'white',
|
});
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,7 +10,7 @@
|
||||||
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/ ; cd ./android ; sudo ./gradlew clean ; sudo ./gradlew assembleDebug && cd .. && sudo adb install ./android/app/build/outputs/apk/debug/app-debug.apk",
|
"debug-build": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/ ; cd ./android ; sudo ./gradlew clean ; sudo ./gradlew assembleDebug && cd .. && sudo adb install ./android/app/build/outputs/apk/debug/app-debug.apk",
|
||||||
"start-emulator": "emulator -avd Nexus_5X_API_29 -dns-server 8.8.8.8",
|
"start-emulator": "emulator -avd Nexus_5X_API_29 -dns-server 8.8.8.8",
|
||||||
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
"start-emulator-pixel": "emulator -avd Pixel_2_API_29 -dns-server 8.8.8.8",
|
||||||
"run-debug": "cd android && ./gradlew clean && cd .. && react-native run-android",
|
"run-debug": "cd android && gradlew clean && cd .. && react-native run-android",
|
||||||
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"
|
"run-release": "cd android && ./gradlew clean && cd .. && react-native run-android --variant=release"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
"react-native-loader": "^1.2.1",
|
"react-native-loader": "^1.2.1",
|
||||||
"react-native-loading-spinner-overlay": "^1.0.1",
|
"react-native-loading-spinner-overlay": "^1.0.1",
|
||||||
"react-native-local-mongodb": "^2.2.9",
|
"react-native-local-mongodb": "^2.2.9",
|
||||||
"react-native-maps": "0.26.1",
|
"react-native-maps": "^1.4.0",
|
||||||
"react-native-maps-directions": "^1.7.0",
|
"react-native-maps-directions": "^1.7.0",
|
||||||
"react-native-material-bottom-navigation": "^1.0.3",
|
"react-native-material-bottom-navigation": "^1.0.3",
|
||||||
"react-native-material-bottom-navigation-performance": "^0.7.8",
|
"react-native-material-bottom-navigation-performance": "^0.7.8",
|
||||||
|
|
129
qApp.android.js
129
qApp.android.js
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable prettier/prettier */
|
||||||
/**
|
/**
|
||||||
* Sample React Native App
|
* Sample React Native App
|
||||||
* https://github.com/facebook/react-native
|
* https://github.com/facebook/react-native
|
||||||
|
@ -13,37 +14,37 @@ import {
|
||||||
createStackNavigator,
|
createStackNavigator,
|
||||||
createDrawerNavigator,
|
createDrawerNavigator,
|
||||||
createAppContainer,
|
createAppContainer,
|
||||||
createBottomTabNavigator
|
createBottomTabNavigator,
|
||||||
} from 'react-navigation';
|
} 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';
|
||||||
import Help from "./screens/help/Help";
|
import Help from './screens/help/Help';
|
||||||
import ForgottenPassword from "./screens/login/ForgottenPassword";
|
import ForgottenPassword from './screens/login/ForgottenPassword';
|
||||||
import TypeChoiser from "./screens/login/TypeChoiser";
|
import TypeChoiser from './screens/login/TypeChoiser';
|
||||||
import CreateUserStep2 from "./screens/login/createUserStep2";
|
import CreateUserStep2 from './screens/login/createUserStep2';
|
||||||
import createAccount from "./screens/login/createAccount";
|
import createAccount from './screens/login/createAccount';
|
||||||
import UpdateInformations from "./screens/account/UpdateInformations";
|
import UpdateInformations from './screens/account/UpdateInformations';
|
||||||
import UserAccount from "./screens/account/UserAccount";
|
import UserAccount from './screens/account/UserAccount';
|
||||||
import ActivateAccount from "./screens/login/ActivateAccount";
|
import ActivateAccount from './screens/login/ActivateAccount';
|
||||||
import Notifications from "./screens/notifications/Notifications";
|
import Notifications from './screens/notifications/Notifications';
|
||||||
import About from "./screens/configurations/About";
|
import About from './screens/configurations/About';
|
||||||
import Configurations from "./screens/configurations/Configurations";
|
import Configurations from './screens/configurations/Configurations';
|
||||||
|
|
||||||
import History from './screens/history-request/History'
|
import History from './screens/history-request/History';
|
||||||
import OptionsMenu from "./screens/optionMenu/OptionsMenu";
|
import OptionsMenu from './screens/optionMenu/OptionsMenu';
|
||||||
import Home from "./screens/home/Home";
|
import Home from './screens/home/Home';
|
||||||
import HistoryItemDetails from "./screens/history-request/HistoryItemDetails";
|
import HistoryItemDetails from './screens/history-request/HistoryItemDetails';
|
||||||
import SuperViseurGroupeHome from "./screens/groupes/SuperViseurGroupeHome";
|
import SuperViseurGroupeHome from './screens/groupes/SuperViseurGroupeHome';
|
||||||
import HistoryRequester from "./screens/history-request/HistoryRequester";
|
import HistoryRequester from './screens/history-request/HistoryRequester';
|
||||||
import AddNetwork from "./screens/account/AddNetwork";
|
import AddNetwork from './screens/account/AddNetwork';
|
||||||
import MyHistory from "./screens/history-request/MyHistory";
|
import MyHistory from './screens/history-request/MyHistory';
|
||||||
import Icon from "react-native-vector-icons/FontAwesome5";
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import {GoogleAnalyticsTracker} from 'react-native-google-analytics-bridge';
|
import {GoogleAnalyticsTracker} from 'react-native-google-analytics-bridge';
|
||||||
import {Appbar} from 'react-native-paper';
|
import {Appbar} from 'react-native-paper';
|
||||||
|
|
||||||
import IconWithBadge from "./screens/IconWithBadge"
|
import IconWithBadge from './screens/IconWithBadge';
|
||||||
import I18n from "react-native-i18n";
|
import I18n from 'react-native-i18n';
|
||||||
import Filter from './screens/home/Filter';
|
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';
|
||||||
|
@ -56,7 +57,7 @@ const instructions = Platform.select({
|
||||||
});
|
});
|
||||||
|
|
||||||
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() {
|
render() {
|
||||||
|
@ -78,11 +79,11 @@ const AuthStack = createStackNavigator({
|
||||||
typeaccountcreate: TypeChoiser,
|
typeaccountcreate: TypeChoiser,
|
||||||
simpleusercreate: createAccount,
|
simpleusercreate: createAccount,
|
||||||
step2: CreateUserStep2,
|
step2: CreateUserStep2,
|
||||||
activateaccout: ActivateAccount
|
activateaccout: ActivateAccount,
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
headerMode: 'none'
|
headerMode: 'none',
|
||||||
})
|
});
|
||||||
const AppStack = createDrawerNavigator({
|
const AppStack = createDrawerNavigator({
|
||||||
sta: createStackNavigator({
|
sta: createStackNavigator({
|
||||||
home: Home,
|
home: Home,
|
||||||
|
@ -94,10 +95,10 @@ const AppStack = createDrawerNavigator({
|
||||||
},
|
},
|
||||||
notificationview: Notifications,
|
notificationview: Notifications,
|
||||||
configuration: Configurations,
|
configuration: Configurations,
|
||||||
about: About
|
about: About,
|
||||||
|
|
||||||
})
|
}),
|
||||||
}, {contentComponent: OptionsMenu, headerMode: 'none', contentOptions: {activeTintColor: theme.accent}})
|
}, {contentComponent: OptionsMenu, headerMode: 'none', contentOptions: {activeTintColor: theme.accent}});
|
||||||
const AppAgentStack = createDrawerNavigator({
|
const AppAgentStack = createDrawerNavigator({
|
||||||
sta: createStackNavigator({
|
sta: createStackNavigator({
|
||||||
home: Home,
|
home: Home,
|
||||||
|
@ -105,16 +106,16 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
Historique:
|
Historique:
|
||||||
{
|
{
|
||||||
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
||||||
headerMode: "none",
|
headerMode: 'none',
|
||||||
header: null,
|
header: null,
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
headerTitle: I18n.t('CREDIT_MANAGE'),
|
headerTitle: I18n.t('CREDIT_MANAGE'),
|
||||||
tabBarOptions: {
|
tabBarOptions: {
|
||||||
labelStyle: {
|
labelStyle: {
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontWeight: "bold"
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
navigationOptions: ({navigation}) => ({
|
navigationOptions: ({navigation}) => ({
|
||||||
header: null,
|
header: null,
|
||||||
|
@ -129,7 +130,7 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -139,23 +140,23 @@ const AppAgentStack = createDrawerNavigator({
|
||||||
updateinformation: UpdateInformations,
|
updateinformation: UpdateInformations,
|
||||||
notificationview: Notifications,
|
notificationview: Notifications,
|
||||||
configuration: Configurations,
|
configuration: Configurations,
|
||||||
about: About
|
about: About,
|
||||||
})
|
}),
|
||||||
}, {
|
}, {
|
||||||
contentComponent: OptionsMenu,
|
contentComponent: OptionsMenu,
|
||||||
backBehavior: "none",
|
backBehavior: 'none',
|
||||||
lazy: false,
|
lazy: false,
|
||||||
headerMode: 'none', contentOptions: {activeTintColor: theme.accent}
|
headerMode: 'none', contentOptions: {activeTintColor: theme.accent},
|
||||||
})
|
});
|
||||||
const AppAdministratorStack = createDrawerNavigator({
|
const AppAdministratorStack = createDrawerNavigator({
|
||||||
sta: createStackNavigator({
|
sta: createStackNavigator({
|
||||||
home: Home,
|
home: Home,
|
||||||
useraccount: UserAccount,
|
useraccount: UserAccount,
|
||||||
Historique: {
|
Historique: {
|
||||||
screen: createBottomTabNavigator({
|
screen: createBottomTabNavigator({
|
||||||
myDemand: MyHistory, OthersDemand: MyHistory
|
myDemand: MyHistory, OthersDemand: MyHistory,
|
||||||
}, {
|
}, {
|
||||||
headerMode: "none",
|
headerMode: 'none',
|
||||||
header: null,
|
header: null,
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
|
@ -163,7 +164,7 @@ const AppAdministratorStack = createDrawerNavigator({
|
||||||
labelStyle: {
|
labelStyle: {
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
navigationOptions: ({navigation}) => ({
|
navigationOptions: ({navigation}) => ({
|
||||||
header: null,
|
header: null,
|
||||||
|
@ -178,7 +179,7 @@ const AppAdministratorStack = createDrawerNavigator({
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
creditrequest: HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
|
@ -187,42 +188,42 @@ const AppAdministratorStack = createDrawerNavigator({
|
||||||
superviseurgroup: SuperViseurGroupeHome,
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
notificationview: Notifications,
|
notificationview: Notifications,
|
||||||
configuration: Configurations,
|
configuration: Configurations,
|
||||||
about: About
|
about: About,
|
||||||
|
|
||||||
})
|
}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
contentComponent: OptionsMenu,
|
contentComponent: OptionsMenu,
|
||||||
backBehavior: "none",
|
backBehavior: 'none',
|
||||||
headerMode: 'none'
|
headerMode: 'none',
|
||||||
})
|
});
|
||||||
const AppSuperAdministrator = createDrawerNavigator({
|
const AppSuperAdministrator = createDrawerNavigator({
|
||||||
sta: createStackNavigator({
|
sta: createStackNavigator({
|
||||||
home: Home,
|
home: Home,
|
||||||
useraccount: UserAccount,
|
useraccount: UserAccount,
|
||||||
Historique: {
|
Historique: {
|
||||||
screen: createBottomTabNavigator({OthersDemand: MyHistory}, {
|
screen: createBottomTabNavigator({OthersDemand: MyHistory}, {
|
||||||
headerMode: "none",
|
headerMode: 'none',
|
||||||
header: null,
|
header: null,
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
tabBarOptions: {
|
tabBarOptions: {
|
||||||
labelStyle: {
|
labelStyle: {
|
||||||
fontSize: 13,
|
fontSize: 13,
|
||||||
fontWeight: "bold"
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
navigationOptions: ({navigation}) => ({
|
navigationOptions: ({navigation}) => ({
|
||||||
title: I18n.t('CREDIT_MANAGE'),
|
title: I18n.t('CREDIT_MANAGE'),
|
||||||
headerMode: "none",
|
headerMode: 'none',
|
||||||
header: null,
|
header: null,
|
||||||
headerTitle: null,
|
headerTitle: null,
|
||||||
drawerIcon: ({tintColor}) => (
|
drawerIcon: ({tintColor}) => (
|
||||||
<Icon
|
<Icon
|
||||||
name={'credit-card'}
|
name={'credit-card'}
|
||||||
size={24}
|
size={24}
|
||||||
/>)
|
/>),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
creditrequest: HistoryRequester,
|
creditrequest: HistoryRequester,
|
||||||
|
@ -230,25 +231,25 @@ const AppSuperAdministrator = createDrawerNavigator({
|
||||||
superviseurgroup: SuperViseurGroupeHome,
|
superviseurgroup: SuperViseurGroupeHome,
|
||||||
notificationview: Notifications,
|
notificationview: Notifications,
|
||||||
configuration: Configurations,
|
configuration: Configurations,
|
||||||
about: About
|
about: About,
|
||||||
|
|
||||||
})
|
}),
|
||||||
}, {
|
}, {
|
||||||
contentComponent: OptionsMenu,
|
contentComponent: OptionsMenu,
|
||||||
backBehavior: "none",
|
backBehavior: 'none',
|
||||||
headerMode: 'none'
|
headerMode: 'none',
|
||||||
})
|
});
|
||||||
export const AppNavigator = createSwitchNavigator({
|
export const AppNavigator = createSwitchNavigator({
|
||||||
first: {
|
first: {
|
||||||
screen: SplashScreen
|
screen: SplashScreen,
|
||||||
},
|
},
|
||||||
App: AppStack,
|
App: AppStack,
|
||||||
AgentApp: AppAgentStack,
|
AgentApp: AppAgentStack,
|
||||||
adminApp: AppAdministratorStack,
|
adminApp: AppAdministratorStack,
|
||||||
supAdminApp: AppSuperAdministrator,
|
supAdminApp: AppSuperAdministrator,
|
||||||
Auth: AuthStack
|
Auth: AuthStack,
|
||||||
}, {
|
}, {
|
||||||
initialRouteName: 'first'
|
initialRouteName: 'first',
|
||||||
});
|
});
|
||||||
const AppContainer = createAppContainer(AppNavigator);
|
const AppContainer = createAppContainer(AppNavigator);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue