somethings is ok
This commit is contained in:
parent
5215f637fe
commit
5e0d806967
4
App.js
4
App.js
|
@ -78,6 +78,7 @@ import DemandValidationGroup from './screens/nano-credit/DemandGroupNanoCredit';
|
||||||
import DemandGroupNanoCreditDetail from './screens/nano-credit/DemandGroupNanoCreditDetail';
|
import DemandGroupNanoCreditDetail from './screens/nano-credit/DemandGroupNanoCreditDetail';
|
||||||
import NavigationService from './utils/NavigationService';
|
import NavigationService from './utils/NavigationService';
|
||||||
import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit';
|
import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit';
|
||||||
|
import MyNanoCreditGroup from './screens/nano-credit/MyNanoCreditGroup';
|
||||||
|
|
||||||
const instructions = Platform.select({
|
const instructions = Platform.select({
|
||||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||||
|
@ -134,7 +135,8 @@ const AppStack = createDrawerNavigator({
|
||||||
groupNanoCredit: {
|
groupNanoCredit: {
|
||||||
screen: createBottomTabNavigator({
|
screen: createBottomTabNavigator({
|
||||||
demandeValidationGroupe: DemandValidationGroup,
|
demandeValidationGroupe: DemandValidationGroup,
|
||||||
OthersDemand: MyHistory
|
myNanoCreditGroup: MyNanoCreditGroup,
|
||||||
|
OthersDemand: UserAccount
|
||||||
}, {
|
}, {
|
||||||
headerMode: "none",
|
headerMode: "none",
|
||||||
header: null,
|
header: null,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -103,6 +103,7 @@
|
||||||
"FEES_AND_TAXES": "Fees and taxes",
|
"FEES_AND_TAXES": "Fees and taxes",
|
||||||
"SUCCESS_CREATION_GROUP": "Creation information",
|
"SUCCESS_CREATION_GROUP": "Creation information",
|
||||||
"ERROR_CREATION_GROUP": "Creation error",
|
"ERROR_CREATION_GROUP": "Creation error",
|
||||||
|
"ERROR_JOIN_GROUP": "Join error",
|
||||||
"CREATE_GROUP": "Create group",
|
"CREATE_GROUP": "Create group",
|
||||||
"MANAGE_GROUP": "Manage group",
|
"MANAGE_GROUP": "Manage group",
|
||||||
"VALIDATION_DEMAND": "Validation request",
|
"VALIDATION_DEMAND": "Validation request",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { CREATE_GROUP_PENDING, CREATE_GROUP_SUCCESS, CREATE_GROUP_ERROR, CREATE_GROUP_RESET, GET_DEMAND_GROUP_PENDING, GET_DEMAND_GROUP_SUCCESS, GET_DEMAND_GROUP_ERROR, GET_DEMAND_GROUP_RESET, GET_UNIQUE_DEMAND_GROUP_PENDING, GET_UNIQUE_DEMAND_GROUP_RESET, GET_UNIQUE_DEMAND_GROUP_ERROR, GET_UNIQUE_DEMAND_GROUP_SUCCESS, TREAT_DEMAND_GROUP_PENDING, TREAT_DEMAND_GROUP_SUCCESS, TREAT_DEMAND_GROUP_ERROR, TREAT_DEMAND_GROUP_RESET, JOIN_GROUP_PENDING, JOIN_GROUP_SUCCESS, JOIN_GROUP_RESET, JOIN_GROUP_ERROR } from "../types/NanoCreditType";
|
import { CREATE_GROUP_PENDING, CREATE_GROUP_SUCCESS, CREATE_GROUP_ERROR, CREATE_GROUP_RESET, GET_DEMAND_GROUP_PENDING, GET_DEMAND_GROUP_SUCCESS, GET_DEMAND_GROUP_ERROR, GET_DEMAND_GROUP_RESET, GET_UNIQUE_DEMAND_GROUP_PENDING, GET_UNIQUE_DEMAND_GROUP_RESET, GET_UNIQUE_DEMAND_GROUP_ERROR, GET_UNIQUE_DEMAND_GROUP_SUCCESS, TREAT_DEMAND_GROUP_PENDING, TREAT_DEMAND_GROUP_SUCCESS, TREAT_DEMAND_GROUP_ERROR, TREAT_DEMAND_GROUP_RESET, JOIN_GROUP_PENDING, JOIN_GROUP_SUCCESS, JOIN_GROUP_RESET, JOIN_GROUP_ERROR, GET_USER_GROUP_DETAIL_PENDING, GET_USER_GROUP_DETAIL_SUCCESS, GET_USER_GROUP_DETAIL_RESET } from "../types/NanoCreditType";
|
||||||
|
|
||||||
export const fetchCreateGroupPending = () => ({
|
export const fetchCreateGroupPending = () => ({
|
||||||
type: CREATE_GROUP_PENDING
|
type: CREATE_GROUP_PENDING
|
||||||
|
@ -90,3 +90,22 @@ export const fetchJoinGroupError = (error) => ({
|
||||||
export const fetchJoinGroupReset = () => ({
|
export const fetchJoinGroupReset = () => ({
|
||||||
type: JOIN_GROUP_RESET
|
type: JOIN_GROUP_RESET
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
export const fetchGetUserGroupDetailPending = () => ({
|
||||||
|
type: GET_USER_GROUP_DETAIL_PENDING
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetUserGroupDetailSuccess = (res) => ({
|
||||||
|
type: GET_USER_GROUP_DETAIL_SUCCESS,
|
||||||
|
result: res,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetUserGroupDetailError = (error) => ({
|
||||||
|
type: GET_USER_GROUP_DETAIL_ERROR,
|
||||||
|
result: error
|
||||||
|
});
|
||||||
|
|
||||||
|
export const fetchGetUserGroupDetailReset = () => ({
|
||||||
|
type: GET_USER_GROUP_DETAIL_RESET
|
||||||
|
});
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { GET_USER_GROUP_DETAIL_PENDING, GET_USER_GROUP_DETAIL_SUCCESS, GET_USER_GROUP_DETAIL_ERROR, GET_USER_GROUP_DETAIL_RESET } from "../types/NanoCreditType";
|
||||||
|
|
||||||
|
const initialState = {
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: null
|
||||||
|
};
|
||||||
|
|
||||||
|
export default (state = initialState, action) => {
|
||||||
|
switch (action.type) {
|
||||||
|
case GET_USER_GROUP_DETAIL_PENDING: return {
|
||||||
|
...state,
|
||||||
|
loading: true
|
||||||
|
}
|
||||||
|
case GET_USER_GROUP_DETAIL_SUCCESS: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: action.result.data,
|
||||||
|
error: null
|
||||||
|
}
|
||||||
|
case GET_USER_GROUP_DETAIL_ERROR: return {
|
||||||
|
...state,
|
||||||
|
loading: false,
|
||||||
|
result: null,
|
||||||
|
error: action.result
|
||||||
|
}
|
||||||
|
case GET_USER_GROUP_DETAIL_RESET: return initialState;
|
||||||
|
|
||||||
|
default: {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -30,6 +30,7 @@ import GetDemandsGroupReducer from "./GetDemandsGroupReducer";
|
||||||
import GetUniqueDemandsGroupReducer from "./GetUniqueDemandsGroupReducer";
|
import GetUniqueDemandsGroupReducer from "./GetUniqueDemandsGroupReducer";
|
||||||
import TreatDemandGroupReducer from "./TreatDemandGroupReducer";
|
import TreatDemandGroupReducer from "./TreatDemandGroupReducer";
|
||||||
import JoinGroupReducer from "./JoinGroupReducer";
|
import JoinGroupReducer from "./JoinGroupReducer";
|
||||||
|
import GetUserGroupDetailReducer from "./GetUserGroupDetailReducer";
|
||||||
|
|
||||||
const persistConfig = {
|
const persistConfig = {
|
||||||
key: 'root',
|
key: 'root',
|
||||||
|
@ -69,7 +70,8 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
||||||
getDemandsGroupReducer: GetDemandsGroupReducer,
|
getDemandsGroupReducer: GetDemandsGroupReducer,
|
||||||
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
|
getUniqueDemandsGroupReducer: GetUniqueDemandsGroupReducer,
|
||||||
treatDemandGroupReducer: TreatDemandGroupReducer,
|
treatDemandGroupReducer: TreatDemandGroupReducer,
|
||||||
joinGroupReducer: JoinGroupReducer
|
joinGroupReducer: JoinGroupReducer,
|
||||||
|
getUserGroupDetailReducer: GetUserGroupDetailReducer
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -22,3 +22,8 @@ export const JOIN_GROUP_PENDING = 'JOIN_GROUP_PENDING';
|
||||||
export const JOIN_GROUP_SUCCESS = 'JOIN_GROUP_SUCCESS';
|
export const JOIN_GROUP_SUCCESS = 'JOIN_GROUP_SUCCESS';
|
||||||
export const JOIN_GROUP_ERROR = 'JOIN_GROUP_ERROR';
|
export const JOIN_GROUP_ERROR = 'JOIN_GROUP_ERROR';
|
||||||
export const JOIN_GROUP_RESET = 'JOIN_GROUP_RESET';
|
export const JOIN_GROUP_RESET = 'JOIN_GROUP_RESET';
|
||||||
|
|
||||||
|
export const GET_USER_GROUP_DETAIL_PENDING = 'GET_USER_GROUP_DETAIL_PENDING';
|
||||||
|
export const GET_USER_GROUP_DETAIL_SUCCESS = 'GET_USER_GROUP_DETAIL_SUCCESS';
|
||||||
|
export const GET_USER_GROUP_DETAIL_ERROR = 'GET_USER_GROUP_DETAIL_ERROR';
|
||||||
|
export const GET_USER_GROUP_DETAIL_RESET = 'GET_USER_GROUP_DETAIL_RESET';
|
||||||
|
|
|
@ -56,5 +56,6 @@
|
||||||
"createGroupNanoCredit": "createGroupNanoCredit",
|
"createGroupNanoCredit": "createGroupNanoCredit",
|
||||||
"groupNanoCredit": "groupNanoCredit",
|
"groupNanoCredit": "groupNanoCredit",
|
||||||
"demandGroupNanoCreditDetail": "demandeValidationGroupe",
|
"demandGroupNanoCreditDetail": "demandeValidationGroupe",
|
||||||
"adhererGroupNanoCredit": "adhererGroupNanoCredit"
|
"adhererGroupNanoCredit": "adhererGroupNanoCredit",
|
||||||
|
"myNanoCreditGroup": "myNanoCreditGroup"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1426,7 +1426,7 @@ class Home extends BaseScreen {
|
||||||
translucent={true}
|
translucent={true}
|
||||||
/>
|
/>
|
||||||
{/* Start here to comment */}
|
{/* Start here to comment */}
|
||||||
{
|
{/* {
|
||||||
(this.state.loadingDialog || this.props.loading) ?
|
(this.state.loadingDialog || this.props.loading) ?
|
||||||
<View
|
<View
|
||||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
||||||
|
@ -1462,7 +1462,7 @@ class Home extends BaseScreen {
|
||||||
this.setState({ showProgress: false })
|
this.setState({ showProgress: false })
|
||||||
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
Alert.alert(I18n.t("PROBLEM_OCCUR"), I18n.t("PROBLEM_OCCUR_DIRECTION"), [{ text: "Ok", onPress: () => { } }])
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
{this.makeCardSearch()}
|
{this.makeCardSearch()}
|
||||||
{this.makeSlidingUp()}
|
{this.makeSlidingUp()}
|
||||||
{this.makeDialogLoader()}
|
{this.makeDialogLoader()}
|
||||||
|
|
|
@ -73,12 +73,16 @@ class DemandValidationGroup extends React.Component {
|
||||||
const { routeName } = navigation.state
|
const { routeName } = navigation.state
|
||||||
return {
|
return {
|
||||||
|
|
||||||
tabBarLabel: routeName === "demandeValidationGroupe" ? I18n.t('MANAGE_GROUP') : I18n.t('DEMAND_RECEIVE'),
|
tabBarLabel: routeName === "demandeValidationGroupe" ? I18n.t('DEMAND_VALIDATION_GROUP_RECEIVE')
|
||||||
|
: routeName === "myNanoCreditGroup" ? I18n.t('My_GROUP')
|
||||||
|
: I18n.t('DEMAND_DELETE_GROUP_RECEIVE'),
|
||||||
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
tabBarIcon: ({ focused, horizontal, tintColor }) => {
|
||||||
return (<IconWithBadge
|
return (<IconWithBadge
|
||||||
badgeCount={navigation.getParam("count", 0)}
|
badgeCount={navigation.getParam("count", 0)}
|
||||||
size={20}
|
size={20}
|
||||||
name={routeName === "demandeValidationGroupe" ? "mail" : "inbox"}
|
name={routeName === "demandeValidationGroupe" ? "account-multiple-plus"
|
||||||
|
: routeName === "myNanoCreditGroup" ? "account-multiple"
|
||||||
|
: "account-multiple-minus"}
|
||||||
color={focused ? tintColor : "grey"}
|
color={focused ? tintColor : "grey"}
|
||||||
/>)
|
/>)
|
||||||
},
|
},
|
||||||
|
@ -130,7 +134,8 @@ class DemandValidationGroup extends React.Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
const { routeName } = this.navigation.state
|
const { routeName } = this.navigation.state
|
||||||
this.setState({ position: routeName === "demandeValidationGroupe" ? 0 : 1, isDataSubmit: true });
|
this.setState({ position: routeName === "demandeValidationGroupe" ? 0 : 1,
|
||||||
|
isDataSubmit: true });
|
||||||
this.animateSlidingUp(false)
|
this.animateSlidingUp(false)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,443 @@
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
import { StyleSheet, View, Text, Image, StatusBar, TouchableOpacity, ScrollView, ProgressBarAndroid, Alert } from 'react-native';
|
||||||
|
let theme = require('./../../utils/theme.json');
|
||||||
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||||
|
import { readUser, deleteUser } from './../../webservice/AuthApi';
|
||||||
|
import { getAgentNetworksList } from './../../webservice/NetworkApi'
|
||||||
|
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||||
|
import MapView, { Marker } from 'react-native-maps';
|
||||||
|
import * as Utils from '../../utils/DeviceUtils';
|
||||||
|
import Button from 'apsl-react-native-button';
|
||||||
|
import { Typography, FontWeight } from '../../config/typography';
|
||||||
|
import CardView from "react-native-cardview";
|
||||||
|
import I18n from 'react-native-i18n'
|
||||||
|
import { Header } from 'react-native-elements'
|
||||||
|
import { IlinkEmitter } from "../../utils/events";
|
||||||
|
import { Card, CardTitle, CardContent, CardAction, CardButton, CardImage } from 'react-native-material-cards'
|
||||||
|
import { Color } from '../../config/Color';
|
||||||
|
let route = require('../../route.json');
|
||||||
|
|
||||||
|
require('./../../utils/Translations')
|
||||||
|
const height = responsiveHeight(100) - 250;
|
||||||
|
/*
|
||||||
|
var Fabric = require('react-native-fabric');
|
||||||
|
var { Crashlytics } = Fabric;*/
|
||||||
|
export default class MyNanoCreditGroup extends Component {
|
||||||
|
static navigatorStyle = {
|
||||||
|
navBarHidden: false,
|
||||||
|
navBarBackgroundColor: theme.primaryDark,
|
||||||
|
navBarTextColor: 'white',
|
||||||
|
navBarButtonColor: 'white',
|
||||||
|
drawUnderStatusBar: false,
|
||||||
|
statusBarColor: theme.primaryDarkAdvanced,
|
||||||
|
statusBarTextColorScheme: 'light',
|
||||||
|
};
|
||||||
|
static navigationOptions = ({ navigation }) => {
|
||||||
|
return {
|
||||||
|
headerTitle: I18n.t('USER_ACCOUNT'),
|
||||||
|
headerStyle: {
|
||||||
|
backgroundColor: theme.primary,
|
||||||
|
paddingTop: 10
|
||||||
|
},
|
||||||
|
headerTitleStyle: {
|
||||||
|
color: "white"
|
||||||
|
},
|
||||||
|
drawerIcon: ({ tintColor }) => (
|
||||||
|
<Icon
|
||||||
|
name={'person'}
|
||||||
|
size={24}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static options(passProps) {
|
||||||
|
return {
|
||||||
|
topBar: {
|
||||||
|
drawBehind: false,
|
||||||
|
visible: true,
|
||||||
|
animate: true,
|
||||||
|
buttonColor: 'white',
|
||||||
|
background: {
|
||||||
|
color: theme.primaryDark,
|
||||||
|
},
|
||||||
|
rightButtons: []
|
||||||
|
},
|
||||||
|
backButton: {
|
||||||
|
visible: true,
|
||||||
|
color: "white"
|
||||||
|
},
|
||||||
|
buttonColor: "white",
|
||||||
|
background: {
|
||||||
|
color: theme.primaryDark
|
||||||
|
},
|
||||||
|
statusBar: {
|
||||||
|
drawBehind: false,
|
||||||
|
visible: true,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.state = this.initState();
|
||||||
|
IlinkEmitter.on("langueChange", this.updateLangue.bind(this))
|
||||||
|
readUser().then((user) => {
|
||||||
|
if (user !== null) {
|
||||||
|
this.setState({ user: user })
|
||||||
|
|
||||||
|
this.updateContent(user)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
updateLangue() {
|
||||||
|
|
||||||
|
this.props.navigation.setParams({ name: I18n.t('USER_ACCOUNT') })
|
||||||
|
this.forceUpdate()
|
||||||
|
}
|
||||||
|
updateContent(user) {
|
||||||
|
getAgentNetworksList(user.agentId).then((networks) => {
|
||||||
|
if (networks['success'] !== undefined) {
|
||||||
|
this.setState({ mynetworks: networks.networks })
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
this.setState({ user: user });
|
||||||
|
}
|
||||||
|
|
||||||
|
initState() {
|
||||||
|
return {
|
||||||
|
user: {},
|
||||||
|
mynetworks: []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
let cat = "";
|
||||||
|
|
||||||
|
const { user } = this.state
|
||||||
|
|
||||||
|
if (user.category !== undefined || user.category !== null)
|
||||||
|
cat = user.category === 'super' ? I18n.t("ADMIN") : user.category === 'hyper' ?
|
||||||
|
I18n.t("SUPER_ADMIN") : user.category === 'geolocated' ?
|
||||||
|
I18n.t("GEOLOCATED") : I18n.t("SIMPLE_USER")
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<StatusBar
|
||||||
|
backgroundColor={theme.primaryDark}
|
||||||
|
barStyle="light-content"
|
||||||
|
translucent={false}
|
||||||
|
/>
|
||||||
|
<ScrollView style={{
|
||||||
|
flex: 1,
|
||||||
|
marginTop: -5
|
||||||
|
}}>
|
||||||
|
<View style={styles.userInformation}>
|
||||||
|
<ScrollView>
|
||||||
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Image source={require('./../../datas/img/users/man.png')} style={{ width: 92, height: 92 }} />
|
||||||
|
</View>
|
||||||
|
<View style={{ flex: 1, flexDirection: 'row' }}>
|
||||||
|
{user.category === undefined || user.category === null ?
|
||||||
|
this.getHeaderLeftProfil(user) : this.getHeaderLeftAgentProfil(user)
|
||||||
|
}
|
||||||
|
<View style={{ flex: user.category === undefined || user.category === null ? 2 : 2 }}>
|
||||||
|
<Text style={styles.textInformation} >{this.state.user.firstname}</Text>
|
||||||
|
<Text style={styles.textInformation} >{this.state.user.lastname}</Text>
|
||||||
|
{<Text style={{ color: 'white', fontSize: 17, fontWeight: 'bold', textAlign: 'center' }}>{cat}</Text>
|
||||||
|
}
|
||||||
|
|
||||||
|
</View>
|
||||||
|
{user.category === undefined || user.category === null ?
|
||||||
|
this.getHeaderRight(user)
|
||||||
|
: this.getHeaderRightAgent(user)}
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View style={styles.networkInformation}>
|
||||||
|
|
||||||
|
<Text style={{
|
||||||
|
marginLeft: 10, marginRight: 10, marginTop: 15, marginBottom: 5, fontSize: 17,
|
||||||
|
fontWeight: 'bold', color: 'black'
|
||||||
|
}}>{I18n.t("ACCOUNT_INFO")}</Text>
|
||||||
|
<CardView style={{ marginLeft: 10, marginRight: 10, paddingBottom: 20 }}>
|
||||||
|
<ScrollView>
|
||||||
|
{user.category !== undefined && user.category !== null ? this
|
||||||
|
.addAgentInformation(user) : null}
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
<Icon name={"location-on"} size={18} />{" " + this.state.user.country}</Text>
|
||||||
|
|
||||||
|
{user.balance !== undefined && user.balance !== null ? this.showBalance(user) : null}
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
<Icon name={"mail"} size={18} />{" " + this.state.user.email}</Text>
|
||||||
|
|
||||||
|
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
|
<Icon name={"phone"} size={18} />
|
||||||
|
{" " + this.state.user.phone}</Text>
|
||||||
|
{this.showPhoneSup()}
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
|
<Icon name={"signal-cellular-4-bar"} size={18} />
|
||||||
|
{" " + this.state.user.network}</Text>
|
||||||
|
</ScrollView>
|
||||||
|
</CardView>
|
||||||
|
|
||||||
|
{user.category === 'geolocated' ?
|
||||||
|
(<Text style={{ marginLeft: 10, marginRight: 10, marginTop: 15, marginBottom: 5, fontSize: 17, fontWeight: 'bold', color: 'black' }}>{I18n.t("MY_NETWORK")}</Text>)
|
||||||
|
|
||||||
|
: null}
|
||||||
|
{user.category === 'geolocated' ? (this.state.mynetworks.length > 0 ? this.state.mynetworks.map(item => this.generateItemNetwork(item)) : this.showLoader()) : null}
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
showPhoneSup() {
|
||||||
|
if (this.state.user.phoneTransaction != undefined && this.state.user.phoneTransaction != null) {
|
||||||
|
|
||||||
|
return (<Text style={styles.textInformation2}>
|
||||||
|
|
||||||
|
<Icon name={"phone"} size={18} />
|
||||||
|
{" " + this.state.user.phoneTransaction}</Text>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaderLeftProfil(user) {
|
||||||
|
return (<View style={{ flex: 2 }}>
|
||||||
|
<Text style={{ color: 'white', fontSize: 15, fontWeight: 'bold', textAlign: 'center' }}>{I18n.t("NETWORK")}</Text>
|
||||||
|
<Text style={{ color: 'white', fontSize: 15, textAlign: 'center' }}>{user.network}</Text>
|
||||||
|
</View>)
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaderRight(user) {
|
||||||
|
return (<View style={{ flex: 0 }}>
|
||||||
|
</View>)
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaderRightAgent(user) {
|
||||||
|
|
||||||
|
return (<View style={{ flex: 2 }}>
|
||||||
|
<Text style={{ color: 'white', fontSize: 15, textAlign: 'center', fontWeight: 'bold' }}>{I18n.t("MEMBER_CODE")}</Text>
|
||||||
|
<Text style={{ color: 'white', fontSize: 13, textAlign: 'center' }}>{user.code_membre}</Text>
|
||||||
|
</View>)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeaderLeftAgentProfil(user) {
|
||||||
|
return (<View style={{ flex: 2 }}>
|
||||||
|
<Text style={{ color: 'white', fontSize: 15, fontWeight: 'bold', textAlign: 'center' }}>{I18n.t("NETWORK")}</Text>
|
||||||
|
<Text style={{ color: 'white', fontSize: 13, textAlign: 'center' }}>{user.network}</Text>
|
||||||
|
</View>)
|
||||||
|
}
|
||||||
|
|
||||||
|
addAgentInformation(user) {
|
||||||
|
console.log(user)
|
||||||
|
if (user.category === "geolocated") {
|
||||||
|
(<View>
|
||||||
|
<Text style={{ marginLeft: 10, marginTop: 10, color: theme.primaryDark }}>
|
||||||
|
<Icon name={'code'} size={18} color={theme.primaryDark} style={{ paddingRight: 10 }} />
|
||||||
|
{" " + user.code_parrain}</Text>
|
||||||
|
</View>)
|
||||||
|
|
||||||
|
} else
|
||||||
|
return (<View>
|
||||||
|
|
||||||
|
<Text style={{ marginLeft: 10, marginTop: 10, color: theme.primaryDark }}>
|
||||||
|
<Icon name={'code'} size={18} color={theme.primaryDark} style={{ paddingRight: 10 }} />
|
||||||
|
{" " + user.code_parrain}</Text>
|
||||||
|
<View style={{ flexDirection: 'row', justifyContent: 'space-between', width: responsiveWidth(90), marginRight: 50 }}>
|
||||||
|
<Text style={{ marginLeft: 12, marginTop: 10, color: theme.primaryDark }}>
|
||||||
|
<Icon name={"group-work"} color={theme.primaryDark} size={18} />
|
||||||
|
{" " + ((user.nbre_reseau === null || user.nbre_reseau === undefined) ? 0 : user.nbre_reseau) + " " + I18n.t("FREE")}</Text>
|
||||||
|
<Text style={{ marginLeft: 12, marginTop: 10, color: theme.primaryDark }}>
|
||||||
|
<Icon name={"book"} color={theme.primaryDark} size={18} />{" " + ((user.nbre_reseau === null || user.nbre_membre === undefined) ? 0 : user.nbre_membre) + " " + I18n.t("SAVED")}</Text>
|
||||||
|
</View>
|
||||||
|
</View>)
|
||||||
|
}
|
||||||
|
|
||||||
|
mapUser(user) {
|
||||||
|
const myPosition = { latitude: parseFloat(user.latitude), longitude: parseFloat(user.longitude) }
|
||||||
|
|
||||||
|
return (<MapView
|
||||||
|
liteMode
|
||||||
|
ref={(ref) => { this.mapRef = ref }}
|
||||||
|
style={styles.map}
|
||||||
|
>
|
||||||
|
{this.state.myPosition !== undefined ?
|
||||||
|
<Marker
|
||||||
|
title={"Vous êtes ici"}
|
||||||
|
minZoomLevel={10}
|
||||||
|
coordinate={{ longitude: myPosition.longitude, latitude: myPosition.latitude }}
|
||||||
|
/> :
|
||||||
|
null}
|
||||||
|
</MapView>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
showBalance(user) {
|
||||||
|
return <Text style={styles.textInformation2}>
|
||||||
|
<Icon name={"folder"} size={18} />{" " + this.state.user.balance + " "}</Text>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
makeGeolocatedNetworkList() {
|
||||||
|
|
||||||
|
return (<View>
|
||||||
|
<Text style={{ marginLeft: 10, marginRight: 10, marginTop: 15, marginBottom: 5, fontSize: 17, fontWeight: 'bold', color: 'black' }}>Mes reseaux</Text>
|
||||||
|
|
||||||
|
</View>)
|
||||||
|
}
|
||||||
|
|
||||||
|
generateItemNetwork(item) {
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Card >
|
||||||
|
|
||||||
|
<CardTitle
|
||||||
|
title={item.name}
|
||||||
|
subtitle={item.phone}
|
||||||
|
/>
|
||||||
|
<CardContent>
|
||||||
|
<View Style={{ flex: 1 }}>
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
<Icon name={"code"} size={18} />{" " + item.code_membre + " "}</Text>
|
||||||
|
<Text style={styles.textInformation2}>
|
||||||
|
<Icon name={"people"} size={18} />{" " + item.code_parrain + " "}</Text>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</CardContent>
|
||||||
|
<CardAction
|
||||||
|
separator={true}
|
||||||
|
inColumn={false}>
|
||||||
|
<CardButton
|
||||||
|
onPress={() => {
|
||||||
|
Alert.alert(
|
||||||
|
I18n.t("TITLE_SUPPRESS_CONFIRM"),
|
||||||
|
I18n.t("TEXT_SUPPRESS_CONFIRM"),
|
||||||
|
[
|
||||||
|
{ text: I18n.t('NO'), onPress: () => { } },
|
||||||
|
{
|
||||||
|
text: I18n.t("YES"), onPress: () => {
|
||||||
|
deleteUser(item).then(() => {
|
||||||
|
this.setState({ isLoading: true })
|
||||||
|
this.updateContent(this.state.user)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
style: 'cancel'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
title={I18n.t('DELETE_GEOLOCATED_USER')}
|
||||||
|
color="crimson"
|
||||||
|
/>
|
||||||
|
</CardAction>
|
||||||
|
</Card>)
|
||||||
|
}
|
||||||
|
|
||||||
|
showLoader() {
|
||||||
|
return (<View style={{ height: responsiveHeight(20) }}><ProgressBarAndroid
|
||||||
|
|
||||||
|
style={{ justifyContent: "center", alignItems: "center" }}
|
||||||
|
/></View>)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
userInformation: {
|
||||||
|
backgroundColor: theme.primary,
|
||||||
|
flex: 1,
|
||||||
|
justifyContent: 'center',
|
||||||
|
paddingTop: responsiveHeight(2),
|
||||||
|
paddingBottom: responsiveHeight(5)
|
||||||
|
},
|
||||||
|
map: {
|
||||||
|
height: 200,
|
||||||
|
marginRight: responsiveWidth(5),
|
||||||
|
marginLeft: responsiveWidth(5),
|
||||||
|
marginVertical: 10,
|
||||||
|
},
|
||||||
|
networkInformation: {
|
||||||
|
width: responsiveWidth(100),
|
||||||
|
backgroundColor: '#EEEEEE',
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: '#EEEEEE',
|
||||||
|
},
|
||||||
|
contain: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
identificationOptionMenuContainer: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingTop: 10,
|
||||||
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
|
},
|
||||||
|
containerTouch: {
|
||||||
|
flex: 1,
|
||||||
|
flexDirection: 'row',
|
||||||
|
marginRight: 2.5,
|
||||||
|
alignItems: 'center',
|
||||||
|
shadowColor: Color.borderColor,
|
||||||
|
borderColor: Color.borderColor,
|
||||||
|
shadowOffset: { width: 1.5, height: 1.5 },
|
||||||
|
shadowOpacity: 1.0,
|
||||||
|
elevation: 5,
|
||||||
|
borderRadius: 10,
|
||||||
|
backgroundColor: Color.cardBackgroundColor
|
||||||
|
},
|
||||||
|
contain: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
|
imageBanner: {
|
||||||
|
marginTop: 15,
|
||||||
|
marginLeft: 5,
|
||||||
|
width: Utils.scaleWithPixel(30),
|
||||||
|
height: Utils.scaleWithPixel(30)
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
height: Utils.scaleWithPixel(60),
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
contentTitle: {
|
||||||
|
paddingTop: 5,
|
||||||
|
},
|
||||||
|
textInformation: {
|
||||||
|
fontSize: 16,
|
||||||
|
color: 'white',
|
||||||
|
textAlign: 'center'
|
||||||
|
},
|
||||||
|
textInformation2: {
|
||||||
|
fontSize: 15,
|
||||||
|
marginTop: 7,
|
||||||
|
color: theme.primaryDark,
|
||||||
|
marginLeft: 10,
|
||||||
|
},
|
||||||
|
textTitle: {
|
||||||
|
fontSize: 25,
|
||||||
|
color: 'white',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
},
|
||||||
|
|
||||||
|
textTitle2: {
|
||||||
|
fontSize: 25,
|
||||||
|
color: theme.primaryDark,
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
});
|
|
@ -259,7 +259,7 @@ export default class OptionsMenu extends Component {
|
||||||
|| item === 'retraitCarteVersWalletUser' || item === 'retraitEnCashAgent' || item === 'retraitCarteVersCashAgent' || item === 'envoieCashVersWalletAgent'
|
|| item === 'retraitCarteVersWalletUser' || item === 'retraitEnCashAgent' || item === 'retraitCarteVersCashAgent' || item === 'envoieCashVersWalletAgent'
|
||||||
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|
||||||
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|
||||||
|| item === 'adhererGroupNanoCredit') {
|
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup') {
|
||||||
return null
|
return null
|
||||||
} else {
|
} else {
|
||||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
"FEES_AND_TAXES": "Fees and taxes",
|
"FEES_AND_TAXES": "Fees and taxes",
|
||||||
"SUCCESS_CREATION_GROUP": "Creation information",
|
"SUCCESS_CREATION_GROUP": "Creation information",
|
||||||
"ERROR_CREATION_GROUP": "Creation error",
|
"ERROR_CREATION_GROUP": "Creation error",
|
||||||
|
"ERROR_JOIN_GROUP": "Join error",
|
||||||
"CREATE_GROUP": "Create group",
|
"CREATE_GROUP": "Create group",
|
||||||
"MANAGE_GROUP": "Manage group",
|
"MANAGE_GROUP": "Manage group",
|
||||||
"VALIDATION_DEMAND": "Validation request",
|
"VALIDATION_DEMAND": "Validation request",
|
||||||
|
@ -415,6 +416,8 @@
|
||||||
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
|
"DEMAND_TEXT_FIRST_PART_YOU": "You made a request for ",
|
||||||
"REQUEST_SEND": "Request Sent",
|
"REQUEST_SEND": "Request Sent",
|
||||||
"DEMAND_RECEIVE": "Requests received",
|
"DEMAND_RECEIVE": "Requests received",
|
||||||
|
"DEMAND_VALIDATION_GROUP_RECEIVE": "Validation requests",
|
||||||
|
"DEMAND_DELETE_GROUP_RECEIVE": "Removal requests",
|
||||||
"TO_": "credit to",
|
"TO_": "credit to",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
"DEMAND_SEND_SUCCESFUL": "Your request has been sent successfully!",
|
||||||
"SAVE_HISTORY": "Save history",
|
"SAVE_HISTORY": "Save history",
|
||||||
|
|
|
@ -421,6 +421,8 @@
|
||||||
"DEMAND_TEXT_FIRST_PART_YOU": "Vous avez effectué une demande de ",
|
"DEMAND_TEXT_FIRST_PART_YOU": "Vous avez effectué une demande de ",
|
||||||
"DEMANDE_SEND": " Demande Envoyée",
|
"DEMANDE_SEND": " Demande Envoyée",
|
||||||
"DEMAND_RECEIVE": "Demandes reçues",
|
"DEMAND_RECEIVE": "Demandes reçues",
|
||||||
|
"DEMAND_VALIDATION_GROUP_RECEIVE": "Demandes de validation",
|
||||||
|
"DEMAND_DELETE_GROUP_RECEIVE": "Demandes de suppression",
|
||||||
"TO_": " crédit auprès de ",
|
"TO_": " crédit auprès de ",
|
||||||
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
"DEMAND_SEND_SUCCESFUL": "Votre demande a été envoyée avec succès !",
|
||||||
"SAVE_HISTORY": "Enregistrer l'historique",
|
"SAVE_HISTORY": "Enregistrer l'historique",
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import I18n from 'react-native-i18n';
|
import I18n from 'react-native-i18n';
|
||||||
import { store } from "../../redux/store";
|
import { store } from "../../redux/store";
|
||||||
import { idVerificationUrl, getCreditDemand } from "../IlinkConstants";
|
import { idVerificationUrl, getCreditDemand, groupUrl } from "../IlinkConstants";
|
||||||
import { fetchRetraitCashAgentIdVerificationPending, fetchRetraitCashAgentIdVerificationSuccess, fetchRetraitCashAgentIdVerificationError, fetchRetraitCashAgentIdVerificationReset } from "../../redux/actions/EnvoieAgentAction";
|
import { fetchRetraitCashAgentIdVerificationPending, fetchRetraitCashAgentIdVerificationSuccess, fetchRetraitCashAgentIdVerificationError, fetchRetraitCashAgentIdVerificationReset } from "../../redux/actions/EnvoieAgentAction";
|
||||||
import { fetchGetDemandsGroupSuccess, fetchGetDemandsGroupPending, fetchGetDemandsGroupError, fetchGetDemandsGroupReset, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupSuccess, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupError } from "../../redux/actions/NanoCreditAction";
|
import { fetchGetDemandsGroupSuccess, fetchGetDemandsGroupPending, fetchGetDemandsGroupError, fetchGetDemandsGroupReset, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupSuccess, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupError, fetchGetUserGroupDetailPending, fetchGetUserGroupDetailSuccess, fetchGetUserGroupDetailReset } from "../../redux/actions/NanoCreditAction";
|
||||||
|
|
||||||
export const getNanoCreditDemandsAction = (id) => {
|
export const getNanoCreditDemandsAction = (id) => {
|
||||||
|
|
||||||
|
@ -79,3 +79,41 @@ export const getNanoCreditUniqueDemandsReset = () => {
|
||||||
dispatch(fetchGetUniqueDemandsGroupReset());
|
dispatch(fetchGetUniqueDemandsGroupReset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const getUserGroupDetailAction = (code_user) => {
|
||||||
|
|
||||||
|
const auth = store.getState().authKeyReducer;
|
||||||
|
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||||
|
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetUserGroupDetailPending());
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: `${groupUrl}/my/${code_user}`,
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': authKey,
|
||||||
|
'X-Localization': I18n.currentLocale()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(response => {
|
||||||
|
console.log(response);
|
||||||
|
dispatch(fetchGetUserGroupDetailSuccess(response));
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
if (error.response)
|
||||||
|
dispatch(fetchGetUserGroupDetailError(error.response));
|
||||||
|
else if (error.request)
|
||||||
|
dispatch(fetchGetUserGroupDetailError(error.request))
|
||||||
|
else
|
||||||
|
dispatch(fetchGetUserGroupDetailError(error.message))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getUserGroupDetailReset = () => {
|
||||||
|
return dispatch => {
|
||||||
|
dispatch(fetchGetUserGroupDetailReset());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue