demand group OK
This commit is contained in:
parent
04c20dd6f8
commit
bca8f308b2
|
@ -55,6 +55,7 @@ import { IlinkEmitter } from '../../utils/events';
|
||||||
import { Typography } from '../../config/typography';
|
import { Typography } from '../../config/typography';
|
||||||
import { ScrollView } from 'react-native-gesture-handler';
|
import { ScrollView } from 'react-native-gesture-handler';
|
||||||
import { Color } from '../../config/Color';
|
import { Color } from '../../config/Color';
|
||||||
|
import { color } from 'react-native-reanimated';
|
||||||
|
|
||||||
|
|
||||||
class DemandValidationGroup extends React.Component {
|
class DemandValidationGroup extends React.Component {
|
||||||
|
@ -143,8 +144,29 @@ class DemandValidationGroup extends React.Component {
|
||||||
|
|
||||||
_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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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) => {
|
renderDemandItem = (item) => {
|
||||||
let dateFormat = moment.tz(item.date_creation, 'Etc/GMT+0').format();
|
let dateFormat = moment.tz(item.date_creation_demande, 'Etc/GMT+0').format();
|
||||||
dateFormat = moment(dateFormat).fromNow();
|
dateFormat = moment(dateFormat).fromNow();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -152,8 +174,15 @@ class DemandValidationGroup extends React.Component {
|
||||||
this.props.navigation.push(route.demandGroupNanoCreditDetail, {
|
this.props.navigation.push(route.demandGroupNanoCreditDetail, {
|
||||||
id: item.id
|
id: item.id
|
||||||
});
|
});
|
||||||
}
|
}}
|
||||||
}>
|
style={[styles.paymentItem]}>
|
||||||
|
|
||||||
|
<View style={{ flexDirection: 'row', alignItems: 'center', }}>
|
||||||
|
<View style={styles.iconContent}>
|
||||||
|
|
||||||
|
<Icon name={this.getDemandTypeIcon(item.type)} color={this.getDemandTypeColor(item.type)} size={35} />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
<View style={styles.content}>
|
<View style={styles.content}>
|
||||||
|
|
||||||
<Text style={styles.title}>{item.nom}</Text>
|
<Text style={styles.title}>{item.nom}</Text>
|
||||||
|
@ -189,7 +218,6 @@ class DemandValidationGroup extends React.Component {
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={styles.bottomSeparator} />
|
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
)
|
)
|
||||||
|
@ -399,8 +427,6 @@ const styles = StyleSheet.create({
|
||||||
fontWeight: 'bold'
|
fontWeight: 'bold'
|
||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
width: responsiveWidth(100),
|
|
||||||
borderBottomColor: '#FFFFFF',
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
paddingTop: 10,
|
paddingTop: 10,
|
||||||
|
@ -440,4 +466,17 @@ const styles = StyleSheet.create({
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
color: theme.accent,
|
color: theme.accent,
|
||||||
},
|
},
|
||||||
|
paymentItem: {
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
width: "100%",
|
||||||
|
borderBottomColor: '#EEE',
|
||||||
|
borderBottomWidth: 1
|
||||||
|
},
|
||||||
|
iconContent: {
|
||||||
|
width: 40,
|
||||||
|
marginRight: 5,
|
||||||
|
alignItems: "center"
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -97,7 +97,7 @@ class DemandGroupNanoCreditDetail extends Component {
|
||||||
|
|
||||||
displayToast = (message) => {
|
displayToast = (message) => {
|
||||||
Toast.show(message, {
|
Toast.show(message, {
|
||||||
duration: Toast.durations.SHORT,
|
duration: Toast.durations.LONG,
|
||||||
position: Toast.positions.BOTTOM,
|
position: Toast.positions.BOTTOM,
|
||||||
backgroundColor: Color.primaryColor,
|
backgroundColor: Color.primaryColor,
|
||||||
shadow: true,
|
shadow: true,
|
||||||
|
@ -298,14 +298,28 @@ class DemandGroupNanoCreditDetail extends Component {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
renderDetail = () => {
|
renderDetail = () => {
|
||||||
|
|
||||||
const { resultGetUniqueDemand } = this.props;
|
const { resultGetUniqueDemand } = this.props;
|
||||||
let ago = moment.tz(resultGetUniqueDemand.response.date_creation, 'Etc/GMT+0').format();
|
let ago = moment.tz(resultGetUniqueDemand.response.date_creation_groupe, 'Etc/GMT+0').format();
|
||||||
ago = moment(ago)
|
let dateDemand = moment.tz(resultGetUniqueDemand.response.date_creation_demande, 'Etc/GMT+0').format();
|
||||||
|
ago = moment(ago);
|
||||||
|
dateDemand = moment(dateDemand);
|
||||||
|
|
||||||
return (<View style={styles.container}>
|
return (<View style={styles.container}>
|
||||||
<CardView
|
<CardView
|
||||||
style={styles.cardcontainer1}
|
style={styles.cardcontainer}
|
||||||
>
|
>
|
||||||
<Text style={{
|
<Text style={{
|
||||||
fontSize: 17,
|
fontSize: 17,
|
||||||
|
@ -315,6 +329,19 @@ class DemandGroupNanoCreditDetail extends Component {
|
||||||
}}>
|
}}>
|
||||||
{resultGetUniqueDemand.response.nom}
|
{resultGetUniqueDemand.response.nom}
|
||||||
</Text>
|
</Text>
|
||||||
|
<View style={{
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'flex-start'
|
||||||
|
}}>
|
||||||
|
<Icon name={this.getDemandTypeIcon(resultGetUniqueDemand.response.type)}
|
||||||
|
size={28}
|
||||||
|
color={theme.accent}
|
||||||
|
style={{
|
||||||
|
marginLeft: 20
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Text style={styles.simpleuser}>{`${I18n.t('TYPE_DEMAND')}: ${resultGetUniqueDemand.response.type}`}</Text>
|
||||||
|
</View>
|
||||||
<View style={{
|
<View style={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'flex-start'
|
justifyContent: 'flex-start'
|
||||||
|
@ -461,7 +488,7 @@ class DemandGroupNanoCreditDetail extends Component {
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
color: theme.accent
|
color: theme.accent
|
||||||
|
|
||||||
}}>{ago.fromNow()}</Text>
|
}}>{dateDemand.fromNow()}</Text>
|
||||||
</View>
|
</View>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ class MyNanoCreditGroup extends Component {
|
||||||
|
|
||||||
displayToast = (message) => {
|
displayToast = (message) => {
|
||||||
Toast.show(message, {
|
Toast.show(message, {
|
||||||
duration: Toast.durations.SHORT,
|
duration: Toast.durations.LONG,
|
||||||
position: Toast.positions.BOTTOM,
|
position: Toast.positions.BOTTOM,
|
||||||
backgroundColor: Color.primaryColor,
|
backgroundColor: Color.primaryColor,
|
||||||
shadow: true,
|
shadow: true,
|
||||||
|
|
|
@ -29,7 +29,7 @@ export const isNormalInteger = (str) => {
|
||||||
|
|
||||||
export const displayToast = (message) => {
|
export const displayToast = (message) => {
|
||||||
Toast.show(message, {
|
Toast.show(message, {
|
||||||
duration: Toast.durations.SHORT,
|
duration: Toast.durations.LONG,
|
||||||
position: Toast.positions.BOTTOM,
|
position: Toast.positions.BOTTOM,
|
||||||
backgroundColor: Color.primaryColor,
|
backgroundColor: Color.primaryColor,
|
||||||
shadow: true,
|
shadow: true,
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
"MANAGE_GROUP": "Manage group",
|
"MANAGE_GROUP": "Manage group",
|
||||||
"VALIDATION_DEMAND": "Validation request",
|
"VALIDATION_DEMAND": "Validation request",
|
||||||
"DELETE_DEMAND": "Deletion request",
|
"DELETE_DEMAND": "Deletion request",
|
||||||
|
"TYPE_DEMAND": "Demand type",
|
||||||
"GROUP_INFOS": "Fill in the group information",
|
"GROUP_INFOS": "Fill in the group information",
|
||||||
"GROUP_CODE": "Group code",
|
"GROUP_CODE": "Group code",
|
||||||
"NOM_GROUP": "Group name",
|
"NOM_GROUP": "Group name",
|
||||||
|
|
|
@ -109,6 +109,7 @@
|
||||||
"MANAGE_GROUP": "Gérer le groupe",
|
"MANAGE_GROUP": "Gérer le groupe",
|
||||||
"VALIDATION_DEMAND": "Demandes de validation",
|
"VALIDATION_DEMAND": "Demandes de validation",
|
||||||
"DELETE_DEMAND": "Demande de suppression",
|
"DELETE_DEMAND": "Demande de suppression",
|
||||||
|
"TYPE_DEMAND": "Type de demande",
|
||||||
"GROUP_INFOS": "Renseigner les informations du groupe",
|
"GROUP_INFOS": "Renseigner les informations du groupe",
|
||||||
"GROUP_CODE": "Code du groupe",
|
"GROUP_CODE": "Code du groupe",
|
||||||
"SUCCESS_CREATION_GROUP": "Informations sur la création",
|
"SUCCESS_CREATION_GROUP": "Informations sur la création",
|
||||||
|
|
Loading…
Reference in New Issue