Correction de bugs
This commit is contained in:
parent
0a1c1f896a
commit
4a574e9a6f
801
App.js
801
App.js
|
@ -6,12 +6,17 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { ActionSheetProvider, connectActionSheet } from '@expo/react-native-action-sheet'
|
||||
import { Platform, StyleSheet, Text, View, YellowBox, AsyncStorage } from 'react-native';
|
||||
import { createAppContainer, HeaderBackButton, createSwitchNavigator, createStackNavigator, createBottomTabNavigator, createDrawerNavigator } from 'react-navigation';
|
||||
import React from 'react';
|
||||
import {ActionSheetProvider} from '@expo/react-native-action-sheet'
|
||||
import {AsyncStorage, Platform, StyleSheet} from 'react-native';
|
||||
import {
|
||||
createAppContainer,
|
||||
createBottomTabNavigator,
|
||||
createDrawerNavigator,
|
||||
createStackNavigator,
|
||||
createSwitchNavigator
|
||||
} from 'react-navigation';
|
||||
import OneSignal from 'react-native-onesignal';
|
||||
import _ from 'lodash';
|
||||
import Connect from "./screens/login/Connect";
|
||||
import SplashScreen from "./screens/splashscreen/SplashScreen";
|
||||
import HelpMenu from "./screens/help/HelpMenu";
|
||||
|
@ -26,8 +31,6 @@ import ActivateAccount from "./screens/login/ActivateAccount";
|
|||
import Notifications from "./screens/notifications/Notifications";
|
||||
import About from "./screens/configurations/About";
|
||||
import Configurations from "./screens/configurations/Configurations";
|
||||
|
||||
import History from './screens/history-request/History'
|
||||
import OptionsMenu from "./screens/optionMenu/OptionsMenu";
|
||||
import Home from "./screens/home/Home";
|
||||
import HistoryItemDetails from "./screens/history-request/HistoryItemDetails";
|
||||
|
@ -36,18 +39,13 @@ import HistoryRequester from "./screens/history-request/HistoryRequester";
|
|||
import AddNetwork from "./screens/account/AddNetwork";
|
||||
import MyHistory from "./screens/history-request/MyHistory";
|
||||
import Icon from "react-native-vector-icons/FontAwesome5";
|
||||
import { Appbar } from 'react-native-paper';
|
||||
|
||||
import IconWithBadge from "./screens/IconWithBadge"
|
||||
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 WalletSelect from './screens/wallet/WalletSelect';
|
||||
import { PersistGate } from 'redux-persist/integration/react';
|
||||
import { store, persistor } from './redux/store';
|
||||
import { Provider, connect } from 'react-redux';
|
||||
import {PersistGate} from 'redux-persist/integration/react';
|
||||
import {persistor, store} from './redux/store';
|
||||
import {Provider} from 'react-redux';
|
||||
import WalletDepot from './screens/wallet/WalletDepot';
|
||||
import WalletRetrait from './screens/wallet/WalletRetrait';
|
||||
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 ModifyIdentificationUser from './screens/identification/ModifyIdentificationUser';
|
||||
import CreateGroupNanoCredit from './screens/nano-credit/CreateGroupNanoCredit';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import DemandValidationGroup from './screens/nano-credit/DemandGroupNanoCredit';
|
||||
import DemandGroupNanoCreditDetail from './screens/nano-credit/DemandGroupNanoCreditDetail';
|
||||
import NavigationService from './utils/NavigationService';
|
||||
import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit';
|
||||
import MyNanoCreditGroup from './screens/nano-credit/MyNanoCreditGroup';
|
||||
import AskNanoCredit from './screens/nano-credit/AskNanoCredit';
|
||||
|
@ -84,479 +80,484 @@ import RefundNanoCreditUser from './screens/nano-credit/RefundNanoCreditUser';
|
|||
import CautionNanoCreditAgent from './screens/nano-credit/CautionNanoCreditAgent';
|
||||
import EpargnerArgentUser from './screens/nano-credit/EpargnerArgentUser';
|
||||
import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||
import { IlinkEmitter } from './utils/events';
|
||||
import { fromBottom, fromLeft, zoomIn } from 'react-navigation-transitions';
|
||||
import { readUser } from './webservice/AuthApi';
|
||||
import {IlinkEmitter} from './utils/events';
|
||||
import EnvoieWalletToBankAgent from "./screens/wallet/agent/EnvoieWalletToBankAgent";
|
||||
|
||||
|
||||
const instructions = Platform.select({
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
android:
|
||||
'Double tap R on your keyboard to reload,\n' +
|
||||
'Shake or press menu button for dev menu',
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
android:
|
||||
'Double tap R on your keyboard to reload,\n' +
|
||||
'Shake or press menu button for dev menu',
|
||||
});
|
||||
|
||||
const theme = require("./utils/theme")
|
||||
|
||||
const AuthStack = createStackNavigator({
|
||||
login: Connect,
|
||||
helpMenu: HelpMenu,
|
||||
help: Help,
|
||||
forgottenpass: ForgottenPassword,
|
||||
typeaccountcreate: TypeChoiser,
|
||||
simpleusercreate: createAccount,
|
||||
step2: CreateUserStep2,
|
||||
activateaccout: ActivateAccount
|
||||
login: Connect,
|
||||
helpMenu: HelpMenu,
|
||||
help: Help,
|
||||
forgottenpass: ForgottenPassword,
|
||||
typeaccountcreate: TypeChoiser,
|
||||
simpleusercreate: createAccount,
|
||||
step2: CreateUserStep2,
|
||||
activateaccout: ActivateAccount
|
||||
|
||||
}, {
|
||||
headerMode: 'none'
|
||||
headerMode: 'none'
|
||||
})
|
||||
const AppStack = createDrawerNavigator({
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
/* filtre:Filter,
|
||||
network:Networks,*/
|
||||
useraccount: {
|
||||
screen: UserAccount,
|
||||
navigationOptions: {
|
||||
},
|
||||
},
|
||||
walletSelect: WalletSelect,
|
||||
createIdentificationUser: CreateIdentificationUser,
|
||||
modifyIdentificationUser: ModifyIdentificationUser,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetailUser: WalletDetailUser,
|
||||
walletOptionSelect: WalletOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
paiementFacture: PaiementFacture,
|
||||
envoieWalletToWalletUser: EnvoieWalletToWalletUser,
|
||||
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
||||
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
||||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
||||
linkCard: LinkCard,
|
||||
epargnerArgentUser: EpargnerArgentUser,
|
||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||
groupNanoCredit: {
|
||||
screen: createBottomTabNavigator({
|
||||
demandeValidationGroupe: {
|
||||
screen: DemandValidationGroup,
|
||||
navigationOptions: {
|
||||
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||
return (<Icon
|
||||
size={20}
|
||||
name={"users-cog"}
|
||||
color={focused ? tintColor : "grey"}
|
||||
/>)
|
||||
}
|
||||
}
|
||||
},
|
||||
myNanoCreditGroup: {
|
||||
screen: MyNanoCreditGroup,
|
||||
navigationOptions: {
|
||||
tabBarLabel: I18n.t('MY_GROUP'),
|
||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||
return (<Icon
|
||||
size={20}
|
||||
name={"users"}
|
||||
color={focused ? tintColor : "grey"}
|
||||
/>)
|
||||
}
|
||||
}
|
||||
},
|
||||
}, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
title: I18n.t('MANAGE_GROUP'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
},
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
/* filtre:Filter,
|
||||
network:Networks,*/
|
||||
useraccount: {
|
||||
screen: UserAccount,
|
||||
navigationOptions: {},
|
||||
},
|
||||
walletSelect: WalletSelect,
|
||||
createIdentificationUser: CreateIdentificationUser,
|
||||
modifyIdentificationUser: ModifyIdentificationUser,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetailUser: WalletDetailUser,
|
||||
walletOptionSelect: WalletOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
paiementFacture: PaiementFacture,
|
||||
envoieWalletToWalletUser: EnvoieWalletToWalletUser,
|
||||
envoieWalletToCashUser: EnvoieWalletToCashUser,
|
||||
envoieWalletToCardUser: EnvoieWalletToCardUser,
|
||||
envoieWalletToBankUser: EnvoieWalletToBankUser,
|
||||
retraitWalletVersCashUser: RetraitWalletVersCashUser,
|
||||
retraitCarteVersCashUser: RetraitCarteVersCashUser,
|
||||
retraitCarteVersWalletUser: RetraitCarteVersWalletUser,
|
||||
linkCard: LinkCard,
|
||||
epargnerArgentUser: EpargnerArgentUser,
|
||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||
groupNanoCredit: {
|
||||
screen: createBottomTabNavigator({
|
||||
demandeValidationGroupe: {
|
||||
screen: DemandValidationGroup,
|
||||
navigationOptions: {
|
||||
tabBarLabel: I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE'),
|
||||
tabBarIcon: ({focused, horizontal, tintColor}) => {
|
||||
return (<Icon
|
||||
size={20}
|
||||
name={"users-cog"}
|
||||
color={focused ? tintColor : "grey"}
|
||||
/>)
|
||||
}
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
header: null,
|
||||
headerMode: 'none',
|
||||
headerTitle: null,
|
||||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: { backgroundColor: '#694fad' },
|
||||
},
|
||||
myNanoCreditGroup: {
|
||||
screen: MyNanoCreditGroup,
|
||||
navigationOptions: {
|
||||
tabBarLabel: I18n.t('MY_GROUP'),
|
||||
tabBarIcon: ({focused, horizontal, tintColor}) => {
|
||||
return (<Icon
|
||||
size={20}
|
||||
name={"users"}
|
||||
color={focused ? tintColor : "grey"}
|
||||
/>)
|
||||
}
|
||||
}
|
||||
},
|
||||
}, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
title: I18n.t('MANAGE_GROUP'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
},
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
header: null,
|
||||
headerMode: 'none',
|
||||
headerTitle: null,
|
||||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: {backgroundColor: '#694fad'},
|
||||
|
||||
drawerLabel: I18n.t('MANAGE_GROUP'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'account-multiple'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
demandeValidationGroupe: DemandGroupNanoCreditDetail,
|
||||
adhererGroupNanoCredit: AdhererGroupNanoCredit,
|
||||
askNanoCredit: AskNanoCredit,
|
||||
refundNanoCreditUser: RefundNanoCreditUser,
|
||||
casserEpargneUser: CasserEpargneUser
|
||||
drawerLabel: I18n.t('MANAGE_GROUP'),
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'account-multiple'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
demandeValidationGroupe: DemandGroupNanoCreditDetail,
|
||||
adhererGroupNanoCredit: AdhererGroupNanoCredit,
|
||||
askNanoCredit: AskNanoCredit,
|
||||
refundNanoCreditUser: RefundNanoCreditUser,
|
||||
casserEpargneUser: CasserEpargneUser
|
||||
|
||||
})
|
||||
})
|
||||
}, {
|
||||
contentComponent: OptionsMenu,
|
||||
headerMode: 'none',
|
||||
contentOptions: { activeTintColor: theme.accent }
|
||||
contentComponent: OptionsMenu,
|
||||
headerMode: 'none',
|
||||
contentOptions: {activeTintColor: theme.accent}
|
||||
})
|
||||
|
||||
const AppAgentStack = createDrawerNavigator({
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
createIdentification: CreateIdentification,
|
||||
validateIdentification: ValidateIdentification,
|
||||
Historique:
|
||||
{
|
||||
screen: createBottomTabNavigator({ myDemand: MyHistory }, {
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
createIdentification: CreateIdentification,
|
||||
validateIdentification: ValidateIdentification,
|
||||
Historique:
|
||||
{
|
||||
screen: createBottomTabNavigator({myDemand: MyHistory}, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
headerTitle: I18n.t('CREDIT_MANAGE'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
fontWeight: "bold"
|
||||
},
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
fontWeight: "bold"
|
||||
},
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
header: null,
|
||||
headerMode: 'none',
|
||||
headerTitle: null,
|
||||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: { backgroundColor: '#694fad' },
|
||||
barStyle: {backgroundColor: '#694fad'},
|
||||
/* headerLeft: (<HeaderBackButton />), */
|
||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
creditrequest: HistoryRequester,
|
||||
addNetwork: AddNetwork,
|
||||
updateinformation: UpdateInformations,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait,
|
||||
walletOptionSelect: WalletOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
paiementFacture: PaiementFacture,
|
||||
retraitEnCashAgent: RetraitEnCashAgent,
|
||||
retraitCarteVersCashAgent: RetraitCarteVersCashAgent,
|
||||
envoieCashVersWalletAgent: EnvoieCashVersWalletAgent,
|
||||
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
||||
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
||||
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
||||
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||
})
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
creditrequest: HistoryRequester,
|
||||
addNetwork: AddNetwork,
|
||||
updateinformation: UpdateInformations,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait,
|
||||
walletOptionSelect: WalletOptionSelect,
|
||||
operateurOptionSelect: OperateurOptionSelect,
|
||||
paiementFacture: PaiementFacture,
|
||||
retraitEnCashAgent: RetraitEnCashAgent,
|
||||
retraitCarteVersCashAgent: RetraitCarteVersCashAgent,
|
||||
envoieCashVersWalletAgent: EnvoieCashVersWalletAgent,
|
||||
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
||||
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
||||
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
||||
envoieWalletToBankAgent: EnvoieWalletToBankAgent,
|
||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||
})
|
||||
}, {
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
lazy: false,
|
||||
headerMode: 'none', contentOptions: { activeTintColor: theme.accent }
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
lazy: false,
|
||||
headerMode: 'none', contentOptions: {activeTintColor: theme.accent}
|
||||
});
|
||||
|
||||
const AppAdministratorStack = createDrawerNavigator({
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
Historique: {
|
||||
screen: createBottomTabNavigator({
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
Historique: {
|
||||
screen: createBottomTabNavigator({
|
||||
myDemand: MyHistory, OthersDemand: MyHistory
|
||||
}, {
|
||||
}, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
title: I18n.t('CREDIT_MANAGE'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
},
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
},
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
header: null,
|
||||
headerMode: 'none',
|
||||
headerTitle: null,
|
||||
activeColor: '#f0edf6',
|
||||
inactiveColor: '#3e2465',
|
||||
barStyle: { backgroundColor: '#694fad' },
|
||||
barStyle: {backgroundColor: '#694fad'},
|
||||
|
||||
drawerLabel: I18n.t('CREDIT_MANAGE'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
creditrequest: HistoryRequester,
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
creditrequest: HistoryRequester,
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
|
||||
superviseurgroup: SuperViseurGroupeHome,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait
|
||||
superviseurgroup: SuperViseurGroupeHome,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait
|
||||
|
||||
})
|
||||
},
|
||||
{
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
headerMode: 'none'
|
||||
});
|
||||
})
|
||||
},
|
||||
{
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
headerMode: 'none'
|
||||
});
|
||||
|
||||
const AppSuperAdministrator = createDrawerNavigator({
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
Historique: {
|
||||
screen: createBottomTabNavigator({ OthersDemand: MyHistory }, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
title: I18n.t('CREDIT_MANAGE'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
fontWeight: "bold"
|
||||
},
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
title: I18n.t('CREDIT_MANAGE'),
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
creditrequest: HistoryRequester,
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
superviseurgroup: SuperViseurGroupeHome,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait
|
||||
sta: createStackNavigator({
|
||||
home: Home,
|
||||
useraccount: UserAccount,
|
||||
walletSelect: WalletSelect,
|
||||
Historique: {
|
||||
screen: createBottomTabNavigator({OthersDemand: MyHistory}, {
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
title: I18n.t('CREDIT_MANAGE'),
|
||||
tabBarOptions: {
|
||||
labelStyle: {
|
||||
fontSize: 13,
|
||||
fontWeight: "bold"
|
||||
},
|
||||
}
|
||||
}),
|
||||
navigationOptions: () => ({
|
||||
title: I18n.t('CREDIT_MANAGE'),
|
||||
headerMode: "none",
|
||||
header: null,
|
||||
headerTitle: null,
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'credit-card'}
|
||||
size={24}
|
||||
/>)
|
||||
}),
|
||||
},
|
||||
creditrequest: HistoryRequester,
|
||||
historyItemDetails: HistoryItemDetails,
|
||||
superviseurgroup: SuperViseurGroupeHome,
|
||||
notificationview: Notifications,
|
||||
configuration: Configurations,
|
||||
about: About,
|
||||
walletDetail: WalletDetail,
|
||||
walletDepot: WalletDepot,
|
||||
walletRetrait: WalletRetrait
|
||||
|
||||
})
|
||||
})
|
||||
}, {
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
headerMode: 'none'
|
||||
contentComponent: OptionsMenu,
|
||||
backBehavior: "none",
|
||||
headerMode: 'none'
|
||||
});
|
||||
|
||||
export const AppNavigator = createSwitchNavigator({
|
||||
first: {
|
||||
screen: SplashScreen
|
||||
},
|
||||
App: AppStack,
|
||||
AgentApp: AppAgentStack,
|
||||
adminApp: AppAdministratorStack,
|
||||
supAdminApp: AppSuperAdministrator,
|
||||
Auth: AuthStack
|
||||
first: {
|
||||
screen: SplashScreen
|
||||
},
|
||||
App: AppStack,
|
||||
AgentApp: AppAgentStack,
|
||||
adminApp: AppAdministratorStack,
|
||||
supAdminApp: AppSuperAdministrator,
|
||||
Auth: AuthStack
|
||||
}, {
|
||||
initialRouteName: 'first'
|
||||
initialRouteName: 'first'
|
||||
});
|
||||
const AppContainer = createAppContainer(AppNavigator);
|
||||
|
||||
class App extends React.Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
console.log("APP PROPS", this.props);
|
||||
global.appHasLoaded = false;
|
||||
//Remove this method to stop OneSignal Debugging
|
||||
OneSignal.setLogLevel(6, 0);
|
||||
constructor(props) {
|
||||
super(props);
|
||||
console.log("APP PROPS", this.props);
|
||||
global.appHasLoaded = false;
|
||||
//Remove this method to stop OneSignal Debugging
|
||||
OneSignal.setLogLevel(6, 0);
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
||||
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.
|
||||
|
||||
// Replace 'YOUR_ONESIGNAL_APP_ID' with your OneSignal App ID.
|
||||
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.
|
||||
// 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)
|
||||
OneSignal.promptForPushNotificationsWithUserResponse(myiOSPromptCallback);
|
||||
|
||||
// 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)
|
||||
OneSignal.promptForPushNotificationsWithUserResponse(myiOSPromptCallback);
|
||||
OneSignal.addEventListener('received', this.onReceived);
|
||||
OneSignal.addEventListener('opened', this.onOpened);
|
||||
OneSignal.addEventListener('ids', this.onIds);
|
||||
}
|
||||
|
||||
OneSignal.addEventListener('received', this.onReceived);
|
||||
OneSignal.addEventListener('opened', this.onOpened);
|
||||
OneSignal.addEventListener('ids', this.onIds);
|
||||
}
|
||||
updateLangue() {
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
_getOneSignalIds = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const getElement = await AsyncStorage.getItem('@config:onesignalIds');
|
||||
resolve(getElement);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
_getOneSignalIds = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const getElement = await AsyncStorage.getItem('@config:onesignalIds');
|
||||
resolve(getElement);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_saveOneSignalIds = async (ids) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:onesignalIds', ids);
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
}
|
||||
_saveOneSignalIds = async (ids) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:onesignalIds', ids);
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
goToScreen = (routeName, params, isReset = true) => {
|
||||
const { navigator } = this.refs;
|
||||
if (typeof navigator !== 'undefined') {
|
||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||
if (global.appHasLoaded) {
|
||||
goToScreen = (routeName, params, isReset = true) => {
|
||||
const {navigator} = this.refs;
|
||||
if (typeof navigator !== 'undefined') {
|
||||
console.log("APP HAS LOADED", global.appHasLoaded);
|
||||
if (global.appHasLoaded) {
|
||||
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName,
|
||||
params
|
||||
});
|
||||
/* readUser().then((result) => {
|
||||
if (result === null || result === undefined) {
|
||||
console.warn("APP HAS LOADED NOTIFICATION PARAMS", params);
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName,
|
||||
params
|
||||
});
|
||||
/* readUser().then((result) => {
|
||||
if (result === null || result === undefined) {
|
||||
console.warn("APP HAS LOADED NOTIFICATION PARAMS", params);
|
||||
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
params: { routeName, params }
|
||||
});
|
||||
} else {
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName,
|
||||
params
|
||||
});
|
||||
}
|
||||
}); */
|
||||
} else {
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
params: { routeName, params }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
params: { routeName, params }
|
||||
});
|
||||
} else {
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName,
|
||||
params
|
||||
});
|
||||
}
|
||||
}); */
|
||||
} else {
|
||||
navigator.dispatch({
|
||||
type: "Navigation/NAVIGATE",
|
||||
routeName: "first",
|
||||
params: {routeName, params}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
handleDeepLink = (openResult) => {
|
||||
const data = openResult.notification.payload.additionalData;
|
||||
//const dataParse = data.replace("'", "\"");
|
||||
console.warn("HANDLE DEEP LINK", data);
|
||||
switch (data.screen) {
|
||||
case 'historyItemDetails':
|
||||
console.log("History Item");
|
||||
this.goToScreen(data.screen, {
|
||||
item: data.data
|
||||
});
|
||||
break;
|
||||
handleDeepLink = (openResult) => {
|
||||
const data = openResult.notification.payload.additionalData;
|
||||
//const dataParse = data.replace("'", "\"");
|
||||
console.warn("HANDLE DEEP LINK", data);
|
||||
switch (data.screen) {
|
||||
case 'historyItemDetails':
|
||||
console.log("History Item");
|
||||
this.goToScreen(data.screen, {
|
||||
item: data.data
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
console.log("Not History Item");
|
||||
this.goToScreen(data.screen, {
|
||||
id: data.data.id
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
console.log("Not History Item");
|
||||
this.goToScreen(data.screen, {
|
||||
id: data.data.id
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
/* if (data && data.id) {
|
||||
this.goToScreen(data.screen, {
|
||||
id: data.id,
|
||||
goToScreen: this.goToScreen
|
||||
});
|
||||
} else {
|
||||
console.log("notification is invalid data");
|
||||
} */
|
||||
};
|
||||
/* if (data && data.id) {
|
||||
this.goToScreen(data.screen, {
|
||||
id: data.id,
|
||||
goToScreen: this.goToScreen
|
||||
});
|
||||
} else {
|
||||
console.log("notification is invalid data");
|
||||
} */
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
OneSignal.removeEventListener('received', this.onReceived);
|
||||
OneSignal.removeEventListener('opened', this.onOpened);
|
||||
OneSignal.removeEventListener('ids', this.onIds);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
OneSignal.removeEventListener('received', this.onReceived);
|
||||
OneSignal.removeEventListener('opened', this.onOpened);
|
||||
OneSignal.removeEventListener('ids', this.onIds);
|
||||
}
|
||||
|
||||
onReceived(notification) {
|
||||
console.log("Notification received: ", notification);
|
||||
}
|
||||
onReceived(notification) {
|
||||
console.log("Notification received: ", notification);
|
||||
}
|
||||
|
||||
onOpened = (openResult) => {
|
||||
let data = openResult.notification.payload.additionalData;
|
||||
this.handleDeepLink(openResult);
|
||||
console.log('Message: ', openResult.notification.payload.body);
|
||||
console.log('Data: ', openResult.notification.payload.additionalData);
|
||||
console.log('isActive: ', openResult.notification.isAppInFocus);
|
||||
console.log('openResult: ', openResult);
|
||||
}
|
||||
onOpened = (openResult) => {
|
||||
let data = openResult.notification.payload.additionalData;
|
||||
this.handleDeepLink(openResult);
|
||||
console.log('Message: ', openResult.notification.payload.body);
|
||||
console.log('Data: ', openResult.notification.payload.additionalData);
|
||||
console.log('isActive: ', openResult.notification.isAppInFocus);
|
||||
console.log('openResult: ', openResult);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate persistor={persistor}>
|
||||
<ActionSheetProvider>
|
||||
<AppContainer ref="navigator" />
|
||||
</ActionSheetProvider>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<PersistGate persistor={persistor}>
|
||||
<ActionSheetProvider>
|
||||
<AppContainer ref="navigator"/>
|
||||
</ActionSheetProvider>
|
||||
</PersistGate>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function myiOSPromptCallback(permission) {
|
||||
// do something with permission value
|
||||
// do something with permission value
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -159,7 +159,9 @@
|
|||
"DEPOSIT_TO_BANK": "Your Wallet to bank",
|
||||
"NANO_CREDIT": "Nano credit",
|
||||
"NANO_CREDIT_LIST": "Nano credit list",
|
||||
"SAVINGS_LIST": "Savings list",
|
||||
"NO_NANO_CREDIT": "No nano credit demand",
|
||||
"NO_SAVINGS": "No savings",
|
||||
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
|
||||
"NANO_SANTE": "Nano health",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
|
@ -172,6 +174,8 @@
|
|||
"CAUTION_CREDIT": "Caution credit demand",
|
||||
"CAUTIONNEMENT_DONE": "Caution done",
|
||||
"ID_DEMAND": "Demand ID",
|
||||
"ID_SAVINGS": "Saving ID",
|
||||
"NON_APPLICABLE": "Not applicable",
|
||||
"DATE": "Date",
|
||||
"PAIEMENT_EAU_ELECTRICITY": "Water bill",
|
||||
"PAIEMENT_ELECTRICITY": "Electricity bill",
|
||||
|
@ -182,6 +186,7 @@
|
|||
"DATE_REMBOURSEMENT_PREVU": "Expected refund date",
|
||||
"DATE_REMBOURSEMENT": "Refund date",
|
||||
"AMOUNT_REFUND": "Amount reimbursed",
|
||||
"AMOUNT_WITHDRAWAL": "Amount withdrawal",
|
||||
"AMOUNT_PARTIALLY_REFUND": "Amount partially refunded",
|
||||
"FINAL_DATE": "End date",
|
||||
"CASSATION_DATE": "Cassation date",
|
||||
|
|
|
@ -166,7 +166,9 @@
|
|||
"DEPOSIT_TO_BANK": "Votre Wallet vers banque",
|
||||
"NANO_CREDIT": "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_SAVINGS": "Aucune épargne",
|
||||
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
|
||||
"NANO_SANTE": "Nano santé",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
|
@ -179,16 +181,19 @@
|
|||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||
"CAUTIONNEMENT_DONE": "Cautionnement effectué",
|
||||
"ID_DEMAND": "Identifiant de la demande",
|
||||
"ID_SAVINGS": "Identifiant de l'épargne",
|
||||
"PAIEMENT_EAU": "Paiement eau",
|
||||
"PAIEMENT_ELECTRICITY": "Paiement électricité",
|
||||
"PAIEMENT_ECOLE": "Paiement école",
|
||||
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
|
||||
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
|
||||
"NON_APPLICABLE": "Non applicable",
|
||||
"DATE": "Date",
|
||||
"DEMAND_DATE": "Date de la demande",
|
||||
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||
"DATE_REMBOURSEMENT": "Date de remboursement",
|
||||
"AMOUNT_REFUND": "Montant remboursé",
|
||||
"AMOUNT_WITHDRAWAL": "Montant retiré",
|
||||
"AMOUNT_PARTIALLY_REFUND": "Montant partiellement remboursé",
|
||||
"FINAL_DATE": "Date de fin",
|
||||
"CASSATION_DATE": "Date de cassation",
|
||||
|
@ -216,8 +221,8 @@
|
|||
"DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de",
|
||||
"NO_WALLET_HISTORY": "Aucune transaction à ce jour",
|
||||
"DEMAND_SEND": "Demande envoyé",
|
||||
"EPARGNE_DEPOSE": "Epargne déposé",
|
||||
"BREAK_EPARGNE_DONE": "Epargne cassé avec succès",
|
||||
"EPARGNE_DEPOSE": "Epargne déposée",
|
||||
"BREAK_EPARGNE_DONE": "Epargne cassée avec succès",
|
||||
"BREAK_EPARGNE": "Casser mon épargne",
|
||||
"ID_EPARGNE": "Identifiant de l'épargne",
|
||||
"NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe",
|
||||
|
|
|
@ -1,89 +1,90 @@
|
|||
import React, { Component } from 'react'
|
||||
import { StyleSheet, Text, View, Alert, Platform, StatusBar } from 'react-native'
|
||||
import React from 'react'
|
||||
import {Platform, StatusBar, StyleSheet, Text, View} from 'react-native'
|
||||
import BaseScreen from "../BaseScreen";
|
||||
import { responsiveWidth, responsiveHeight } from 'react-native-responsive-dimensions'
|
||||
import { Dropdown } from 'react-native-material-dropdown'
|
||||
import { disconnect } from './../../webservice/AuthApi'
|
||||
import {responsiveWidth} from 'react-native-responsive-dimensions'
|
||||
import {Dropdown} from 'react-native-material-dropdown'
|
||||
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 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")
|
||||
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 {
|
||||
|
||||
static navigationOptions = {
|
||||
headerTitle: I18n.t('CONFIGURATIONS'),
|
||||
drawerIcon: ({ tintColor }) => (
|
||||
<Icon
|
||||
name={'settings'}
|
||||
size={24}
|
||||
/>
|
||||
)
|
||||
};
|
||||
constructor(props) {
|
||||
super(props, true)
|
||||
this.state = this.initState()
|
||||
this.configuration = new Configuration();
|
||||
if (Platform.OS === 'android') {
|
||||
SafeAreaView.setStatusBarHeight(StatusBar.currentHeight);
|
||||
}
|
||||
}
|
||||
static navigationOptions = {
|
||||
headerTitle: I18n.t('CONFIGURATIONS'),
|
||||
drawerIcon: ({tintColor}) => (
|
||||
<Icon
|
||||
name={'settings'}
|
||||
size={24}
|
||||
/>
|
||||
)
|
||||
};
|
||||
|
||||
initState() {
|
||||
let language = [];
|
||||
language.push({ name: I18n.t('langue.english'), value: 'en' });
|
||||
language.push({ name: I18n.t('langue.french'), value: 'fr' });
|
||||
constructor(props) {
|
||||
super(props, true)
|
||||
this.state = this.initState()
|
||||
this.configuration = new Configuration();
|
||||
if (Platform.OS === 'android') {
|
||||
SafeAreaView.setStatusBarHeight(StatusBar.currentHeight);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
languages: language
|
||||
}
|
||||
initState() {
|
||||
let language = [];
|
||||
language.push({name: I18n.t('langue.english'), value: 'en'});
|
||||
language.push({name: I18n.t('langue.french'), value: 'fr'});
|
||||
|
||||
}
|
||||
render() {
|
||||
console.log(this.state)
|
||||
return (<View style={styles.container}>
|
||||
return {
|
||||
languages: language
|
||||
}
|
||||
|
||||
<View
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}
|
||||
|
||||
render() {
|
||||
console.log(this.state)
|
||||
return (<View style={styles.container}>
|
||||
|
||||
<View
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}
|
||||
|
||||
>
|
||||
|
||||
<Text style={{fontSize: 17,}}>{I18n.t("CHOOSE_LANGUAGE")}</Text>
|
||||
<Dropdown
|
||||
label={I18n.t("CHANGE_LANG_LABEL")}
|
||||
data={this.state.languages}
|
||||
onChangeText={(value, index, data) => {
|
||||
I18n.locale = value
|
||||
this.setState({language: value})
|
||||
this.configuration.setCurrentLangue(data[index])
|
||||
IlinkEmitter.emit('langueChange')
|
||||
}}
|
||||
valueExtractor={(value) => value.value}
|
||||
labelExtractor={(value) => value.name}
|
||||
/>
|
||||
|
||||
>
|
||||
|
||||
<Text style={{ fontSize: 17, }}>{I18n.t("CHOOSE_LANGUAGE")}</Text>
|
||||
<Dropdown
|
||||
label={I18n.t("CHANGE_LANG_LABEL")}
|
||||
data={this.state.languages}
|
||||
onChangeText={(value, index, data) => {
|
||||
I18n.locale = value
|
||||
this.setState({ language: value })
|
||||
this.configuration.setCurrentLangue(data[index])
|
||||
IlinkEmitter.emit('langueChange')
|
||||
}}
|
||||
valueExtractor={(value) => value.value}
|
||||
labelExtractor={(value) => value.name}
|
||||
/>
|
||||
|
||||
</View>
|
||||
</View>);
|
||||
}
|
||||
</View>
|
||||
</View>);
|
||||
}
|
||||
}
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white',
|
||||
},
|
||||
|
||||
})
|
|
@ -123,7 +123,7 @@ export default class SuperViseurGroupeHome extends BaseScreen {
|
|||
}
|
||||
})
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,20 +4,17 @@ import {responsiveFontSize, responsiveWidth} from 'react-native-responsive-dimen
|
|||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
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'
|
||||
import 'moment/locale/en-gb'
|
||||
|
||||
import DeviceInfo from 'react-native-device-info'
|
||||
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';
|
||||
import {Color} from '../../config/Color';
|
||||
|
||||
var moment = require('moment-timezone')
|
||||
const momentJS = require('moment')
|
||||
let moment = require('moment-timezone');
|
||||
const momentJS = require('moment');
|
||||
|
||||
let route = require('./../../route.json');
|
||||
var theme = require('./../../utils/theme.json');
|
||||
|
@ -26,6 +23,9 @@ export class HistoryItem extends React.Component {
|
|||
|
||||
constructor(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();
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,6 @@ export class HistoryItem extends React.Component {
|
|||
var today = new Date();
|
||||
var l = this.props.selfData.date_creation;
|
||||
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();
|
||||
re = moment(re)
|
||||
return {
|
||||
|
@ -134,6 +132,8 @@ export class HistoryItemSectionned extends PureComponent {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = this.initState();
|
||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
|
||||
moment.locale(this.currentLocale);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -246,6 +246,8 @@ export class HistoryListItem extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = this.initState();
|
||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-us";
|
||||
moment.locale(this.currentLocale);
|
||||
}
|
||||
|
||||
initState() {
|
||||
|
|
|
@ -6,7 +6,6 @@ import {responsiveWidth} from 'react-native-responsive-dimensions'
|
|||
import Icons from 'react-native-vector-icons/Ionicons'
|
||||
import {readUser} from "../../webservice/AuthApi";
|
||||
import isNil from 'lodash/isNil';
|
||||
import I18n from "react-native-i18n";
|
||||
import {creditDemandResetReducer, treatCreditDemand} from '../../webservice/CreditTreatDemandApi';
|
||||
import {creditCancelResetReducer, treatCancelDemand} from '../../webservice/CreditCancelDemandeApi';
|
||||
import {getAgentNetworksList} from "../../webservice/NetworkApi";
|
||||
|
@ -16,11 +15,21 @@ import Toast from 'react-native-root-toast';
|
|||
import {Color} from '../../config/Color'
|
||||
import Dialog from "react-native-dialog";
|
||||
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 moment = require('moment-timezone')
|
||||
var colorback = 'white'
|
||||
|
||||
let theme = require('./../../utils/theme.json');
|
||||
|
@ -52,7 +61,10 @@ class HistoryItemDetails extends Component {
|
|||
} else {
|
||||
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 = ''
|
||||
if (this.item.status === '1') {
|
||||
typesta = 1
|
||||
|
@ -87,9 +99,6 @@ class HistoryItemDetails extends Component {
|
|||
this.setState({user: user, networks: networks.networks})
|
||||
});
|
||||
|
||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||
moment.locale(this.currentLocale);
|
||||
|
||||
}
|
||||
|
||||
isNormalInteger = (str) => {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -23,7 +23,7 @@ import {IlinkEmitter} from '../../utils/events';
|
|||
import {readUser} from '../../webservice/AuthApi';
|
||||
import {getEpargneInProgressAction, getEpargneInProgressReset} from '../../webservice/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 Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import thousands from "thousands";
|
||||
|
@ -195,16 +195,7 @@ class CasserEpargneUser extends Component {
|
|||
<View style={[styles.blockView, {borderBottomColor: Color.borderColor}]}>
|
||||
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||
<View style={{flex: 1}}>
|
||||
<Text style={[styles.body2]}>Type</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>
|
||||
<Text style={[styles.body2]}>{I18n.t('ID_SAVINGS')}</Text>
|
||||
</View>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<Text
|
||||
|
@ -289,7 +280,7 @@ class CasserEpargneUser extends Component {
|
|||
</View>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<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 style={{flexDirection: 'row', marginTop: 10}}>
|
||||
|
@ -378,7 +369,7 @@ class CasserEpargneUser extends Component {
|
|||
this.setState({displayModalHistory: true, historyItemDetail: item})
|
||||
}} 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}>
|
||||
|
||||
<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'}}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_NANO_CREDIT')}</Text>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_SAVINGS')}</Text>
|
||||
</View>
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,30 +1,19 @@
|
|||
|
||||
import React, { Component } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Alert,
|
||||
Platform,
|
||||
StyleSheet,
|
||||
AppState,
|
||||
FlatList,
|
||||
ProgressBarAndroid,
|
||||
TouchableOpacity,
|
||||
Text,
|
||||
View,
|
||||
Animated,
|
||||
StatusBar
|
||||
Animated,
|
||||
AppState,
|
||||
Platform,
|
||||
ProgressBarAndroid,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View
|
||||
} from 'react-native';
|
||||
import ActionButton from 'react-native-action-button';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import { responsiveFontSize, responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { HistoryListItem, HistoryItemSectionned } from '../history-request/HistoryItem';
|
||||
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 {responsiveFontSize, responsiveHeight, responsiveWidth} from 'react-native-responsive-dimensions';
|
||||
import {readUser} from "../../webservice/AuthApi";
|
||||
import 'moment';
|
||||
import 'moment/locale/fr'
|
||||
import 'moment/locale/es-us'
|
||||
|
@ -35,457 +24,469 @@ import 'moment/locale/en-il'
|
|||
import 'moment/locale/en-nz'
|
||||
import 'moment/locale/en-gb'
|
||||
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')
|
||||
import { primary, primaryDark, accent, purpleLight, primaryLight } from './../../utils/theme.json';
|
||||
import { PagerTabIndicator, PagerTitleIndicator, PagerDotIndicator } from 'react-native-best-viewpager'
|
||||
|
||||
var sortIcons;
|
||||
var sectionIcons;
|
||||
import I18n from 'react-native-i18n'
|
||||
|
||||
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 {
|
||||
|
||||
constructor(props) {
|
||||
super(props, true);
|
||||
this.state = {
|
||||
user: {},
|
||||
conserve: [],
|
||||
count: 0,
|
||||
translateAnim: new Animated.Value(0),
|
||||
visibleMenu: false,
|
||||
appState: AppState.currentState,
|
||||
filter: false,
|
||||
sortIcons: null,
|
||||
panelVisible: false,
|
||||
filder_disable: true,
|
||||
datestartformated: 'La date de debut',
|
||||
dateendformated: 'La date de fin',
|
||||
datestart: null,
|
||||
dateend: null,
|
||||
isLoaded: false,
|
||||
isSectionned: false,
|
||||
isDateTimePickerVisible: false,
|
||||
isDateEndTimePickerVisible: false,
|
||||
isDataSubmit: false,
|
||||
position: 0
|
||||
};
|
||||
readUser().then((user) => {
|
||||
this.setState({ user: user });
|
||||
this.props.getNanoCreditDemandsAction(user.id);
|
||||
});
|
||||
constructor(props) {
|
||||
super(props, true);
|
||||
this.state = {
|
||||
user: {},
|
||||
conserve: [],
|
||||
count: 0,
|
||||
translateAnim: new Animated.Value(0),
|
||||
visibleMenu: false,
|
||||
appState: AppState.currentState,
|
||||
filter: false,
|
||||
sortIcons: null,
|
||||
panelVisible: false,
|
||||
filder_disable: true,
|
||||
datestartformated: 'La date de debut',
|
||||
dateendformated: 'La date de fin',
|
||||
datestart: null,
|
||||
dateend: null,
|
||||
isLoaded: false,
|
||||
isSectionned: false,
|
||||
isDateTimePickerVisible: false,
|
||||
isDateEndTimePickerVisible: false,
|
||||
isDataSubmit: false,
|
||||
position: 0
|
||||
};
|
||||
readUser().then((user) => {
|
||||
this.setState({user: user});
|
||||
this.props.getNanoCreditDemandsAction(user.id);
|
||||
});
|
||||
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
|
||||
this.props.getNanoCreditDemandsReset();
|
||||
this.navigation = this.props.navigation
|
||||
this.currentLocale = DeviceInfo.getDeviceLocale().includes("fr") ? "fr" : "en-gb";
|
||||
//moment.locale(this.currentLocale);
|
||||
//IlinkEmitter.on('treatNanoGroupDemand', this.refreshData);
|
||||
};
|
||||
this.props.getNanoCreditDemandsReset();
|
||||
this.navigation = this.props.navigation
|
||||
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
|
||||
moment.locale(this.currentLocale);
|
||||
//IlinkEmitter.on('treatNanoGroupDemand', this.refreshData);
|
||||
};
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: primary,
|
||||
statusBarColor: primaryDark,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF',
|
||||
contextualMenuStatusBarColor: theme.accent,
|
||||
contextualMenuBackgroundColor: theme.accentLight,
|
||||
contextualMenuButtonsColor: '#ffffff'
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: primary,
|
||||
statusBarColor: primaryDark,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF',
|
||||
contextualMenuStatusBarColor: theme.accent,
|
||||
contextualMenuBackgroundColor: theme.accentLight,
|
||||
contextualMenuButtonsColor: '#ffffff'
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('WALLET') })
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { routeName } = this.navigation.state
|
||||
this.setState({
|
||||
position: routeName === "demandeValidationGroupe" ? 0
|
||||
: routeName === "myNanoCreditGroup" ? 1
|
||||
: 2
|
||||
});
|
||||
this.animateSlidingUp(false)
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({name: I18n.t('WALLET')})
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
}
|
||||
componentDidMount() {
|
||||
const {routeName} = this.navigation.state
|
||||
this.setState({
|
||||
position: routeName === "demandeValidationGroupe" ? 0
|
||||
: routeName === "myNanoCreditGroup" ? 1
|
||||
: 2
|
||||
});
|
||||
this.animateSlidingUp(false)
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.intervaller)
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.intervaller)
|
||||
}
|
||||
|
||||
|
||||
animateSlidingUp(state = false) {
|
||||
const height = responsiveHeight(100)
|
||||
let initialValue = !state ? 0 : height,
|
||||
finalValue = !state ? height : 0;
|
||||
animateSlidingUp(state = false) {
|
||||
const height = responsiveHeight(100)
|
||||
let initialValue = !state ? 0 : height,
|
||||
finalValue = !state ? height : 0;
|
||||
|
||||
this.setState({ isSliding: state })
|
||||
this.setState({isSliding: state})
|
||||
|
||||
this.state.translateAnim.setValue(initialValue); //Step 3
|
||||
Animated.timing( //Step 4
|
||||
this.state.translateAnim,
|
||||
{
|
||||
toValue: finalValue,
|
||||
duration: 500,
|
||||
useNativeDriver: true,
|
||||
}
|
||||
).start()
|
||||
}
|
||||
this.state.translateAnim.setValue(initialValue); //Step 3
|
||||
Animated.timing( //Step 4
|
||||
this.state.translateAnim,
|
||||
{
|
||||
toValue: finalValue,
|
||||
duration: 500,
|
||||
useNativeDriver: true,
|
||||
}
|
||||
).start()
|
||||
}
|
||||
|
||||
_openMenu = () => this.setState({ visibleMenu: true });
|
||||
_openMenu = () => this.setState({visibleMenu: true});
|
||||
|
||||
_closeMenu = () => this.setState({ visibleMenu: false });
|
||||
_closeMenu = () => this.setState({visibleMenu: false});
|
||||
|
||||
getDemandTypeIcon = (type) => {
|
||||
switch (type) {
|
||||
case 'creation': return 'account-multiple-plus';
|
||||
case 'suppression': return 'account-multiple-minus';
|
||||
case 'adhesion': return 'account-multiple-check'
|
||||
case 'nano_credit': return 'cash'
|
||||
default: return 'account-multiple'
|
||||
}
|
||||
}
|
||||
getDemandTypeIcon = (type) => {
|
||||
switch (type) {
|
||||
case 'creation':
|
||||
return 'account-multiple-plus';
|
||||
case 'suppression':
|
||||
return 'account-multiple-minus';
|
||||
case 'adhesion':
|
||||
return 'account-multiple-check'
|
||||
case 'nano_credit':
|
||||
return 'cash'
|
||||
default:
|
||||
return 'account-multiple'
|
||||
}
|
||||
}
|
||||
|
||||
getDemandTypeColor = (type) => {
|
||||
switch (type) {
|
||||
case 'creation': return 'green';
|
||||
case 'suppression': return 'red';
|
||||
case 'adhesion': return Color.primaryColor
|
||||
case 'nano_credit': return Color.primaryColor
|
||||
default:
|
||||
return Color.primaryColor
|
||||
}
|
||||
}
|
||||
getDemandTypeColor = (type) => {
|
||||
switch (type) {
|
||||
case 'creation':
|
||||
return 'green';
|
||||
case 'suppression':
|
||||
return 'red';
|
||||
case 'adhesion':
|
||||
return Color.primaryColor
|
||||
case 'nano_credit':
|
||||
return Color.primaryColor
|
||||
default:
|
||||
return Color.primaryColor
|
||||
}
|
||||
}
|
||||
|
||||
renderDemandItem = (item) => {
|
||||
let dateFormat = moment.tz(item.date_creation_demande, moment.tz.guess()).format();
|
||||
dateFormat = moment(dateFormat).fromNow();
|
||||
renderDemandItem = (item) => {
|
||||
let dateFormat = moment.tz(item.date_creation_demande, moment.tz.guess()).format();
|
||||
dateFormat = moment(dateFormat).fromNow();
|
||||
|
||||
return (
|
||||
<TouchableOpacity onPress={() => {
|
||||
this.props.navigation.push(route.demandGroupNanoCreditDetail, {
|
||||
id: item.id
|
||||
});
|
||||
}}
|
||||
style={[styles.paymentItem]}>
|
||||
return (
|
||||
<TouchableOpacity onPress={() => {
|
||||
this.props.navigation.push(route.demandGroupNanoCreditDetail, {
|
||||
id: item.id
|
||||
});
|
||||
}}
|
||||
style={[styles.paymentItem]}>
|
||||
|
||||
<View style={{ flexDirection: 'row', alignItems: 'center', }}>
|
||||
<View style={styles.iconContent}>
|
||||
<View style={{flexDirection: 'row', alignItems: 'center',}}>
|
||||
<View style={styles.iconContent}>
|
||||
|
||||
<Icon name={this.getDemandTypeIcon(item.type)} color={this.getDemandTypeColor(item.type)} size={35} />
|
||||
</View>
|
||||
<Icon name={this.getDemandTypeIcon(item.type)} color={this.getDemandTypeColor(item.type)}
|
||||
size={35}/>
|
||||
</View>
|
||||
<View style={styles.content}>
|
||||
</View>
|
||||
<View style={styles.content}>
|
||||
|
||||
<Text style={styles.title}>{item.nom}</Text>
|
||||
<Text style={styles.title}>{item.nom}</Text>
|
||||
|
||||
<Text style={styles.description}>{`${I18n.t('CREATOR')}: ${item.createur}`}</Text>
|
||||
<Text style={styles.description}>{`${I18n.t('CREATOR')}: ${item.createur}`}</Text>
|
||||
|
||||
{/* <Text style={styles.description}>{`Sponsor 1: ${item.sponsor1}`}</Text>
|
||||
{/* <Text style={styles.description}>{`Sponsor 1: ${item.sponsor1}`}</Text>
|
||||
|
||||
<Text style={styles.description}>{`Sponsor 2: ${item.sponsor2}`}</Text>
|
||||
|
||||
<Text style={styles.description}>{`Sponsor 3: ${item.sponsor3}`}</Text> */}
|
||||
|
||||
<View style={styles.timeContent}>
|
||||
<View style={{ alignContent: 'flex-start', flex: 1, flexDirection: 'row' }}>
|
||||
<Text style={{
|
||||
fontWeight: 'bold',
|
||||
marginLeft: 20,
|
||||
marginBottom: 10,
|
||||
color: item.nombre_validation === 3 ? 'green' : 'red',
|
||||
}}>
|
||||
{item.nombre_validation === 3 ? I18n.t('VALIDATE') : I18n.t('NO_VALIDATE')}
|
||||
{` (${item.nombre_validation} ${item.nombre_validation > 1 ? I18n.t('VALIDATIONS') : I18n.t('VALIDATION')})`}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.timeContent}>
|
||||
<View style={{alignContent: 'flex-start', flex: 1, flexDirection: 'row'}}>
|
||||
<Text style={{
|
||||
fontWeight: 'bold',
|
||||
marginLeft: 20,
|
||||
marginBottom: 10,
|
||||
color: item.nombre_validation === 3 ? 'green' : 'red',
|
||||
}}>
|
||||
{item.nombre_validation === 3 ? I18n.t('VALIDATE') : I18n.t('NO_VALIDATE')}
|
||||
{` (${item.nombre_validation} ${item.nombre_validation > 1 ? I18n.t('VALIDATIONS') : I18n.t('VALIDATION')})`}
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<View style={{ alignContent: 'flex-end', flex: 1, flexDirection: 'row' }}>
|
||||
<Icon name="map-marker" style={[styles.descriptionIcon], { color: Color.accentColor, marginTop: 5 }} />
|
||||
<Text style={styles.time}>{item.country}</Text>
|
||||
<View style={{alignContent: 'flex-end', flex: 1, flexDirection: 'row'}}>
|
||||
<Icon name="map-marker"
|
||||
style={[styles.descriptionIcon], {color: Color.accentColor, marginTop: 5}}/>
|
||||
<Text style={styles.time}>{item.country}</Text>
|
||||
|
||||
<Icon name="clock" style={[styles.descriptionIcon], { color: Color.accentColor, marginTop: 5 }} />
|
||||
<Text style={styles.time}> {dateFormat}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
<Icon name="clock"
|
||||
style={[styles.descriptionIcon], {color: Color.accentColor, marginTop: 5}}/>
|
||||
<Text style={styles.time}> {dateFormat}</Text>
|
||||
</View>
|
||||
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
|
||||
rendeGetDemandsGroupResponse = () => {
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
|
||||
const { resultGetDemandsGroup, errorGetDemandsGroup } = this.props;
|
||||
rendeGetDemandsGroupResponse = () => {
|
||||
|
||||
if (errorGetDemandsGroup !== null) {
|
||||
if (typeof errorGetDemandsGroup.data !== 'undefined') {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={Typography.body1}>{errorGetDemandsGroup.data.error}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
else {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={Typography.body1}>{errorGetDemandsGroup}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
const {resultGetDemandsGroup, errorGetDemandsGroup} = this.props;
|
||||
|
||||
if (resultGetDemandsGroup !== null) {
|
||||
if (resultGetDemandsGroup.response !== null) {
|
||||
return (
|
||||
Array.isArray(resultGetDemandsGroup.response) && (resultGetDemandsGroup.response.length) > 0 ?
|
||||
(<ScrollView style={{ flex: 1 }}>
|
||||
{
|
||||
resultGetDemandsGroup.response.map((item) => (
|
||||
this.renderDemandItem(item)
|
||||
))
|
||||
}
|
||||
</ScrollView>) :
|
||||
(
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_DEMAND_CREATION_GROUP')}</Text>
|
||||
</View>
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||
{Platform.OS === 'android'
|
||||
?
|
||||
(
|
||||
<>
|
||||
<ProgressBarAndroid />
|
||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||
|
||||
</>
|
||||
) :
|
||||
<>
|
||||
<ActivityIndicator size="large" color={'#ccc'} />
|
||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||
</>
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
printOptions() {
|
||||
return (<ActionButton buttonColor={accent}>
|
||||
<ActionButton.Item buttonColor={primary} title={I18n.t('CREATE_GROUP')}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.createGroupNanoCredit);
|
||||
}}
|
||||
>
|
||||
<Icon name="account-multiple-plus" style={styles.actionButtonIcon} />
|
||||
</ActionButton.Item>
|
||||
<ActionButton.Item buttonColor={purpleLight} title={I18n.t('JOIN_GROUP')}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.adhererGroupNanoCredit);
|
||||
}}
|
||||
>
|
||||
<Icon name="account-multiple" style={styles.actionButtonIcon} />
|
||||
</ActionButton.Item>
|
||||
</ActionButton>)
|
||||
}
|
||||
|
||||
refreshData() {
|
||||
this.props.getNanoCreditDemandsAction(this.state.user.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
console.warn("POSITION", this.state.position);
|
||||
return (
|
||||
<Provider>
|
||||
<View style={{ flex: 1 }}
|
||||
>
|
||||
<StatusBar
|
||||
backgroundColor={theme.primaryDark}
|
||||
barStyle="light-content"
|
||||
translucent={false}
|
||||
/>
|
||||
|
||||
<Appbar.Header dark={true} style={{ backgroundColor: theme.primary }}>
|
||||
<Appbar.BackAction
|
||||
onPress={() => { this.props.navigation.pop() }}
|
||||
/>
|
||||
<Appbar.Content
|
||||
title={I18n.t('MANAGE_GROUP')}
|
||||
subtitle={this.state.position === 0 ? I18n.t('VALIDATION_DEMAND') : I18n.t('DELETE_DEMAND')}
|
||||
/>
|
||||
<Appbar.Action icon="refresh" onPress={() => { this.refreshData() }} />
|
||||
{/* <Appbar.Action icon="more-vert" onPress={() => { this._openMenu(); this.renderSliding(); }} /> */}
|
||||
</Appbar.Header>
|
||||
|
||||
{this.state.position === 0 ?
|
||||
this.props.loadingGetDemandsGroup ?
|
||||
this.renderLoader() :
|
||||
this.rendeGetDemandsGroupResponse()
|
||||
: null}
|
||||
{this.state.position === 0 && this.printOptions()}
|
||||
if (errorGetDemandsGroup !== null) {
|
||||
if (typeof errorGetDemandsGroup.data !== 'undefined') {
|
||||
return (
|
||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={Typography.body1}>{errorGetDemandsGroup.data.error}</Text>
|
||||
</View>
|
||||
</Provider>
|
||||
);
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={Typography.body1}>{errorGetDemandsGroup}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (resultGetDemandsGroup !== null) {
|
||||
if (resultGetDemandsGroup.response !== null) {
|
||||
return (
|
||||
Array.isArray(resultGetDemandsGroup.response) && (resultGetDemandsGroup.response.length) > 0 ?
|
||||
(<ScrollView style={{flex: 1}}>
|
||||
{
|
||||
resultGetDemandsGroup.response.map((item) => (
|
||||
this.renderDemandItem(item)
|
||||
))
|
||||
}
|
||||
</ScrollView>) :
|
||||
(
|
||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_DEMAND_CREATION_GROUP')}</Text>
|
||||
</View>
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||
{Platform.OS === 'android'
|
||||
?
|
||||
(
|
||||
<>
|
||||
<ProgressBarAndroid/>
|
||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||
|
||||
</>
|
||||
) :
|
||||
<>
|
||||
<ActivityIndicator size="large" color={'#ccc'}/>
|
||||
<Text>{I18n.t('LOADING_DOTS')}</Text>
|
||||
</>
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
printOptions() {
|
||||
return (<ActionButton buttonColor={accent}>
|
||||
<ActionButton.Item buttonColor={primary} title={I18n.t('CREATE_GROUP')}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.createGroupNanoCredit);
|
||||
}}
|
||||
>
|
||||
<Icon name="account-multiple-plus" style={styles.actionButtonIcon}/>
|
||||
</ActionButton.Item>
|
||||
<ActionButton.Item buttonColor={purpleLight} title={I18n.t('JOIN_GROUP')}
|
||||
onPress={() => {
|
||||
this.props.navigation.push(route.adhererGroupNanoCredit);
|
||||
}}
|
||||
>
|
||||
<Icon name="account-multiple" style={styles.actionButtonIcon}/>
|
||||
</ActionButton.Item>
|
||||
</ActionButton>)
|
||||
}
|
||||
|
||||
refreshData() {
|
||||
this.props.getNanoCreditDemandsAction(this.state.user.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
console.warn("POSITION", this.state.position);
|
||||
return (
|
||||
<Provider>
|
||||
<View style={{flex: 1}}
|
||||
>
|
||||
<StatusBar
|
||||
backgroundColor={theme.primaryDark}
|
||||
barStyle="light-content"
|
||||
translucent={false}
|
||||
/>
|
||||
|
||||
<Appbar.Header dark={true} style={{backgroundColor: theme.primary}}>
|
||||
<Appbar.BackAction
|
||||
onPress={() => {
|
||||
this.props.navigation.pop()
|
||||
}}
|
||||
/>
|
||||
<Appbar.Content
|
||||
title={I18n.t('MANAGE_GROUP')}
|
||||
subtitle={this.state.position === 0 ? I18n.t('VALIDATION_DEMAND') : I18n.t('DELETE_DEMAND')}
|
||||
/>
|
||||
<Appbar.Action icon="refresh" onPress={() => {
|
||||
this.refreshData()
|
||||
}}/>
|
||||
{/* <Appbar.Action icon="more-vert" onPress={() => { this._openMenu(); this.renderSliding(); }} /> */}
|
||||
</Appbar.Header>
|
||||
|
||||
{this.state.position === 0 ?
|
||||
this.props.loadingGetDemandsGroup ?
|
||||
this.renderLoader() :
|
||||
this.rendeGetDemandsGroupResponse()
|
||||
: null}
|
||||
{this.state.position === 0 && this.printOptions()}
|
||||
</View>
|
||||
</Provider>
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
loadingGetDemandsGroup: state.getDemandsGroupReducer.loading,
|
||||
resultGetDemandsGroup: state.getDemandsGroupReducer.result,
|
||||
errorGetDemandsGroup: state.getDemandsGroupReducer.error,
|
||||
loadingGetDemandsGroup: state.getDemandsGroupReducer.loading,
|
||||
resultGetDemandsGroup: state.getDemandsGroupReducer.result,
|
||||
errorGetDemandsGroup: state.getDemandsGroupReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getNanoCreditDemandsAction: getNanoCreditDemandsAction,
|
||||
getNanoCreditDemandsReset: getNanoCreditDemandsReset
|
||||
getNanoCreditDemandsAction: getNanoCreditDemandsAction,
|
||||
getNanoCreditDemandsReset: getNanoCreditDemandsReset
|
||||
}, dispatch);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DemandValidationGroup);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
slidingup: {
|
||||
position: "absolute",
|
||||
height: responsiveHeight(84),
|
||||
bottom: 0,
|
||||
backgroundColor: 'white',
|
||||
width: responsiveWidth(100),
|
||||
zIndex: 1000
|
||||
},
|
||||
root: {
|
||||
flex: 1,
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
emptylist: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
},
|
||||
backgroundd_drawer: {
|
||||
backgroundColor: '#000',
|
||||
},
|
||||
listbackground: {
|
||||
},
|
||||
actionButtonIcon: {
|
||||
fontSize: 20,
|
||||
height: 22,
|
||||
color: 'white',
|
||||
},
|
||||
descriptionIcon: {
|
||||
fontSize: 10,
|
||||
height: 12,
|
||||
top: 10
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
dateText: {
|
||||
marginTop: 20,
|
||||
marginLeft: responsiveWidth(13),
|
||||
marginBottom: 20,
|
||||
fontSize: 17,
|
||||
},
|
||||
titlecontent: {
|
||||
fontSize: 17,
|
||||
marginLeft: responsiveWidth(10),
|
||||
slidingup: {
|
||||
position: "absolute",
|
||||
height: responsiveHeight(84),
|
||||
bottom: 0,
|
||||
backgroundColor: 'white',
|
||||
width: responsiveWidth(100),
|
||||
zIndex: 1000
|
||||
},
|
||||
root: {
|
||||
flex: 1,
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: 'white',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
emptylist: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
},
|
||||
backgroundd_drawer: {
|
||||
backgroundColor: '#000',
|
||||
},
|
||||
listbackground: {},
|
||||
actionButtonIcon: {
|
||||
fontSize: 20,
|
||||
height: 22,
|
||||
color: 'white',
|
||||
},
|
||||
descriptionIcon: {
|
||||
fontSize: 10,
|
||||
height: 12,
|
||||
top: 10
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
dateText: {
|
||||
marginTop: 20,
|
||||
marginLeft: responsiveWidth(13),
|
||||
marginBottom: 20,
|
||||
fontSize: 17,
|
||||
},
|
||||
titlecontent: {
|
||||
fontSize: 17,
|
||||
marginLeft: responsiveWidth(10),
|
||||
|
||||
color: 'black'
|
||||
},
|
||||
title: {
|
||||
fontSize: 20,
|
||||
marginLeft: 20,
|
||||
marginTop: 20,
|
||||
color: 'black',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
content: {
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
paddingTop: 10,
|
||||
color: 'black'
|
||||
},
|
||||
title: {
|
||||
fontSize: 20,
|
||||
marginLeft: 20,
|
||||
marginTop: 20,
|
||||
color: 'black',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
content: {
|
||||
flex: 1,
|
||||
flexDirection: 'column',
|
||||
paddingTop: 10,
|
||||
|
||||
},
|
||||
listStyle: {
|
||||
backgroundColor: 'white'
|
||||
},
|
||||
bottomSeparator: {
|
||||
width: responsiveWidth(100),
|
||||
height: 5,
|
||||
justifyContent: 'center',
|
||||
alignSelf: 'center',
|
||||
backgroundColor: '#EEE',
|
||||
},
|
||||
title: {
|
||||
color: '#000',
|
||||
paddingLeft: 10,
|
||||
fontSize: responsiveFontSize(2.2)
|
||||
},
|
||||
description: {
|
||||
fontSize: responsiveFontSize(1.8),
|
||||
color: '#4f5b62',
|
||||
paddingLeft: 10,
|
||||
},
|
||||
listStyle: {
|
||||
backgroundColor: 'white'
|
||||
},
|
||||
bottomSeparator: {
|
||||
width: responsiveWidth(100),
|
||||
height: 5,
|
||||
justifyContent: 'center',
|
||||
alignSelf: 'center',
|
||||
backgroundColor: '#EEE',
|
||||
},
|
||||
title: {
|
||||
color: '#000',
|
||||
paddingLeft: 10,
|
||||
fontSize: responsiveFontSize(2.2)
|
||||
},
|
||||
description: {
|
||||
fontSize: responsiveFontSize(1.8),
|
||||
color: '#4f5b62',
|
||||
paddingLeft: 10,
|
||||
|
||||
},
|
||||
timeContent: {
|
||||
justifyContent: 'space-between',
|
||||
flex: 1,
|
||||
marginTop: 10,
|
||||
marginBottom: 5,
|
||||
flexDirection: 'row',
|
||||
},
|
||||
time: {
|
||||
fontWeight: 'bold',
|
||||
marginRight: 20,
|
||||
marginBottom: 10,
|
||||
color: theme.accent,
|
||||
},
|
||||
paymentItem: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
width: "100%",
|
||||
borderBottomColor: '#EEE',
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
iconContent: {
|
||||
width: 40,
|
||||
marginRight: 5,
|
||||
alignItems: "center"
|
||||
}
|
||||
},
|
||||
timeContent: {
|
||||
justifyContent: 'space-between',
|
||||
flex: 1,
|
||||
marginTop: 10,
|
||||
marginBottom: 5,
|
||||
flexDirection: 'row',
|
||||
},
|
||||
time: {
|
||||
fontWeight: 'bold',
|
||||
marginRight: 20,
|
||||
marginBottom: 10,
|
||||
color: theme.accent,
|
||||
},
|
||||
paymentItem: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
width: "100%",
|
||||
borderBottomColor: '#EEE',
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
iconContent: {
|
||||
width: 40,
|
||||
marginRight: 5,
|
||||
alignItems: "center"
|
||||
}
|
||||
});
|
||||
|
|
|
@ -75,7 +75,7 @@ class DemandGroupNanoCreditDetail extends Component {
|
|||
isBtnModifyAmountEnabled: false,
|
||||
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);
|
||||
|
||||
this.props.getNanoCreditUniqueDemandsReset();
|
||||
|
|
|
@ -82,7 +82,7 @@ class MyNanoCreditGroup extends Component {
|
|||
isBtnModifyAmountEnabled: false,
|
||||
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);
|
||||
|
||||
this.props.createGroupReset();
|
||||
|
|
|
@ -52,7 +52,7 @@ class Notifications extends BaseScreen {
|
|||
|
||||
constructor(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);
|
||||
|
||||
}
|
||||
|
|
|
@ -93,11 +93,11 @@ class OperateurOptionSelect extends Component {
|
|||
|
||||
redirectToRoute = (item) => {
|
||||
|
||||
console.log("Redirection");
|
||||
console.log("Item selected", item);
|
||||
if (this.state.options.length > 0) {
|
||||
|
||||
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
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -53,7 +53,7 @@ export default class PaiementFacture extends Component {
|
|||
return I18n.t('IDENTIFIANT_ETUDIANT')
|
||||
case 'PAIEMENT_EAU':
|
||||
return I18n.t('NUMERO_ABONNE')
|
||||
case 'PAIEMENT_ELECTRICITE':
|
||||
case 'PAIEMENT_EAU_ELECTRICITE':
|
||||
return I18n.t('NUMERO_ABONNE')
|
||||
case 'PAIEMENT_CREDIT_TELEPHONE':
|
||||
return I18n.t('PHONE_NUMBER')
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -94,7 +94,7 @@ class WalletDetailUser extends Component {
|
|||
|
||||
this.heightImageBanner = Utils.scaleWithPixel(250, 1);
|
||||
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);
|
||||
IlinkEmitter.on("langueChange", this.updateLangue.bind(this));
|
||||
IlinkEmitter.on("refreshWallet", this.refresh);
|
||||
|
|
|
@ -448,7 +448,7 @@ class WalletOptionSelect extends Component {
|
|||
{
|
||||
|
||||
!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}>
|
||||
|
||||
<Text style={[Typography.overline, Color.grayColor], {marginTop: 4}}>
|
||||
|
@ -463,7 +463,7 @@ class WalletOptionSelect extends Component {
|
|||
</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}>
|
||||
|
||||
<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>
|
||||
</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={{flex: 1}}>
|
||||
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
|
||||
|
@ -636,11 +645,11 @@ class WalletOptionSelect extends Component {
|
|||
</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}}>
|
||||
|
@ -679,6 +688,15 @@ class WalletOptionSelect extends Component {
|
|||
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}}>
|
||||
<View style={{flex: 1}}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text>
|
||||
|
@ -712,7 +730,7 @@ class WalletOptionSelect extends Component {
|
|||
</View>
|
||||
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||
<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 style={{flexDirection: 'row', marginTop: 10}}>
|
||||
|
|
|
@ -373,11 +373,7 @@ export const optionRetraitUserScreen = {
|
|||
screen: '',
|
||||
icon: 'credit-card',
|
||||
title: 'WITHDRAWAL_BANK_TO_WALLET',
|
||||
}, {
|
||||
screen: '',
|
||||
icon: 'credit-card',
|
||||
title: 'WITHDRAWAL_BANK_TO_CASH',
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
@ -161,6 +161,7 @@
|
|||
"NANO_CREDIT_LIST": "Nano credit list",
|
||||
"SAVINGS_LIST": "Savings list",
|
||||
"NO_NANO_CREDIT": "No nano credit demand",
|
||||
"NO_SAVINGS": "No savings",
|
||||
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
|
||||
"NANO_SANTE": "Nano health",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
|
@ -173,8 +174,10 @@
|
|||
"CAUTION_CREDIT": "Caution credit demand",
|
||||
"CAUTIONNEMENT_DONE": "Caution done",
|
||||
"ID_DEMAND": "Demand ID",
|
||||
"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",
|
||||
|
|
|
@ -168,6 +168,7 @@
|
|||
"NANO_CREDIT_LIST": "Liste des nano crédit",
|
||||
"SAVINGS_LIST": "Liste des épargnes",
|
||||
"NO_NANO_CREDIT": "Aucune demande de nano crédit",
|
||||
"NO_SAVINGS": "Aucune épargne",
|
||||
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
|
||||
"NANO_SANTE": "Nano santé",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
|
@ -180,11 +181,13 @@
|
|||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||
"CAUTIONNEMENT_DONE": "Cautionnement effectué",
|
||||
"ID_DEMAND": "Identifiant de la demande",
|
||||
"ID_SAVINGS": "Identifiant de l'épargne",
|
||||
"PAIEMENT_EAU": "Paiement eau",
|
||||
"PAIEMENT_ELECTRICITY": "Paiement électricité",
|
||||
"PAIEMENT_ECOLE": "Paiement école",
|
||||
"PAIEMENT_CREDIT_TELEPHONIQUE": "Paiement crédit téléphonique",
|
||||
"PAIEMENT_ABONNEMENT_TV": "Paiement abonnement TV",
|
||||
"NON_APPLICABLE": "Non applicable",
|
||||
"DATE": "Date",
|
||||
"DEMAND_DATE": "Date de la demande",
|
||||
"DATE_REMBOURSEMENT_PREVU": "Date de remboursement prévu",
|
||||
|
@ -218,8 +221,8 @@
|
|||
"DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de",
|
||||
"NO_WALLET_HISTORY": "Aucune transaction à ce jour",
|
||||
"DEMAND_SEND": "Demande envoyé",
|
||||
"EPARGNE_DEPOSE": "Epargne déposé",
|
||||
"BREAK_EPARGNE_DONE": "Epargne cassé avec succès",
|
||||
"EPARGNE_DEPOSE": "Epargne déposée",
|
||||
"BREAK_EPARGNE_DONE": "Epargne cassée avec succès",
|
||||
"BREAK_EPARGNE": "Casser mon épargne",
|
||||
"ID_EPARGNE": "Identifiant de l'épargne",
|
||||
"NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe",
|
||||
|
|
|
@ -69,6 +69,7 @@ export const getNanoCreditAccount = testBaseUrl + '/walletService/groups/nanoCre
|
|||
export const getNanoCreditUserHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/all_demands';
|
||||
export const getNanoCreditAgentHistoryUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee_demands';
|
||||
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 getHistoryNanoPendingCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/demands_in_progress';
|
||||
export const getHistoryEpargnePendingUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/demands_in_progress';
|
||||
|
|
|
@ -1,104 +1,109 @@
|
|||
import { db } from './db';
|
||||
import { AsyncStorage } from 'react-native';
|
||||
import {db} from './db';
|
||||
import {AsyncStorage} from 'react-native';
|
||||
|
||||
export default class Configuration {
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
async getCurrentLangue() {
|
||||
const da = await _getData()
|
||||
if (da) resolve(da)
|
||||
else reject(da)
|
||||
}
|
||||
}
|
||||
|
||||
async getCurrentPasValue() {
|
||||
const pasObject = await this._getPasData()
|
||||
if (pasObject) {
|
||||
return pasObject.valeur_int;
|
||||
} else return pasObject;
|
||||
}
|
||||
async getCurrentLangue() {
|
||||
const da = await _getData()
|
||||
if (da) resolve(da)
|
||||
else reject(da)
|
||||
}
|
||||
|
||||
async getCurrentPubValue() {
|
||||
const pasObject = await this._getPubData()
|
||||
console.warn(pasObject)
|
||||
if (pasObject) {
|
||||
return pasObject.valeur_bool;
|
||||
} else return pasObject;
|
||||
}
|
||||
async setPubActive(data) {
|
||||
try {
|
||||
if (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) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
async getCurrentPasValue() {
|
||||
const pasObject = await this._getPasData()
|
||||
if (pasObject) {
|
||||
return pasObject.valeur_int;
|
||||
} else return pasObject;
|
||||
}
|
||||
|
||||
}
|
||||
_getPubData() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
async getCurrentPubValue() {
|
||||
const pasObject = await this._getPubData()
|
||||
console.warn(pasObject)
|
||||
if (pasObject) {
|
||||
return pasObject.valeur_bool;
|
||||
} else return pasObject;
|
||||
}
|
||||
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('pubObject')
|
||||
resolve(JSON.parse(ty))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
async setPubActive(data) {
|
||||
try {
|
||||
if (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) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
setCurrentLangue(lang) {
|
||||
this._storeData(lang)
|
||||
db.update({ "configuration.lang": { $exists: true } }, { configuration: { lang: lang } }, { upsert: true }, (err, num, upsert) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
setCurrentPas = async (pas) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:pasObject', JSON.stringify(pas.pas));
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
db.update({ "configuration.pas": { $exists: true } }, { configuration: { pas: pas.pas } }, { upsert: true }, (err, num, upsert) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
_getPasData = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
_getPubData() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('@config:pasObject')
|
||||
resolve(JSON.parse(ty))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('pubObject')
|
||||
resolve(JSON.parse(ty))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
_storeData = async (lang) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:lang', lang.value);
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
};
|
||||
_getData = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('@config:lang')
|
||||
resolve(ty)
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
setCurrentLangue(lang) {
|
||||
this._storeData(lang)
|
||||
db.update({"configuration.lang": {$exists: true}}, {configuration: {lang: lang}}, {upsert: true}, (err, num, upsert) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
setCurrentPas = async (pas) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:pasObject', JSON.stringify(pas.pas));
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
db.update({"configuration.pas": {$exists: true}}, {configuration: {pas: pas.pas}}, {upsert: true}, (err, num, upsert) => {
|
||||
console.log([err, num, upsert])
|
||||
})
|
||||
}
|
||||
_getPasData = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
})
|
||||
}
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('@config:pasObject')
|
||||
resolve(JSON.parse(ty))
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
_storeData = async (lang) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('@config:lang', lang.value);
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
};
|
||||
_getData = () => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
try {
|
||||
const ty = await AsyncStorage.getItem('@config:lang')
|
||||
resolve(ty)
|
||||
} catch (err) {
|
||||
reject(err)
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue