Correction de bugs

This commit is contained in:
Brice 2020-11-20 18:06:19 +01:00
parent 0a1c1f896a
commit 4a574e9a6f
24 changed files with 4256 additions and 4079 deletions

85
App.js
View File

@ -6,12 +6,17 @@
* @flow * @flow
*/ */
import React, { Component } from 'react'; import React from 'react';
import { ActionSheetProvider, connectActionSheet } from '@expo/react-native-action-sheet' import {ActionSheetProvider} from '@expo/react-native-action-sheet'
import { Platform, StyleSheet, Text, View, YellowBox, AsyncStorage } from 'react-native'; import {AsyncStorage, Platform, StyleSheet} from 'react-native';
import { createAppContainer, HeaderBackButton, createSwitchNavigator, createStackNavigator, createBottomTabNavigator, createDrawerNavigator } from 'react-navigation'; import {
createAppContainer,
createBottomTabNavigator,
createDrawerNavigator,
createStackNavigator,
createSwitchNavigator
} from 'react-navigation';
import OneSignal from 'react-native-onesignal'; import OneSignal from 'react-native-onesignal';
import _ from 'lodash';
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";
@ -26,8 +31,6 @@ 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 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";
@ -36,18 +39,13 @@ 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 { Appbar } from 'react-native-paper';
import IconWithBadge from "./screens/IconWithBadge"
import I18n from "react-native-i18n"; import I18n from "react-native-i18n";
import Filter from './screens/home/Filter';
import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs';
import WalletDetail from './screens/wallet/WalletDetail'; import WalletDetail from './screens/wallet/WalletDetail';
import WalletSelect from './screens/wallet/WalletSelect'; import WalletSelect from './screens/wallet/WalletSelect';
import { PersistGate } from 'redux-persist/integration/react'; import {PersistGate} from 'redux-persist/integration/react';
import { store, persistor } from './redux/store'; import {persistor, store} from './redux/store';
import { Provider, connect } from 'react-redux'; import {Provider} from 'react-redux';
import WalletDepot from './screens/wallet/WalletDepot'; import WalletDepot from './screens/wallet/WalletDepot';
import WalletRetrait from './screens/wallet/WalletRetrait'; import WalletRetrait from './screens/wallet/WalletRetrait';
import CreateIdentification from './screens/identification/createIdentification'; import CreateIdentification from './screens/identification/createIdentification';
@ -73,10 +71,8 @@ import EnvoieCashVersCarteAgent from './screens/wallet/agent/EnvoieCashVersCarte
import EnvoiCashVersCashAgent from './screens/wallet/agent/EnvoiCashVersCashAgent'; import EnvoiCashVersCashAgent from './screens/wallet/agent/EnvoiCashVersCashAgent';
import ModifyIdentificationUser from './screens/identification/ModifyIdentificationUser'; import ModifyIdentificationUser from './screens/identification/ModifyIdentificationUser';
import CreateGroupNanoCredit from './screens/nano-credit/CreateGroupNanoCredit'; import CreateGroupNanoCredit from './screens/nano-credit/CreateGroupNanoCredit';
import { bindActionCreators } from 'redux';
import DemandValidationGroup from './screens/nano-credit/DemandGroupNanoCredit'; import DemandValidationGroup from './screens/nano-credit/DemandGroupNanoCredit';
import DemandGroupNanoCreditDetail from './screens/nano-credit/DemandGroupNanoCreditDetail'; import DemandGroupNanoCreditDetail from './screens/nano-credit/DemandGroupNanoCreditDetail';
import NavigationService from './utils/NavigationService';
import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit'; import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit';
import MyNanoCreditGroup from './screens/nano-credit/MyNanoCreditGroup'; import MyNanoCreditGroup from './screens/nano-credit/MyNanoCreditGroup';
import AskNanoCredit from './screens/nano-credit/AskNanoCredit'; import AskNanoCredit from './screens/nano-credit/AskNanoCredit';
@ -84,9 +80,7 @@ import RefundNanoCreditUser from './screens/nano-credit/RefundNanoCreditUser';
import CautionNanoCreditAgent from './screens/nano-credit/CautionNanoCreditAgent'; import CautionNanoCreditAgent from './screens/nano-credit/CautionNanoCreditAgent';
import EpargnerArgentUser from './screens/nano-credit/EpargnerArgentUser'; import EpargnerArgentUser from './screens/nano-credit/EpargnerArgentUser';
import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser'; import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
import { IlinkEmitter } from './utils/events'; import {IlinkEmitter} from './utils/events';
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
import { readUser } from './webservice/AuthApi';
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent"; import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
@ -119,8 +113,7 @@ const AppStack = createDrawerNavigator({
network:Networks,*/ network:Networks,*/
useraccount: { useraccount: {
screen: UserAccount, screen: UserAccount,
navigationOptions: { navigationOptions: {},
},
}, },
walletSelect: WalletSelect, walletSelect: WalletSelect,
createIdentificationUser: CreateIdentificationUser, createIdentificationUser: CreateIdentificationUser,
@ -149,7 +142,7 @@ const AppStack = createDrawerNavigator({
screen: DemandValidationGroup, screen: DemandValidationGroup,
navigationOptions: { navigationOptions: {
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'), tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
tabBarIcon: ({ focused, horizontal, tintColor }) => { tabBarIcon: ({focused, horizontal, tintColor}) => {
return (<Icon return (<Icon
size={20} size={20}
name={"users-cog"} name={"users-cog"}
@ -162,7 +155,7 @@ const AppStack = createDrawerNavigator({
screen: MyNanoCreditGroup, screen: MyNanoCreditGroup,
navigationOptions: { navigationOptions: {
tabBarLabel: I18n.t('MY_GROUP'), tabBarLabel: I18n.t('MY_GROUP'),
tabBarIcon: ({ focused, horizontal, tintColor }) => { tabBarIcon: ({focused, horizontal, tintColor}) => {
return (<Icon return (<Icon
size={20} size={20}
name={"users"} name={"users"}
@ -188,10 +181,10 @@ const AppStack = createDrawerNavigator({
headerTitle: null, headerTitle: null,
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#3e2465', inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' }, barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('MANAGE_GROUP'), drawerLabel: I18n.t('MANAGE_GROUP'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'account-multiple'} name={'account-multiple'}
size={24} size={24}
@ -208,7 +201,7 @@ const AppStack = createDrawerNavigator({
}, { }, {
contentComponent: OptionsMenu, contentComponent: OptionsMenu,
headerMode: 'none', headerMode: 'none',
contentOptions: { activeTintColor: theme.accent } contentOptions: {activeTintColor: theme.accent}
}) })
const AppAgentStack = createDrawerNavigator({ const AppAgentStack = createDrawerNavigator({
@ -220,7 +213,7 @@ const AppAgentStack = createDrawerNavigator({
validateIdentification: ValidateIdentification, validateIdentification: ValidateIdentification,
Historique: Historique:
{ {
screen: createBottomTabNavigator({ myDemand: MyHistory }, { screen: createBottomTabNavigator({myDemand: MyHistory}, {
headerMode: "none", headerMode: "none",
header: null, header: null,
headerTitle: null, headerTitle: null,
@ -238,10 +231,10 @@ const AppAgentStack = createDrawerNavigator({
headerTitle: null, headerTitle: null,
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#3e2465', inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' }, barStyle: {backgroundColor: '#694fad'},
/* headerLeft: (<HeaderBackButton />), */ /* headerLeft: (<HeaderBackButton />), */
drawerLabel: I18n.t('CREDIT_MANAGE'), drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'credit-card'} name={'credit-card'}
size={24} size={24}
@ -276,7 +269,7 @@ const AppAgentStack = createDrawerNavigator({
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({
@ -304,10 +297,10 @@ const AppAdministratorStack = createDrawerNavigator({
headerTitle: null, headerTitle: null,
activeColor: '#f0edf6', activeColor: '#f0edf6',
inactiveColor: '#3e2465', inactiveColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' }, barStyle: {backgroundColor: '#694fad'},
drawerLabel: I18n.t('CREDIT_MANAGE'), drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'credit-card'} name={'credit-card'}
size={24} size={24}
@ -326,7 +319,7 @@ const AppAdministratorStack = createDrawerNavigator({
walletRetrait: WalletRetrait walletRetrait: WalletRetrait
}) })
}, },
{ {
contentComponent: OptionsMenu, contentComponent: OptionsMenu,
backBehavior: "none", backBehavior: "none",
@ -339,7 +332,7 @@ const AppSuperAdministrator = createDrawerNavigator({
useraccount: UserAccount, useraccount: UserAccount,
walletSelect: WalletSelect, walletSelect: WalletSelect,
Historique: { Historique: {
screen: createBottomTabNavigator({ OthersDemand: MyHistory }, { screen: createBottomTabNavigator({OthersDemand: MyHistory}, {
headerMode: "none", headerMode: "none",
header: null, header: null,
headerTitle: null, headerTitle: null,
@ -356,7 +349,7 @@ const AppSuperAdministrator = createDrawerNavigator({
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}
@ -403,9 +396,13 @@ class App extends React.Component {
global.appHasLoaded = false; global.appHasLoaded = false;
//Remove this method to stop OneSignal Debugging //Remove this method to stop OneSignal Debugging
OneSignal.setLogLevel(6, 0); OneSignal.setLogLevel(6, 0);
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID. // Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", { kOSSettingsKeyAutoPrompt: false, kOSSettingsKeyInAppLaunchURL: false, kOSSettingsKeyInFocusDisplayOption: 2 }); OneSignal.init("e8e7251f-713d-4658-9510-86d877fa6a7c", {
kOSSettingsKeyAutoPrompt: false,
kOSSettingsKeyInAppLaunchURL: false,
kOSSettingsKeyInFocusDisplayOption: 2
});
OneSignal.inFocusDisplaying(2); // Controls what should happen if a notification is received while the app is open. 2 means that the notification will go directly to the device's notification center. OneSignal.inFocusDisplaying(2); // Controls what should happen if a notification is received while the app is open. 2 means that the notification will go directly to the device's notification center.
// The promptForPushNotifications function code will show the iOS push notification prompt. We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step below) // The promptForPushNotifications function code will show the iOS push notification prompt. We recommend removing the following code and instead using an In-App Message to prompt for notification permission (See step below)
@ -416,6 +413,10 @@ class App extends React.Component {
OneSignal.addEventListener('ids', this.onIds); OneSignal.addEventListener('ids', this.onIds);
} }
updateLangue() {
this.forceUpdate()
}
_getOneSignalIds = () => { _getOneSignalIds = () => {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
try { try {
@ -437,7 +438,7 @@ class App extends React.Component {
goToScreen = (routeName, params, isReset = true) => { goToScreen = (routeName, params, isReset = true) => {
const { navigator } = this.refs; const {navigator} = this.refs;
if (typeof navigator !== 'undefined') { if (typeof navigator !== 'undefined') {
console.log("APP HAS LOADED", global.appHasLoaded); console.log("APP HAS LOADED", global.appHasLoaded);
if (global.appHasLoaded) { if (global.appHasLoaded) {
@ -447,7 +448,7 @@ class App extends React.Component {
routeName, routeName,
params params
}); });
/* readUser().then((result) => { /* readUser().then((result) => {
if (result === null || result === undefined) { if (result === null || result === undefined) {
console.warn("APP HAS LOADED NOTIFICATION PARAMS", params); console.warn("APP HAS LOADED NOTIFICATION PARAMS", params);
@ -468,7 +469,7 @@ class App extends React.Component {
navigator.dispatch({ navigator.dispatch({
type: "Navigation/NAVIGATE", type: "Navigation/NAVIGATE",
routeName: "first", routeName: "first",
params: { routeName, params } params: {routeName, params}
}); });
} }
} }
@ -528,7 +529,7 @@ class App extends React.Component {
<Provider store={store}> <Provider store={store}>
<PersistGate persistor={persistor}> <PersistGate persistor={persistor}>
<ActionSheetProvider> <ActionSheetProvider>
<AppContainer ref="navigator" /> <AppContainer ref="navigator"/>
</ActionSheetProvider> </ActionSheetProvider>
</PersistGate> </PersistGate>
</Provider> </Provider>

File diff suppressed because one or more lines are too long

View File

@ -159,7 +159,9 @@
"DEPOSIT_TO_BANK": "Your Wallet to bank", "DEPOSIT_TO_BANK": "Your Wallet to bank",
"NANO_CREDIT": "Nano credit", "NANO_CREDIT": "Nano credit",
"NANO_CREDIT_LIST": "Nano credit list", "NANO_CREDIT_LIST": "Nano credit list",
"SAVINGS_LIST": "Savings list",
"NO_NANO_CREDIT": "No nano credit demand", "NO_NANO_CREDIT": "No nano credit demand",
"NO_SAVINGS": "No savings",
"NANO_CREDIT_DESCRIPTION": "Nano credit description", "NANO_CREDIT_DESCRIPTION": "Nano credit description",
"NANO_SANTE": "Nano health", "NANO_SANTE": "Nano health",
"NANO_SANTE_DESCRIPTION": "Nano health description", "NANO_SANTE_DESCRIPTION": "Nano health description",
@ -172,6 +174,8 @@
"CAUTION_CREDIT": "Caution credit demand", "CAUTION_CREDIT": "Caution credit demand",
"CAUTIONNEMENT_DONE": "Caution done", "CAUTIONNEMENT_DONE": "Caution done",
"ID_DEMAND": "Demand ID", "ID_DEMAND": "Demand ID",
"ID_SAVINGS": "Saving ID",
"NON_APPLICABLE": "Not applicable",
"DATE": "Date", "DATE": "Date",
"PAIEMENT_EAU_ELECTRICITY": "Water bill", "PAIEMENT_EAU_ELECTRICITY": "Water bill",
"PAIEMENT_ELECTRICITY": "Electricity bill", "PAIEMENT_ELECTRICITY": "Electricity bill",
@ -182,6 +186,7 @@
"DATE_REMBOURSEMENT_PREVU": "Expected refund date", "DATE_REMBOURSEMENT_PREVU": "Expected refund date",
"DATE_REMBOURSEMENT": "Refund date", "DATE_REMBOURSEMENT": "Refund date",
"AMOUNT_REFUND": "Amount reimbursed", "AMOUNT_REFUND": "Amount reimbursed",
"AMOUNT_WITHDRAWAL": "Amount withdrawal",
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded", "AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
"FINAL_DATE": "End date", "FINAL_DATE": "End date",
"CASSATION_DATE": "Cassation date", "CASSATION_DATE": "Cassation date",

View File

@ -166,7 +166,9 @@
"DEPOSIT_TO_BANK": "Votre Wallet vers banque", "DEPOSIT_TO_BANK": "Votre Wallet vers banque",
"NANO_CREDIT": "Nano crédit", "NANO_CREDIT": "Nano crédit",
"NANO_CREDIT_LIST": "Liste des nano crédit", "NANO_CREDIT_LIST": "Liste des nano crédit",
"SAVINGS_LIST": "Liste des épargnes",
"NO_NANO_CREDIT": "Aucune demande de nano crédit", "NO_NANO_CREDIT": "Aucune demande de nano crédit",
"NO_SAVINGS": "Aucune épargne",
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink", "NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
"NANO_SANTE": "Nano santé", "NANO_SANTE": "Nano santé",
"NANO_SANTE_DESCRIPTION": "Nano santé iLink", "NANO_SANTE_DESCRIPTION": "Nano santé iLink",
@ -179,16 +181,19 @@
"CAUTION_CREDIT": "Cautionner une demande de crédit", "CAUTION_CREDIT": "Cautionner une demande de crédit",
"CAUTIONNEMENT_DONE": "Cautionnement effectué", "CAUTIONNEMENT_DONE": "Cautionnement effectué",
"ID_DEMAND": "Identifiant de la demande", "ID_DEMAND": "Identifiant de la demande",
"ID_SAVINGS": "Identifiant de l'épargne",
"PAIEMENT_EAU": "Paiement eau", "PAIEMENT_EAU": "Paiement eau",
"PAIEMENT_ELECTRICITY": "Paiement électricité", "PAIEMENT_ELECTRICITY": "Paiement électricité",
"PAIEMENT_ECOLE": "Paiement école", "PAIEMENT_ECOLE": "Paiement école",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique", "PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV", "PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
"NON_APPLICABLE": "Non applicable",
"DATE": "Date", "DATE": "Date",
"DEMAND_DATE": "Date de la demande", "DEMAND_DATE": "Date de la demande",
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu", "DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
"DATE_REMBOURSEMENT": "Date de remboursement", "DATE_REMBOURSEMENT": "Date de remboursement",
"AMOUNT_REFUND": "Montant remboursé", "AMOUNT_REFUND": "Montant remboursé",
"AMOUNT_WITHDRAWAL": "Montant retiré",
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé", "AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
"FINAL_DATE": "Date de fin", "FINAL_DATE": "Date de fin",
"CASSATION_DATE": "Date de cassation", "CASSATION_DATE": "Date de cassation",
@ -216,8 +221,8 @@
"DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de", "DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de",
"NO_WALLET_HISTORY": "Aucune transaction à ce jour", "NO_WALLET_HISTORY": "Aucune transaction à ce jour",
"DEMAND_SEND": "Demande envoyé", "DEMAND_SEND": "Demande envoyé",
"EPARGNE_DEPOSE": "Epargne déposé", "EPARGNE_DEPOSE": "Epargne déposée",
"BREAK_EPARGNE_DONE": "Epargne cassé avec succès", "BREAK_EPARGNE_DONE": "Epargne cassée avec succès",
"BREAK_EPARGNE": "Casser mon épargne", "BREAK_EPARGNE": "Casser mon épargne",
"ID_EPARGNE": "Identifiant de l'épargne", "ID_EPARGNE": "Identifiant de l'épargne",
"NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe", "NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe",

View File

@ -1,31 +1,31 @@
import React, { Component } from 'react' import React from 'react'
import { StyleSheet, Text, View, Alert, Platform, StatusBar } from 'react-native' import {Platform, StatusBar, StyleSheet, Text, View} from 'react-native'
import BaseScreen from "../BaseScreen"; import BaseScreen from "../BaseScreen";
import { responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions' import {responsiveWidth} from 'react-native-responsive-dimensions'
import { Dropdown } from 'react-native-material-dropdown' import {Dropdown} from 'react-native-material-dropdown'
import { disconnect } from './../../webservice/AuthApi' import I18n from 'react-native-i18n'
import Configuration from "../../webservice/persistences/Configuration";
import {IlinkEmitter} from "./../../utils/events"
import Icon from 'react-native-vector-icons/MaterialIcons';
import {SafeAreaView} from 'react-navigation';
const theme = require('./../../utils/theme.json'); const theme = require('./../../utils/theme.json');
const route = require('./../../route.json') const route = require('./../../route.json')
import I18n, { getLanguages } from 'react-native-i18n'
import Configuration from "../../webservice/persistences/Configuration";
import Button from "apsl-react-native-button"
require("./../../utils/Translations") require("./../../utils/Translations")
import { IlinkEmitter } from "./../../utils/events"
import { Header } from "react-native-elements";
import Icon from 'react-native-vector-icons/MaterialIcons';
import { SafeAreaView } from 'react-navigation';
export default class Configurations extends BaseScreen { export default class Configurations extends BaseScreen {
static navigationOptions = { static navigationOptions = {
headerTitle: I18n.t('CONFIGURATIONS'), headerTitle: I18n.t('CONFIGURATIONS'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'settings'} name={'settings'}
size={24} size={24}
/> />
) )
}; };
constructor(props) { constructor(props) {
super(props, true) super(props, true)
this.state = this.initState() this.state = this.initState()
@ -37,14 +37,15 @@ export default class Configurations extends BaseScreen {
initState() { initState() {
let language = []; let language = [];
language.push({ name: I18n.t('langue.english'), value: 'en' }); language.push({name: I18n.t('langue.english'), value: 'en'});
language.push({ name: I18n.t('langue.french'), value: 'fr' }); language.push({name: I18n.t('langue.french'), value: 'fr'});
return { return {
languages: language languages: language
} }
} }
render() { render() {
console.log(this.state) console.log(this.state)
return (<View style={styles.container}> return (<View style={styles.container}>
@ -62,13 +63,13 @@ export default class Configurations extends BaseScreen {
> >
<Text style={{ fontSize: 17, }}>{I18n.t("CHOOSE_LANGUAGE")}</Text> <Text style={{fontSize: 17,}}>{I18n.t("CHOOSE_LANGUAGE")}</Text>
<Dropdown <Dropdown
label={I18n.t("CHANGE_LANG_LABEL")} label={I18n.t("CHANGE_LANG_LABEL")}
data={this.state.languages} data={this.state.languages}
onChangeText={(value, index, data) => { onChangeText={(value, index, data) => {
I18n.locale = value I18n.locale = value
this.setState({ language: value }) this.setState({language: value})
this.configuration.setCurrentLangue(data[index]) this.configuration.setCurrentLangue(data[index])
IlinkEmitter.emit('langueChange') IlinkEmitter.emit('langueChange')
}} }}

View File

@ -123,7 +123,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
} }
}) })
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)) IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
} }

View File

@ -4,20 +4,17 @@ import {responsiveFontSize, responsiveWidth} from 'react-native-responsive-dimen
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';
import 'moment/locale/en-au' import 'moment/locale/en-au';
import 'moment/locale/en-ca' import 'moment/locale/en-ca';
import 'moment/locale/en-ie' import 'moment/locale/en-ie';
import 'moment/locale/en-il' import 'moment/locale/en-il';
import 'moment/locale/en-nz' import 'moment/locale/en-nz';
import 'moment/locale/en-gb'
import DeviceInfo from 'react-native-device-info'
import {Color} from '../../config/Color'; import {Color} from '../../config/Color';
var moment = require('moment-timezone') let moment = require('moment-timezone');
const momentJS = require('moment') const momentJS = require('moment');
let route = require('./../../route.json'); let route = require('./../../route.json');
var theme = require('./../../utils/theme.json'); var theme = require('./../../utils/theme.json');
@ -26,6 +23,9 @@ export class HistoryItem extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
console.log("Current Locale item", this.currentLocale);
moment.locale(this.currentLocale);
this.state = this.initState(); this.state = this.initState();
} }
@ -75,8 +75,6 @@ export class HistoryItem extends React.Component {
var today = new Date(); var today = new Date();
var l = this.props.selfData.date_creation; var l = this.props.selfData.date_creation;
let t = this.props.selfData.status; let t = this.props.selfData.status;
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
var re = moment.tz(this.props.selfData.date_creation, moment.tz.guess()).format(); var re = moment.tz(this.props.selfData.date_creation, moment.tz.guess()).format();
re = moment(re) re = moment(re)
return { return {
@ -134,6 +132,8 @@ export class HistoryItemSectionned extends PureComponent {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = this.initState(); this.state = this.initState();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
moment.locale(this.currentLocale);
} }
render() { render() {
@ -246,6 +246,8 @@ export class HistoryListItem extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = this.initState(); this.state = this.initState();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
moment.locale(this.currentLocale);
} }
initState() { initState() {

View File

@ -6,7 +6,6 @@ import {responsiveWidth} from 'react-native-responsive-dimensions'
import Icons from 'react-native-vector-icons/Ionicons' import Icons from 'react-native-vector-icons/Ionicons'
import {readUser} from "../../webservice/AuthApi"; import {readUser} from "../../webservice/AuthApi";
import isNil from 'lodash/isNil'; import isNil from 'lodash/isNil';
import I18n from "react-native-i18n";
import {creditDemandResetReducer, treatCreditDemand} from '../../webservice/CreditTreatDemandApi'; import {creditDemandResetReducer, treatCreditDemand} from '../../webservice/CreditTreatDemandApi';
import {creditCancelResetReducer, treatCancelDemand} from '../../webservice/CreditCancelDemandeApi'; import {creditCancelResetReducer, treatCancelDemand} from '../../webservice/CreditCancelDemandeApi';
import {getAgentNetworksList} from "../../webservice/NetworkApi"; import {getAgentNetworksList} from "../../webservice/NetworkApi";
@ -16,11 +15,21 @@ import Toast from 'react-native-root-toast';
import {Color} from '../../config/Color' import {Color} from '../../config/Color'
import Dialog from "react-native-dialog"; import Dialog from "react-native-dialog";
import {FontWeight} from '../../config/typography' import {FontWeight} from '../../config/typography'
import DeviceInfo from 'react-native-device-info' import I18n from "react-native-i18n";
import 'moment/locale/fr';
import 'moment/locale/es-us';
import 'moment/locale/en-au';
import 'moment/locale/en-ca';
import 'moment/locale/en-ie';
import 'moment/locale/en-il';
import 'moment/locale/en-nz';
let moment = require('moment-timezone');
const momentJS = require('moment');
let typesta = 0; let typesta = 0;
let moment = require('moment-timezone')
var colorback = 'white' var colorback = 'white'
let theme = require('./../../utils/theme.json'); let theme = require('./../../utils/theme.json');
@ -52,7 +61,10 @@ class HistoryItemDetails extends Component {
} else { } else {
this.item = this.props.navigation.getParam("item", null).item; this.item = this.props.navigation.getParam("item", null).item;
} }
console.log('HISTORY ITEM PROPS', this.props);
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
moment.locale(this.currentLocale);
let sta = '' let sta = ''
if (this.item.status === '1') { if (this.item.status === '1') {
typesta = 1 typesta = 1
@ -87,9 +99,6 @@ class HistoryItemDetails extends Component {
this.setState({user: user, networks: networks.networks}) this.setState({user: user, networks: networks.networks})
}); });
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
} }
isNormalInteger = (str) => { isNormalInteger = (str) => {

View File

@ -1,52 +1,39 @@
import React from 'react';
import React, { Component } from 'react'; import {Animated, AppState, ProgressBarAndroid, StatusBar, StyleSheet, Text, View} from 'react-native';
import {
Platform,
StyleSheet,
AppState,
FlatList,
ProgressBarAndroid,
TouchableOpacity,
Text,
View,
Animated,
StatusBar
} from 'react-native';
import ActionButton from 'react-native-action-button'; import ActionButton from 'react-native-action-button';
import Icon from 'react-native-vector-icons/MaterialIcons'; import Icon from 'react-native-vector-icons/MaterialIcons';
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions'; import {responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import { HistoryListItem, HistoryItemSectionned } from './HistoryItem'; import {HistoryItemSectionned, HistoryListItem} from './HistoryItem';
import { credrequester } from './../../route.json'; import {loadDemandeCredit, loadMyDemandeCredit} from './../../webservice/HistoryRequestApi';
import { loadDemandeCredit, loadMyDemandeCredit } from './../../webservice/HistoryRequestApi';
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
import BaseScreen from './../../screens/BaseScreen'
import Button from 'apsl-react-native-button' import Button from 'apsl-react-native-button'
import { readUser } from "../../webservice/AuthApi"; import {readUser} from "../../webservice/AuthApi";
import Calendar from 'react-native-calendario'; import Calendar from 'react-native-calendario';
let route = require('./../../route.json') import I18n from "react-native-i18n";
import 'moment';
import 'moment/locale/fr' import 'moment/locale/fr';
import 'moment/locale/es-us' import 'moment/locale/es-us';
import 'moment/locale/en-au' import 'moment/locale/en-au';
import 'moment/locale/en-ca' import 'moment/locale/en-ca';
import 'moment/locale/en-ie' import 'moment/locale/en-ie';
import 'moment/locale/en-il' import 'moment/locale/en-il';
import 'moment/locale/en-nz' import 'moment/locale/en-nz';
import 'moment/locale/en-gb' import {accent, primary, primaryDark, purpleLight} from './../../utils/theme.json';
import moment from 'moment-timezone'; import {PagerTabIndicator} from 'react-native-best-viewpager'
let theme = require('./../../utils/theme.json') import IconWithBadge from "../IconWithBadge";
import { primary, primaryDark, accent, purpleLight, primaryLight } from './../../utils/theme.json'; import {Appbar, Divider, Menu, Provider} from 'react-native-paper';
import { PagerTabIndicator, PagerTitleIndicator, PagerDotIndicator } from 'react-native-best-viewpager' import DeviceInfo from 'react-native-device-info';
var moment = require('moment-timezone');
const momentJS = require('moment');
let route = require('./../../route.json');
let theme = require('./../../utils/theme.json');
var sortIcons; var sortIcons;
var sectionIcons; var sectionIcons;
import I18n from 'react-native-i18n'
require('./../../utils/Translations') require('./../../utils/Translations')
import { SinglePickerMaterialDialog } from 'react-native-material-dialog';
import { Header } from "react-native-elements";
import { withNavigationFocus } from "react-navigation";
import IconWithBadge from "../IconWithBadge";
import { Appbar, Paragraph, Menu, Divider, Provider } from 'react-native-paper';
import DeviceInfo from 'react-native-device-info'
class MyHistory extends React.Component { class MyHistory extends React.Component {
static navigatorStyle = { static navigatorStyle = {
@ -59,12 +46,12 @@ class MyHistory extends React.Component {
contextualMenuButtonsColor: '#ffffff' contextualMenuButtonsColor: '#ffffff'
}; };
static navigationOptions = ({ navigation }) => { static navigationOptions = ({navigation}) => {
const { routeName } = navigation.state const {routeName} = navigation.state
return { return {
tabBarLabel: routeName === "myDemand" ? I18n.t('MY_DEMAND') : I18n.t('DEMAND_RECEIVE'), tabBarLabel: routeName === "myDemand" ? I18n.t('MY_DEMAND') : I18n.t('DEMAND_RECEIVE'),
tabBarIcon: ({ focused, horizontal, tintColor }) => { tabBarIcon: ({focused, horizontal, tintColor}) => {
return (<IconWithBadge return (<IconWithBadge
badgeCount={navigation.getParam("count", 0)} badgeCount={navigation.getParam("count", 0)}
size={20} size={20}
@ -74,7 +61,7 @@ class MyHistory extends React.Component {
}, },
drawerLabel: I18n.t('CREDIT_MANAGE'), drawerLabel: I18n.t('CREDIT_MANAGE'),
drawerIcon: ({ tintColor }) => ( drawerIcon: ({tintColor}) => (
<Icon <Icon
name={'credit-card'} name={'credit-card'}
size={24} size={24}
@ -85,22 +72,24 @@ class MyHistory extends React.Component {
constructor(props) { constructor(props) {
super(props, true); super(props, true);
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
moment.locale(this.currentLocale);
this.state = this.initState(); this.state = this.initState();
readUser().then((user) => { this.setState({ user: user }) }) readUser().then((user) => {
this.setState({user: user})
})
this._populateIcons().then(() => { this._populateIcons().then(() => {
}); });
this.navigation = this.props.navigation this.navigation = this.props.navigation
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
//moment.locale(this.currentLocale);
}; };
navigationButtonPressed({ buttonId }) { navigationButtonPressed({buttonId}) {
if (buttonId === 'id') { if (buttonId === 'id') {
this.showFilter(); this.showFilter();
} else if (buttonId === 'sectionned') { } else if (buttonId === 'sectionned') {
this.setState({ isSectionned: !this.state.isSectionned }) this.setState({isSectionned: !this.state.isSectionned})
} }
} }
@ -282,20 +271,21 @@ class MyHistory extends React.Component {
updateList(data) { updateList(data) {
if (!this.state.filter) { if (!this.state.filter) {
let rev = data.reverse() let rev = data.reverse()
this.setState({ listdata: rev, conserve: rev, isLoaded: true }); this.setState({listdata: rev, conserve: rev, isLoaded: true});
} }
} }
updateMyList(data) { updateMyList(data) {
if (!this.state.filter) { if (!this.state.filter) {
let rev = data.reverse() let rev = data.reverse()
this.setState({ listdataSend: rev, conserve: rev, isLoaded: true }); this.setState({listdataSend: rev, conserve: rev, isLoaded: true});
} }
} }
componentDidMount() { componentDidMount() {
const { routeName } = this.navigation.state const {routeName} = this.navigation.state
this.setState({ position: routeName === "myDemand" ? 0 : 1 }) this.setState({position: routeName === "myDemand" ? 0 : 1})
this.refreshData() this.refreshData()
/* this.intervaller = setInterval(() => { /* this.intervaller = setInterval(() => {
this.refreshData(false) this.refreshData(false)
@ -333,26 +323,27 @@ class MyHistory extends React.Component {
} }
> >
<Menu.Item onPress={() => { <Menu.Item onPress={() => {
this.setState({ isSectionned: !this.state.isSectionned }) this.setState({isSectionned: !this.state.isSectionned})
this._closeMenu() this._closeMenu()
}} }}
title="Section" /> title="Section"/>
<Divider /> <Divider/>
<Menu.Item onPress={() => { <Menu.Item onPress={() => {
this.animateSlidingUp(!this.state.isSliding) this.animateSlidingUp(!this.state.isSliding)
this._closeMenu() this._closeMenu()
}} title={I18n.t("FILTER_DATE")} /> }} title={I18n.t("FILTER_DATE")}/>
</Menu> </Menu>
</View> </View>
) )
} }
animateSlidingUp(state = false) { animateSlidingUp(state = false) {
const height = responsiveHeight(100) const height = responsiveHeight(100)
let initialValue = !state ? 0 : height, let initialValue = !state ? 0 : height,
finalValue = !state ? height : 0; finalValue = !state ? height : 0;
this.setState({ isSliding: state }) this.setState({isSliding: state})
this.state.translateAnim.setValue(initialValue); //Step 3 this.state.translateAnim.setValue(initialValue); //Step 3
@ -365,14 +356,15 @@ class MyHistory extends React.Component {
} }
).start() ).start()
} }
_openMenu = () => this.setState({ visibleMenu: true });
_closeMenu = () => this.setState({ visibleMenu: false }); _openMenu = () => this.setState({visibleMenu: true});
_closeMenu = () => this.setState({visibleMenu: false});
render() { render() {
return ( return (
<Provider> <Provider>
<View style={{ flex: 1 }} <View style={{flex: 1}}
> >
<StatusBar <StatusBar
backgroundColor={theme.primaryDark} backgroundColor={theme.primaryDark}
@ -382,16 +374,23 @@ class MyHistory extends React.Component {
{this.renderSliding()} {this.renderSliding()}
<Appbar.Header dark={true} style={{ backgroundColor: theme.primary }}> <Appbar.Header dark={true} style={{backgroundColor: theme.primary}}>
<Appbar.BackAction <Appbar.BackAction
onPress={() => { this.props.navigation.pop() }} onPress={() => {
this.props.navigation.pop()
}}
/> />
<Appbar.Content <Appbar.Content
title={I18n.t('CREDIT_MANAGE')} title={I18n.t('CREDIT_MANAGE')}
subtitle={this.state.position === 0 ? I18n.t('MY_DEMAND') : I18n.t('DEMAND_RECEIVE')} subtitle={this.state.position === 0 ? I18n.t('MY_DEMAND') : I18n.t('DEMAND_RECEIVE')}
/> />
<Appbar.Action icon="refresh" onPress={() => { this.refreshData() }} /> <Appbar.Action icon="refresh" onPress={() => {
<Appbar.Action icon="more-vert" onPress={() => { this._openMenu(); this.renderSliding(); }} /> this.refreshData()
}}/>
<Appbar.Action icon="more-vert" onPress={() => {
this._openMenu();
this.renderSliding();
}}/>
</Appbar.Header> </Appbar.Header>
{this.renderOptionsMenu()} {this.renderOptionsMenu()}
@ -401,9 +400,10 @@ class MyHistory extends React.Component {
); );
} }
renderSliding() { renderSliding() {
return ( return (
<Animated.View style={[styles.slidingup, { translateY: this.state.translateAnim }]}> <Animated.View style={[styles.slidingup, {translateY: this.state.translateAnim}]}>
<Calendar <Calendar
onChange={(range) => console.log(range)} onChange={(range) => console.log(range)}
minDate="2018-04-20" minDate="2018-04-20"
@ -452,14 +452,15 @@ class MyHistory extends React.Component {
}, },
nonTouchableLastMonthDayTextStyle: {} nonTouchableLastMonthDayTextStyle: {}
}} }}
style={{ height: responsiveHeight(60) }} style={{height: responsiveHeight(60)}}
/> />
<View style={{ flexDirection: 'row' }}> <View style={{flexDirection: 'row'}}>
<Button>{I18n.t('QUIT')}</Button> <Button>{I18n.t('QUIT')}</Button>
<Button>{I18n.t('FILTER')}</Button> <Button>{I18n.t('FILTER')}</Button>
</View> </View>
</Animated.View>) </Animated.View>)
} }
renderSectionnedList(list) { renderSectionnedList(list) {
if (this.state.isLoaded) { if (this.state.isLoaded) {
@ -470,7 +471,7 @@ class MyHistory extends React.Component {
user={this.state.user} user={this.state.user}
list={list} list={list}
refresh={() => this.refreshData()} refresh={() => this.refreshData()}
style={styles.listbackground} />) style={styles.listbackground}/>)
} else if (this.state.filter) { } else if (this.state.filter) {
return ( return (
@ -481,7 +482,7 @@ class MyHistory extends React.Component {
} else { } else {
return ( return (
<View style={styles.emptyListe}> <View style={styles.emptyListe}>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</View> </View>
) )
@ -505,12 +506,14 @@ class MyHistory extends React.Component {
return (<HistoryListItem return (<HistoryListItem
user={this.state.user} user={this.state.user}
list={list} list={list}
refreshing={() => { this.refreshData() }} refreshing={() => {
this.refreshData()
}}
refresh={() => this.refreshData()} refresh={() => this.refreshData()}
isRefreshing={this.state.isRefreshing} isRefreshing={this.state.isRefreshing}
navigator={this.props.navigation} navigator={this.props.navigation}
style={styles.listbackground} style={styles.listbackground}
isDemandSend={this.state.position === 0} />) isDemandSend={this.state.position === 0}/>)
} else if (this.state.filter) { } else if (this.state.filter) {
return ( return (
@ -527,7 +530,7 @@ class MyHistory extends React.Component {
} else { } else {
return ( return (
<View style={styles.emptyListe}> <View style={styles.emptyListe}>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</View> </View>
@ -555,8 +558,9 @@ class MyHistory extends React.Component {
} }
renderLoading() { renderLoading() {
return (<View><ProgressBarAndroid /><Text>{I18n.t('LOADING_DOTS')}</Text></View>) return (<View><ProgressBarAndroid/><Text>{I18n.t('LOADING_DOTS')}</Text></View>)
} }
showSlidingUpPanel() { showSlidingUpPanel() {
/* return (<SlidingUpPanel /* return (<SlidingUpPanel
style={styles.slidingup} style={styles.slidingup}
@ -630,9 +634,10 @@ class MyHistory extends React.Component {
isDateEndTimePickerVisible: true isDateEndTimePickerVisible: true
}); });
} }
_showDateEndPicker = () => this.setState({ isDateEndTimePickerVisible: true }); _showDateEndPicker = () => this.setState({isDateEndTimePickerVisible: true});
_hideDateTimePicker = () => this.setState({isDateTimePickerVisible: false, isDateEndTimePickerVisible: false});
_hideDateTimePicker = () => this.setState({ isDateTimePickerVisible: false, isDateEndTimePickerVisible: false });
/* /*
_handleDatePicked = (fromdate, enddate) => { _handleDatePicked = (fromdate, enddate) => {
console.log([fromdate, enddate]); console.log([fromdate, enddate]);
@ -668,7 +673,7 @@ class MyHistory extends React.Component {
<ActionButton.Item buttonColor={purpleLight} title={I18n.t('SAVE_HISTORY')} onPress={() => { <ActionButton.Item buttonColor={purpleLight} title={I18n.t('SAVE_HISTORY')} onPress={() => {
}}> }}>
<Icon name="save" style={styles.actionButtonIcon} /> <Icon name="save" style={styles.actionButtonIcon}/>
</ActionButton.Item> </ActionButton.Item>
</ActionButton>); </ActionButton>);
} else { } else {
@ -680,12 +685,12 @@ class MyHistory extends React.Component {
}) })
}} }}
> >
<Icon name="edit" style={styles.actionButtonIcon} /> <Icon name="edit" style={styles.actionButtonIcon}/>
</ActionButton.Item> </ActionButton.Item>
<ActionButton.Item buttonColor={purpleLight} title={I18n.t('SAVE_HISTORY')} onPress={() => { <ActionButton.Item buttonColor={purpleLight} title={I18n.t('SAVE_HISTORY')} onPress={() => {
}}> }}>
<Icon name="save" style={styles.actionButtonIcon} /> <Icon name="save" style={styles.actionButtonIcon}/>
</ActionButton.Item> </ActionButton.Item>
</ActionButton>) </ActionButton>)
} }
@ -729,7 +734,7 @@ class MyHistory extends React.Component {
style={{ style={{
height: responsiveHeight(8) height: responsiveHeight(8)
}} }}
tabs={tabs} />; tabs={tabs}/>;
} }
_renderTabHyper() { _renderTabHyper() {
@ -740,7 +745,7 @@ class MyHistory extends React.Component {
style={{ style={{
height: responsiveHeight(8) height: responsiveHeight(8)
}} }}
tabs={tabs} />; tabs={tabs}/>;
} }
_renderTabs() { _renderTabs() {
@ -755,19 +760,19 @@ class MyHistory extends React.Component {
style={{ style={{
height: responsiveHeight(8) height: responsiveHeight(8)
}} }}
tabs={tabs} />; tabs={tabs}/>;
} }
refreshData(autoref = true) { refreshData(autoref = true) {
if (autoref) if (autoref)
this.setState({ isRefreshing: true }) this.setState({isRefreshing: true})
loadDemandeCredit().then((data) => { loadDemandeCredit().then((data) => {
if (data.success !== undefined) { if (data.success !== undefined) {
this.setState({ listdata: [] }) this.setState({listdata: []})
this.updateList(data.demands); this.updateList(data.demands);
if (this.state.position !== 0) this.props.navigation.setParams({ count: data.demands.length }) if (this.state.position !== 0) this.props.navigation.setParams({count: data.demands.length})
this.setState({ isRefreshing: false }) this.setState({isRefreshing: false})
} }
}).catch((e) => { }).catch((e) => {
console.warn(e) console.warn(e)
@ -775,9 +780,9 @@ class MyHistory extends React.Component {
loadMyDemandeCredit().then((data) => { loadMyDemandeCredit().then((data) => {
if (data.success !== undefined) { if (data.success !== undefined) {
this.setState({ listdataSend: [] }) this.setState({listdataSend: []})
this.setState({ isRefreshing: false }) this.setState({isRefreshing: false})
if (this.state.position === 0) this.props.navigation.setParams({ count: data.demands.length }) if (this.state.position === 0) this.props.navigation.setParams({count: data.demands.length})
this.updateMyList(data.demands) this.updateMyList(data.demands)
} }
@ -786,6 +791,7 @@ class MyHistory extends React.Component {
}); });
} }
} }
export default MyHistory; export default MyHistory;
const datefilter = StyleSheet.create({ const datefilter = StyleSheet.create({
titleHeader: { titleHeader: {
@ -853,8 +859,7 @@ const styles = StyleSheet.create({
backgroundd_drawer: { backgroundd_drawer: {
backgroundColor: '#000', backgroundColor: '#000',
}, },
listbackground: { listbackground: {},
},
actionButtonIcon: { actionButtonIcon: {
fontSize: 20, fontSize: 20,
height: 22, height: 22,

View File

@ -23,7 +23,7 @@ import {IlinkEmitter} from '../../utils/events';
import {readUser} from '../../webservice/AuthApi'; import {readUser} from '../../webservice/AuthApi';
import {getEpargneInProgressAction, getEpargneInProgressReset} from '../../webservice/NanoCreditApi'; import {getEpargneInProgressAction, getEpargneInProgressReset} from '../../webservice/NanoCreditApi';
import {casserEpargneUserAction, casserEpargneUserReset} from '../../webservice/user/NanoCreditApi'; import {casserEpargneUserAction, casserEpargneUserReset} from '../../webservice/user/NanoCreditApi';
import {cutStringWithoutDot, displayTransactionType, nanoCreditHistoryLabel} from "../../utils/UtilsFunction"; import {cutStringWithoutDot, nanoCreditHistoryLabel} from "../../utils/UtilsFunction";
import * as Utils from "../../utils/DeviceUtils"; import * as Utils from "../../utils/DeviceUtils";
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import thousands from "thousands"; import thousands from "thousands";
@ -195,16 +195,7 @@ class CasserEpargneUser extends Component {
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}> <View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text style={[styles.body2]}>Type</Text> <Text style={[styles.body2]}>{I18n.t('ID_SAVINGS')}</Text>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<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>
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text <Text
@ -289,7 +280,7 @@ class CasserEpargneUser extends Component {
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text <Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_fin}</Text> style={[Typography.caption1, Color.grayColor]}>{ isEqual(this.state.historyItemDetail.type, 'SIMPLE') ? I18n.t('NON_APPLICABLE') : this.state.historyItemDetail.date_fin}</Text>
</View> </View>
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
@ -378,7 +369,7 @@ class CasserEpargneUser extends Component {
this.setState({displayModalHistory: true, historyItemDetail: item}) this.setState({displayModalHistory: true, historyItemDetail: item})
}} style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}> }} style={[styles.contentService, {borderBottomColor: Color.primaryColor}]}>
{ {
Object.keys(omit(item, ['id', 'id_epargne', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).map((element, i) => ( Object.keys(omit(item, ['id', 'id_epargne', 'montant_retire', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).map((element, i) => (
<View style={{alignItems: 'center'}} key={i}> <View style={{alignItems: 'center'}} key={i}>
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}> <Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
@ -443,7 +434,7 @@ class CasserEpargneUser extends Component {
) : ) :
( (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'flex-start'}}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'flex-start'}}>
<Text style={Typography.body1}>{I18n.t('NO_NANO_CREDIT')}</Text> <Text style={Typography.body1}>{I18n.t('NO_SAVINGS')}</Text>
</View> </View>
) )
) )

View File

@ -1,30 +1,19 @@
import React from 'react';
import React, { Component } from 'react';
import { import {
Alert,
Platform,
StyleSheet,
AppState,
FlatList,
ProgressBarAndroid,
TouchableOpacity,
Text,
View,
Animated, Animated,
StatusBar AppState,
Platform,
ProgressBarAndroid,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native'; } from 'react-native';
import ActionButton from 'react-native-action-button'; import ActionButton from 'react-native-action-button';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions'; import {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
import { HistoryListItem, HistoryItemSectionned } from '../history-request/HistoryItem'; import {readUser} from "../../webservice/AuthApi";
import { credrequester } from './../../route.json';
import { loadDemandeCredit, loadMyDemandeCredit } from './../../webservice/HistoryRequestApi';
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
import BaseScreen from './../../screens/BaseScreen'
import Button from 'apsl-react-native-button'
import { readUser } from "../../webservice/AuthApi";
import Calendar from 'react-native-calendario';
let route = require('./../../route.json')
import 'moment'; import 'moment';
import 'moment/locale/fr' import 'moment/locale/fr'
import 'moment/locale/es-us' import 'moment/locale/es-us'
@ -35,27 +24,25 @@ import 'moment/locale/en-il'
import 'moment/locale/en-nz' import 'moment/locale/en-nz'
import 'moment/locale/en-gb' import 'moment/locale/en-gb'
import moment from 'moment-timezone'; import moment from 'moment-timezone';
import {accent, primary, primaryDark, purpleLight} from './../../utils/theme.json';
import I18n from 'react-native-i18n'
import {Appbar, Provider} from 'react-native-paper';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {getNanoCreditDemandsAction, getNanoCreditDemandsReset} from '../../webservice/user/NanoCreditApi';
import {IlinkEmitter} from '../../utils/events';
import {Typography} from '../../config/typography';
import {ScrollView} from 'react-native-gesture-handler';
import {Color} from '../../config/Color';
let route = require('./../../route.json')
let theme = require('./../../utils/theme.json') let theme = require('./../../utils/theme.json')
import { primary, primaryDark, accent, purpleLight, primaryLight } from './../../utils/theme.json';
import { PagerTabIndicator, PagerTitleIndicator, PagerDotIndicator } from 'react-native-best-viewpager'
var sortIcons; var sortIcons;
var sectionIcons; var sectionIcons;
import I18n from 'react-native-i18n'
require('./../../utils/Translations') require('./../../utils/Translations')
import { SinglePickerMaterialDialog } from 'react-native-material-dialog';
import { Header } from "react-native-elements";
import { withNavigationFocus } from "react-navigation";
import IconWithBadge from "../IconWithBadge";
import { Appbar, Paragraph, Menu, Divider, Provider } from 'react-native-paper';
import DeviceInfo from 'react-native-device-info'
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { getNanoCreditDemandsAction, getNanoCreditDemandsReset } from '../../webservice/user/NanoCreditApi';
import { IlinkEmitter } from '../../utils/events';
import { Typography } from '../../config/typography';
import { ScrollView } from 'react-native-gesture-handler';
import { Color } from '../../config/Color';
import { color } from 'react-native-reanimated';
class DemandValidationGroup extends React.Component { class DemandValidationGroup extends React.Component {
@ -85,7 +72,7 @@ class DemandValidationGroup extends React.Component {
position: 0 position: 0
}; };
readUser().then((user) => { readUser().then((user) => {
this.setState({ user: user }); this.setState({user: user});
this.props.getNanoCreditDemandsAction(user.id); this.props.getNanoCreditDemandsAction(user.id);
}); });
@ -93,8 +80,8 @@ class DemandValidationGroup extends React.Component {
this.props.getNanoCreditDemandsReset(); this.props.getNanoCreditDemandsReset();
this.navigation = this.props.navigation this.navigation = this.props.navigation
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
//moment.locale(this.currentLocale); moment.locale(this.currentLocale);
//IlinkEmitter.on('treatNanoGroupDemand', this.refreshData); //IlinkEmitter.on('treatNanoGroupDemand', this.refreshData);
}; };
@ -110,12 +97,12 @@ class DemandValidationGroup extends React.Component {
}; };
updateLangue() { updateLangue() {
this.props.navigation.setParams({ name: I18n.t('WALLET') }) this.props.navigation.setParams({name: I18n.t('WALLET')})
this.forceUpdate() this.forceUpdate()
} }
componentDidMount() { componentDidMount() {
const { routeName } = this.navigation.state const {routeName} = this.navigation.state
this.setState({ this.setState({
position: routeName === "demandeValidationGroupe" ? 0 position: routeName === "demandeValidationGroupe" ? 0
: routeName === "myNanoCreditGroup" ? 1 : routeName === "myNanoCreditGroup" ? 1
@ -135,7 +122,7 @@ class DemandValidationGroup extends React.Component {
let initialValue = !state ? 0 : height, let initialValue = !state ? 0 : height,
finalValue = !state ? height : 0; finalValue = !state ? height : 0;
this.setState({ isSliding: state }) this.setState({isSliding: state})
this.state.translateAnim.setValue(initialValue); //Step 3 this.state.translateAnim.setValue(initialValue); //Step 3
Animated.timing( //Step 4 Animated.timing( //Step 4
@ -148,26 +135,35 @@ class DemandValidationGroup extends React.Component {
).start() ).start()
} }
_openMenu = () => this.setState({ visibleMenu: true }); _openMenu = () => this.setState({visibleMenu: true});
_closeMenu = () => this.setState({ visibleMenu: false }); _closeMenu = () => this.setState({visibleMenu: false});
getDemandTypeIcon = (type) => { getDemandTypeIcon = (type) => {
switch (type) { switch (type) {
case 'creation': return 'account-multiple-plus'; case 'creation':
case 'suppression': return 'account-multiple-minus'; return 'account-multiple-plus';
case 'adhesion': return 'account-multiple-check' case 'suppression':
case 'nano_credit': return 'cash' return 'account-multiple-minus';
default: return 'account-multiple' case 'adhesion':
return 'account-multiple-check'
case 'nano_credit':
return 'cash'
default:
return 'account-multiple'
} }
} }
getDemandTypeColor = (type) => { getDemandTypeColor = (type) => {
switch (type) { switch (type) {
case 'creation': return 'green'; case 'creation':
case 'suppression': return 'red'; return 'green';
case 'adhesion': return Color.primaryColor case 'suppression':
case 'nano_credit': return Color.primaryColor return 'red';
case 'adhesion':
return Color.primaryColor
case 'nano_credit':
return Color.primaryColor
default: default:
return Color.primaryColor return Color.primaryColor
} }
@ -185,10 +181,11 @@ class DemandValidationGroup extends React.Component {
}} }}
style={[styles.paymentItem]}> style={[styles.paymentItem]}>
<View style={{ flexDirection: 'row', alignItems: 'center', }}> <View style={{flexDirection: 'row', alignItems: 'center',}}>
<View style={styles.iconContent}> <View style={styles.iconContent}>
<Icon name={this.getDemandTypeIcon(item.type)} color={this.getDemandTypeColor(item.type)} size={35} /> <Icon name={this.getDemandTypeIcon(item.type)} color={this.getDemandTypeColor(item.type)}
size={35}/>
</View> </View>
</View> </View>
<View style={styles.content}> <View style={styles.content}>
@ -204,7 +201,7 @@ class DemandValidationGroup extends React.Component {
<Text style={styles.description}>{`Sponsor 3: ${item.sponsor3}`}</Text> */} <Text style={styles.description}>{`Sponsor 3: ${item.sponsor3}`}</Text> */}
<View style={styles.timeContent}> <View style={styles.timeContent}>
<View style={{ alignContent: 'flex-start', flex: 1, flexDirection: 'row' }}> <View style={{alignContent: 'flex-start', flex: 1, flexDirection: 'row'}}>
<Text style={{ <Text style={{
fontWeight: 'bold', fontWeight: 'bold',
marginLeft: 20, marginLeft: 20,
@ -216,11 +213,13 @@ class DemandValidationGroup extends React.Component {
</Text> </Text>
</View> </View>
<View style={{ alignContent: 'flex-end', flex: 1, flexDirection: 'row' }}> <View style={{alignContent: 'flex-end', flex: 1, flexDirection: 'row'}}>
<Icon name="map-marker" style={[styles.descriptionIcon], { color: Color.accentColor, marginTop: 5 }} /> <Icon name="map-marker"
style={[styles.descriptionIcon], {color: Color.accentColor, marginTop: 5}}/>
<Text style={styles.time}>{item.country}</Text> <Text style={styles.time}>{item.country}</Text>
<Icon name="clock" style={[styles.descriptionIcon], { color: Color.accentColor, marginTop: 5 }} /> <Icon name="clock"
style={[styles.descriptionIcon], {color: Color.accentColor, marginTop: 5}}/>
<Text style={styles.time}> {dateFormat}</Text> <Text style={styles.time}> {dateFormat}</Text>
</View> </View>
@ -233,19 +232,18 @@ class DemandValidationGroup extends React.Component {
rendeGetDemandsGroupResponse = () => { rendeGetDemandsGroupResponse = () => {
const { resultGetDemandsGroup, errorGetDemandsGroup } = this.props; const {resultGetDemandsGroup, errorGetDemandsGroup} = this.props;
if (errorGetDemandsGroup !== null) { if (errorGetDemandsGroup !== null) {
if (typeof errorGetDemandsGroup.data !== 'undefined') { if (typeof errorGetDemandsGroup.data !== 'undefined') {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{errorGetDemandsGroup.data.error}</Text> <Text style={Typography.body1}>{errorGetDemandsGroup.data.error}</Text>
</View> </View>
) )
} } else {
else {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{errorGetDemandsGroup}</Text> <Text style={Typography.body1}>{errorGetDemandsGroup}</Text>
</View> </View>
) )
@ -256,7 +254,7 @@ class DemandValidationGroup extends React.Component {
if (resultGetDemandsGroup.response !== null) { if (resultGetDemandsGroup.response !== null) {
return ( return (
Array.isArray(resultGetDemandsGroup.response) && (resultGetDemandsGroup.response.length) > 0 ? Array.isArray(resultGetDemandsGroup.response) && (resultGetDemandsGroup.response.length) > 0 ?
(<ScrollView style={{ flex: 1 }}> (<ScrollView style={{flex: 1}}>
{ {
resultGetDemandsGroup.response.map((item) => ( resultGetDemandsGroup.response.map((item) => (
this.renderDemandItem(item) this.renderDemandItem(item)
@ -264,7 +262,7 @@ class DemandValidationGroup extends React.Component {
} }
</ScrollView>) : </ScrollView>) :
( (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={Typography.body1}>{I18n.t('NO_DEMAND_CREATION_GROUP')}</Text> <Text style={Typography.body1}>{I18n.t('NO_DEMAND_CREATION_GROUP')}</Text>
</View> </View>
) )
@ -276,18 +274,18 @@ class DemandValidationGroup extends React.Component {
renderLoader = () => { renderLoader = () => {
return ( return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}> <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{Platform.OS === 'android' {Platform.OS === 'android'
? ?
( (
<> <>
<ProgressBarAndroid /> <ProgressBarAndroid/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
) : ) :
<> <>
<ActivityIndicator size="large" color={'#ccc'} /> <ActivityIndicator size="large" color={'#ccc'}/>
<Text>{I18n.t('LOADING_DOTS')}</Text> <Text>{I18n.t('LOADING_DOTS')}</Text>
</> </>
} }
@ -302,14 +300,14 @@ class DemandValidationGroup extends React.Component {
this.props.navigation.push(route.createGroupNanoCredit); this.props.navigation.push(route.createGroupNanoCredit);
}} }}
> >
<Icon name="account-multiple-plus" style={styles.actionButtonIcon} /> <Icon name="account-multiple-plus" style={styles.actionButtonIcon}/>
</ActionButton.Item> </ActionButton.Item>
<ActionButton.Item buttonColor={purpleLight} title={I18n.t('JOIN_GROUP')} <ActionButton.Item buttonColor={purpleLight} title={I18n.t('JOIN_GROUP')}
onPress={() => { onPress={() => {
this.props.navigation.push(route.adhererGroupNanoCredit); this.props.navigation.push(route.adhererGroupNanoCredit);
}} }}
> >
<Icon name="account-multiple" style={styles.actionButtonIcon} /> <Icon name="account-multiple" style={styles.actionButtonIcon}/>
</ActionButton.Item> </ActionButton.Item>
</ActionButton>) </ActionButton>)
} }
@ -322,7 +320,7 @@ class DemandValidationGroup extends React.Component {
console.warn("POSITION", this.state.position); console.warn("POSITION", this.state.position);
return ( return (
<Provider> <Provider>
<View style={{ flex: 1 }} <View style={{flex: 1}}
> >
<StatusBar <StatusBar
backgroundColor={theme.primaryDark} backgroundColor={theme.primaryDark}
@ -330,15 +328,19 @@ class DemandValidationGroup extends React.Component {
translucent={false} translucent={false}
/> />
<Appbar.Header dark={true} style={{ backgroundColor: theme.primary }}> <Appbar.Header dark={true} style={{backgroundColor: theme.primary}}>
<Appbar.BackAction <Appbar.BackAction
onPress={() => { this.props.navigation.pop() }} onPress={() => {
this.props.navigation.pop()
}}
/> />
<Appbar.Content <Appbar.Content
title={I18n.t('MANAGE_GROUP')} title={I18n.t('MANAGE_GROUP')}
subtitle={this.state.position === 0 ? I18n.t('VALIDATION_DEMAND') : I18n.t('DELETE_DEMAND')} subtitle={this.state.position === 0 ? I18n.t('VALIDATION_DEMAND') : I18n.t('DELETE_DEMAND')}
/> />
<Appbar.Action icon="refresh" onPress={() => { this.refreshData() }} /> <Appbar.Action icon="refresh" onPress={() => {
this.refreshData()
}}/>
{/* <Appbar.Action icon="more-vert" onPress={() => { this._openMenu(); this.renderSliding(); }} /> */} {/* <Appbar.Action icon="more-vert" onPress={() => { this._openMenu(); this.renderSliding(); }} /> */}
</Appbar.Header> </Appbar.Header>
@ -394,8 +396,7 @@ const styles = StyleSheet.create({
backgroundd_drawer: { backgroundd_drawer: {
backgroundColor: '#000', backgroundColor: '#000',
}, },
listbackground: { listbackground: {},
},
actionButtonIcon: { actionButtonIcon: {
fontSize: 20, fontSize: 20,
height: 22, height: 22,

View File

@ -75,7 +75,7 @@ class DemandGroupNanoCreditDetail extends Component {
isBtnModifyAmountEnabled: false, isBtnModifyAmountEnabled: false,
id: this.props.navigation.getParam("id", null) id: this.props.navigation.getParam("id", null)
} }
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
this.props.getNanoCreditUniqueDemandsReset(); this.props.getNanoCreditUniqueDemandsReset();

View File

@ -82,7 +82,7 @@ class MyNanoCreditGroup extends Component {
isBtnModifyAmountEnabled: false, isBtnModifyAmountEnabled: false,
id: this.props.navigation.getParam("id", null) id: this.props.navigation.getParam("id", null)
} }
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
this.props.createGroupReset(); this.props.createGroupReset();

View File

@ -52,7 +52,7 @@ class Notifications extends BaseScreen {
constructor(props) { constructor(props) {
super(props); super(props);
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
} }

View File

@ -93,11 +93,11 @@ class OperateurOptionSelect extends Component {
redirectToRoute = (item) => { redirectToRoute = (item) => {
console.log("Redirection"); console.log("Item selected", item);
if (this.state.options.length > 0) { if (this.state.options.length > 0) {
this.props.navigation.push(this.state.options[0].screen, { this.props.navigation.push(this.state.options[0].screen, {
title: this.state.options[0].title, title: item.operator_name,
type: this.state.options[0].type type: this.state.options[0].type
}); });
} else { } else {

View File

@ -53,7 +53,7 @@ export default class PaiementFacture extends Component {
return I18n.t('IDENTIFIANT_ETUDIANT') return I18n.t('IDENTIFIANT_ETUDIANT')
case 'PAIEMENT_EAU': case 'PAIEMENT_EAU':
return I18n.t('NUMERO_ABONNE') return I18n.t('NUMERO_ABONNE')
case 'PAIEMENT_ELECTRICITE': case 'PAIEMENT_EAU_ELECTRICITE':
return I18n.t('NUMERO_ABONNE') return I18n.t('NUMERO_ABONNE')
case 'PAIEMENT_CREDIT_TELEPHONE': case 'PAIEMENT_CREDIT_TELEPHONE':
return I18n.t('PHONE_NUMBER') return I18n.t('PHONE_NUMBER')

File diff suppressed because it is too large Load Diff

View File

@ -94,7 +94,7 @@ class WalletDetailUser extends Component {
this.heightImageBanner = Utils.scaleWithPixel(250, 1); this.heightImageBanner = Utils.scaleWithPixel(250, 1);
this.marginTopBanner = this.heightImageBanner - this.state.heightHeader - 40; this.marginTopBanner = this.heightImageBanner - this.state.heightHeader - 40;
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb"; this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale); moment.locale(this.currentLocale);
IlinkEmitter.on("langueChange", this.updateLangue.bind(this)); IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
IlinkEmitter.on("refreshWallet", this.refresh); IlinkEmitter.on("refreshWallet", this.refresh);

View File

@ -448,7 +448,7 @@ class WalletOptionSelect extends Component {
{ {
!isNil(this.state.user.category) ? !isNil(this.state.user.category) ?
Object.keys(omit(item, ['id', 'retrait_cash', 'type_historique', 'type_caution', 'id_demande', 'montant_rembourse', 'partiellement_rembourse', 'duree_mois', 'etat', 'interet', 'taxe', 'date_validation', 'date_remboursement_prevu', 'date_remboursement', 'id_user', 'id_wallet_agent', 'id_network', 'user', 'user_phone', 'agent', 'codeParrain'])).map((element, i) => ( Object.keys(omit(item, ['id', 'retrait_cash', 'montant_retire', 'type_historique', 'type_caution', 'id_demande', 'montant_rembourse', 'partiellement_rembourse', 'duree_mois', 'etat', 'interet', 'taxe', 'date_validation', 'date_remboursement_prevu', 'date_remboursement', 'id_user', 'id_wallet_agent', 'id_network', 'user', 'user_phone', 'agent', 'codeParrain'])).map((element, i) => (
<View style={{alignItems: 'center'}} key={i}> <View style={{alignItems: 'center'}} key={i}>
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}> <Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
@ -463,7 +463,7 @@ class WalletOptionSelect extends Component {
</View> </View>
)) ))
: :
Object.keys(omit(item, ['id', 'type', 'id_epargne', 'type_historique', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'etat', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'type_caution', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).map((element, i) => ( Object.keys(omit(item, ['id', 'type', 'montant_retire', 'id_epargne', 'type_historique', 'date_demande', 'date_fin', 'date_remboursement_prevu', 'date_validation', 'date_cassation', 'date_remboursement', 'id_demande', 'duree_mois', 'taxe', '', 'date_fin', 'date_cassation', 'etat', 'id_user', 'id_network', 'user', 'partiellement_rembourse', 'user_phone', 'type_caution', 'interet', 'date_remboursement_prevu', 'date_remboursement', 'id_wallet_agent', 'retrait_cash', 'codeParrain', 'agent', 'montant_rembourse', ''])).map((element, i) => (
<View style={{alignItems: 'center'}} key={i}> <View style={{alignItems: 'center'}} key={i}>
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}> <Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
@ -504,6 +504,15 @@ class WalletOptionSelect extends Component {
style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text> style={[Typography.caption1, Color.grayColor]}>{I18n.t(displayTransactionType(this.state.historyItemDetail.type_historique))}</Text>
</View> </View>
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('CAUTION_TYPE')}</Text>
</View>
<View style={{flex: 1, alignItems: 'flex-end'}}>
<Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.type_caution}</Text>
</View>
</View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text> <Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
@ -636,11 +645,11 @@ class WalletOptionSelect extends Component {
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text> <Text style={[styles.body2]}>{I18n.t('ID_SAVINGS')}</Text>
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text <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> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>
@ -679,6 +688,15 @@ class WalletOptionSelect extends Component {
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text> style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.montant + ' ' + this.state.wallet.currency_code}</Text>
</View> </View>
</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}}> <View style={{flexDirection: 'row', marginTop: 10}}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text> <Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text>
@ -712,7 +730,7 @@ class WalletOptionSelect extends Component {
</View> </View>
<View style={{flex: 1, alignItems: 'flex-end'}}> <View style={{flex: 1, alignItems: 'flex-end'}}>
<Text <Text
style={[Typography.caption1, Color.grayColor]}>{this.state.historyItemDetail.date_fin}</Text> style={[Typography.caption1, Color.grayColor]}>{isEqual(this.state.historyItemDetail.type, 'SIMPLE') ? I18n.t('NON_APPLICABLE') : this.state.historyItemDetail.date_fin}</Text>
</View> </View>
</View> </View>
<View style={{flexDirection: 'row', marginTop: 10}}> <View style={{flexDirection: 'row', marginTop: 10}}>

View File

@ -373,11 +373,7 @@ export const optionRetraitUserScreen = {
screen: '', screen: '',
icon: 'credit-card', icon: 'credit-card',
title: 'WITHDRAWAL_BANK_TO_WALLET', title: 'WITHDRAWAL_BANK_TO_WALLET',
}, { }
screen: '',
icon: 'credit-card',
title: 'WITHDRAWAL_BANK_TO_CASH',
},
] ]
} }

View File

@ -161,6 +161,7 @@
"NANO_CREDIT_LIST": "Nano credit list", "NANO_CREDIT_LIST": "Nano credit list",
"SAVINGS_LIST": "Savings list", "SAVINGS_LIST": "Savings list",
"NO_NANO_CREDIT": "No nano credit demand", "NO_NANO_CREDIT": "No nano credit demand",
"NO_SAVINGS": "No savings",
"NANO_CREDIT_DESCRIPTION": "Nano credit description", "NANO_CREDIT_DESCRIPTION": "Nano credit description",
"NANO_SANTE": "Nano health", "NANO_SANTE": "Nano health",
"NANO_SANTE_DESCRIPTION": "Nano health description", "NANO_SANTE_DESCRIPTION": "Nano health description",
@ -173,8 +174,10 @@
"CAUTION_CREDIT": "Caution credit demand", "CAUTION_CREDIT": "Caution credit demand",
"CAUTIONNEMENT_DONE": "Caution done", "CAUTIONNEMENT_DONE": "Caution done",
"ID_DEMAND": "Demand ID", "ID_DEMAND": "Demand ID",
"ID_SAVINGS": "Saving ID",
"NON_APPLICABLE": "Not applicable",
"DATE": "Date", "DATE": "Date",
"PAIEMENT_EAU_ELECTRICITY": "Water bill", "PAIEMENT_EAU": "Water bill",
"PAIEMENT_ELECTRICITY": "Electricity bill", "PAIEMENT_ELECTRICITY": "Electricity bill",
"PAIEMENT_ECOLE": "School fees", "PAIEMENT_ECOLE": "School fees",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills", "PAIEMENT_CREDIT_TELEPHONIQUE": "Phone credit bills",

View File

@ -168,6 +168,7 @@
"NANO_CREDIT_LIST": "Liste des nano crédit", "NANO_CREDIT_LIST": "Liste des nano crédit",
"SAVINGS_LIST": "Liste des épargnes", "SAVINGS_LIST": "Liste des épargnes",
"NO_NANO_CREDIT": "Aucune demande de nano crédit", "NO_NANO_CREDIT": "Aucune demande de nano crédit",
"NO_SAVINGS": "Aucune épargne",
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink", "NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
"NANO_SANTE": "Nano santé", "NANO_SANTE": "Nano santé",
"NANO_SANTE_DESCRIPTION": "Nano santé iLink", "NANO_SANTE_DESCRIPTION": "Nano santé iLink",
@ -180,11 +181,13 @@
"CAUTION_CREDIT": "Cautionner une demande de crédit", "CAUTION_CREDIT": "Cautionner une demande de crédit",
"CAUTIONNEMENT_DONE": "Cautionnement effectué", "CAUTIONNEMENT_DONE": "Cautionnement effectué",
"ID_DEMAND": "Identifiant de la demande", "ID_DEMAND": "Identifiant de la demande",
"ID_SAVINGS": "Identifiant de l'épargne",
"PAIEMENT_EAU": "Paiement eau", "PAIEMENT_EAU": "Paiement eau",
"PAIEMENT_ELECTRICITY": "Paiement électricité", "PAIEMENT_ELECTRICITY": "Paiement électricité",
"PAIEMENT_ECOLE": "Paiement école", "PAIEMENT_ECOLE": "Paiement école",
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique", "PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV", "PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
"NON_APPLICABLE": "Non applicable",
"DATE": "Date", "DATE": "Date",
"DEMAND_DATE": "Date de la demande", "DEMAND_DATE": "Date de la demande",
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu", "DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
@ -218,8 +221,8 @@
"DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de", "DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de",
"NO_WALLET_HISTORY": "Aucune transaction à ce jour", "NO_WALLET_HISTORY": "Aucune transaction à ce jour",
"DEMAND_SEND": "Demande envoyé", "DEMAND_SEND": "Demande envoyé",
"EPARGNE_DEPOSE": "Epargne déposé", "EPARGNE_DEPOSE": "Epargne déposée",
"BREAK_EPARGNE_DONE": "Epargne cassé avec succès", "BREAK_EPARGNE_DONE": "Epargne cassée avec succès",
"BREAK_EPARGNE": "Casser mon épargne", "BREAK_EPARGNE": "Casser mon épargne",
"ID_EPARGNE": "Identifiant de l'épargne", "ID_EPARGNE": "Identifiant de l'épargne",
"NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe", "NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe",

View File

@ -69,6 +69,7 @@ export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCre
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands'; export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands'; export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history'; export const getHyperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_hyper_history';
export const getSuperviseurHistoriqueUrl = testBaseUrl + '/walletService/wallets/all_super_history';
export const getBankUrl = testBaseUrl + '/walletService/wallets/users/operators/bank'; export const getBankUrl = testBaseUrl + '/walletService/wallets/users/operators/bank';
export const getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/demands_in_progress'; export const getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/demands_in_progress';
export const getHistoryEpargnePendingUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/demands_in_progress'; export const getHistoryEpargnePendingUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/demands_in_progress';

View File

@ -1,11 +1,12 @@
import { db } from './db'; import {db} from './db';
import { AsyncStorage } from 'react-native'; import {AsyncStorage} from 'react-native';
export default class Configuration { export default class Configuration {
constructor() { constructor() {
} }
async getCurrentLangue() { async getCurrentLangue() {
const da = await _getData() const da = await _getData()
if (da) resolve(da) if (da) resolve(da)
@ -26,11 +27,12 @@ export default class Configuration {
return pasObject.valeur_bool; return pasObject.valeur_bool;
} else return pasObject; } else return pasObject;
} }
async setPubActive(data) { async setPubActive(data) {
try { try {
if (data.pub) { if (data.pub) {
await AsyncStorage.setItem('pubObject', JSON.stringify(data.pub)); await AsyncStorage.setItem('pubObject', JSON.stringify(data.pub));
db.update({ "configuration.pub": { $exists: true } }, { configuration: { pub: data.pub } }, { upsert: true }, (err, num, upsert) => { db.update({"configuration.pub": {$exists: true}}, {configuration: {pub: data.pub}}, {upsert: true}, (err, num, upsert) => {
console.log([err, num, upsert]) console.log([err, num, upsert])
}) })
} }
@ -39,6 +41,7 @@ export default class Configuration {
} }
} }
_getPubData() { _getPubData() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
@ -52,19 +55,21 @@ export default class Configuration {
}) })
} }
setCurrentLangue(lang) { setCurrentLangue(lang) {
this._storeData(lang) this._storeData(lang)
db.update({ "configuration.lang": { $exists: true } }, { configuration: { lang: lang } }, { upsert: true }, (err, num, upsert) => { db.update({"configuration.lang": {$exists: true}}, {configuration: {lang: lang}}, {upsert: true}, (err, num, upsert) => {
console.log([err, num, upsert]) console.log([err, num, upsert])
}) })
} }
setCurrentPas = async (pas) => { setCurrentPas = async (pas) => {
try { try {
await AsyncStorage.setItem('@config:pasObject', JSON.stringify(pas.pas)); await AsyncStorage.setItem('@config:pasObject', JSON.stringify(pas.pas));
} catch (error) { } catch (error) {
console.warn(error) console.warn(error)
} }
db.update({ "configuration.pas": { $exists: true } }, { configuration: { pas: pas.pas } }, { upsert: true }, (err, num, upsert) => { db.update({"configuration.pas": {$exists: true}}, {configuration: {pas: pas.pas}}, {upsert: true}, (err, num, upsert) => {
console.log([err, num, upsert]) console.log([err, num, upsert])
}) })
} }