Correction de bugs

This commit is contained in:
Brice 2020-11-20 18:54:03 +01:00
parent 4a574e9a6f
commit 3f614d5a38
7 changed files with 1238 additions and 1247 deletions

File diff suppressed because one or more lines are too long

View File

@ -177,7 +177,7 @@
"ID_SAVINGS": "Saving ID",
"NON_APPLICABLE": "Not applicable",
"DATE": "Date",
"PAIEMENT_EAU_ELECTRICITY": "Water bill",
"PAIEMENT_EAU": "Water bill",
"PAIEMENT_ELECTRICITY": "Electricity bill",
"PAIEMENT_ECOLE": "School fees",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",

View File

@ -7,6 +7,7 @@ import I18n from "react-native-i18n"
import 'moment/locale/fr';
import 'moment/locale/es-us';
import 'moment/locale/en-au';
import 'moment/locale/en-gb';
import 'moment/locale/en-ca';
import 'moment/locale/en-ie';
import 'moment/locale/en-il';
@ -23,7 +24,7 @@ export class HistoryItem extends React.Component {
constructor(props) {
super(props);
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
console.log("Current Locale item", this.currentLocale);
moment.locale(this.currentLocale);
this.state = this.initState();
@ -132,7 +133,7 @@ export class HistoryItemSectionned extends PureComponent {
constructor(props) {
super(props);
this.state = this.initState();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
}
@ -246,7 +247,7 @@ export class HistoryListItem extends React.Component {
constructor(props) {
super(props);
this.state = this.initState();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
}

View File

@ -62,7 +62,7 @@ class HistoryItemDetails extends Component {
this.item = this.props.navigation.getParam("item", null).item;
}
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
let sta = ''

View File

@ -72,7 +72,7 @@ class MyHistory extends React.Component {
constructor(props) {
super(props, true);
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
this.state = this.initState();
readUser().then((user) => {

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import MapView, { Marker, MarkerAnimated } from "react-native-maps"
import React, {Component} from 'react';
import MapView, {Marker, MarkerAnimated} from "react-native-maps"
import PropTypes from 'prop-types';
import {
StyleSheet,
@ -8,20 +8,21 @@ import {
Text,
Alert
} from 'react-native';
const theme = require("../../utils/theme");
import { responsiveHeight, responsiveWidth } from "react-native-responsive-dimensions";
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
import IMarker from "./IMarker";
import I18n from "react-native-i18n";
import MapViewDirections from 'react-native-maps-directions';
const API_KEY = "AIzaSyAYOEp-Pckvc3TwOIulCICokKgmp14rGHI";
const mnetwork = require('./../../datas/img/png/home_network.png');
const othernetwork = require('./../../datas/img/png/other_net.png');
import { copilot, CopilotStep } from 'react-native-copilot';
import { IlinkEmitter } from "./../../utils/events";
import {copilot, CopilotStep} from 'react-native-copilot';
import {IlinkEmitter} from "./../../utils/events";
import DeviceInfo from 'react-native-device-info';
class IMap extends Component {
static propTypes = {
markers: PropTypes.array,
@ -44,6 +45,7 @@ class IMap extends Component {
static defaultProps = {
isNeedUserFocus: false
};
constructor(props) {
super(props)
this.state = {
@ -64,7 +66,7 @@ class IMap extends Component {
break;
case "en":
myPositionMarkerText = "Your are here";
myPositionMarkerText = "You are here";
break;
default:
@ -78,7 +80,7 @@ class IMap extends Component {
updateLangue() {
//Alert.alert("Langue", I18n.currentLocale(), [{ text: "Ok", onPress: () => { } }]);
this.setState({ positionMarkerText: this.getPositionMarkerText() })
this.setState({positionMarkerText: this.getPositionMarkerText()})
}
mapRef = (ref) => {
@ -92,30 +94,33 @@ class IMap extends Component {
}
getMapRef = () => this.mapview
componentWillReceiveProps(nextProps, nextContext) {
const markers = this.state.markers
const newmarkers = nextProps.markers
if (markers.length <= 0)
this.setState({ markers: newmarkers })
this.setState({markers: newmarkers})
else if (markers.length !== newmarkers) {
this.setState({ markers: newmarkers })
this.setState({markers: newmarkers})
}
this.setState({ isNeedUserFocus: nextProps.isNeedUserFocus })
this.setState({isNeedUserFocus: nextProps.isNeedUserFocus})
}
render() {
const { markers, initialRegion, myPosition, myNetwork, typeMap, selectedMarker } = this.props
const {markers, initialRegion, myPosition, myNetwork, typeMap, selectedMarker} = this.props
if (initialRegion !== null && myNetwork !== null)
return (
<View style={styles.container}>
<MapView
style={{ flex: 1 }}
style={{flex: 1}}
initialRegion={initialRegion}
mapType={typeMap}
ref={(re) => this.mapview = re}
onMapReady={this.props.onMapReady}
onLayout={this.props.onLayout}
onRegionChangeComplete={(re) => { this.onRegionChangeOver(re) }}>
onRegionChangeComplete={(re) => {
this.onRegionChangeOver(re)
}}>
{this.state.markers.map((item, index) => {
return (
<IMarker
@ -132,23 +137,27 @@ class IMap extends Component {
</MapView>
</View>)
else return (<View />)
else return (<View/>)
}
focusToUser() {
this.setState({ isNeedUserFocus: true })
this.setState({isNeedUserFocus: true})
}
closeUserFocus() {
this.setState({ isNeedUserFocus: false })
this.setState({isNeedUserFocus: false})
}
onRegionChangeOver(region) {
}
makeDirection() {
let { myPosition, selectedMarker, needRoad } = this.props
let {myPosition, selectedMarker, needRoad} = this.props
if (myPosition !== null && selectedMarker !== null && selectedMarker !== undefined && myPosition !== undefined && needRoad) {
setTimeout(() => {
if (!this.state.roadReady) {
this.setState({ roadReady: true })
this.setState({roadReady: true})
this.props.onNeedRoadError()
}
}, 10000)
@ -159,12 +168,12 @@ class IMap extends Component {
apikey={API_KEY}
strokeWidth={3}
onReady={(data) => {
this.setState({ roadReady: true })
this.setState({roadReady: true})
this.props.onNeedRoadReady(data)
}
}
onError={() => {
this.setState({ roadReady: true })
this.setState({roadReady: true})
this.props.onNeedRoadError()
}
}
@ -174,7 +183,7 @@ class IMap extends Component {
}
renderMyPosition() {
const { myPosition, myNetwork } = this.props
const {myPosition, myNetwork} = this.props
if (myPosition != null) {
return (<IMarker
isUser={true}
@ -253,8 +262,7 @@ const styles = StyleSheet.create({
zIndex: 1,
borderRadius: 32,
},
hambuger: {
},
hambuger: {},
topBar: {
position: 'absolute',
alignSelf: 'center',

View File

@ -814,7 +814,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -823,7 +823,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_rembourse + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_rembourse + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -832,7 +832,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.partiellement_rembourse + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.partiellement_rembourse + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -841,7 +841,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -850,7 +850,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -859,7 +859,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.retrait_cash + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.retrait_cash == 1 ? I18n.t('YES') : I18n.t('NO')}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -873,11 +873,11 @@ class WalletDetail extends Component {
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}>
<Text tyle={[Typography.body2]}>{I18n.t('DEMAND_DATE')}</Text>
<Text tyle={[Typography.body2]}>{I18n.t('VALIDATION_DATE')}</Text>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_demande}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_validation}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -911,16 +911,16 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{displayTransactionType(this.state.historyItemDetail.type_historique)}</Text>
style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
<Text style={[styles.body2]}>{I18n.t('ID_SAVINGS')}</Text>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_demande}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.id_epargne}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -956,7 +956,16 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}>
<Text tyle={[Typography.body2]}>{I18n.t('AMOUNT_WITHDRAWAL')}</Text>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant_retire + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -965,7 +974,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.taxe + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>
@ -974,7 +983,7 @@ class WalletDetail extends Component {
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + wallet.currency_code}</Text>
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.interet + ' ' + this.state.wallet.currency_code}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}>