ajout de la fontionalité copie le code membre

This commit is contained in:
Novic-Djef 2023-11-13 16:32:27 +01:00
parent cccee161ab
commit a9e7c2dd90
11 changed files with 405 additions and 29584 deletions

View File

@ -6,16 +6,16 @@
* Date: 26/08/2021
*/
import React from 'react';
import {SafeAreaView} from 'react-native';
import {SafeAreaView, View} from 'react-native';
import {NetInfoBar} from './NetInfoBar';
import {Color} from "../config/Color";
export const ScreenComponent = React.forwardRef((props, ref) => (
<SafeAreaView style={[{flex: 1, backgroundColor: Color.containerBackgroundColor}, props.style]} {...props}>
<SafeAreaView style={[ props.style]} {...props}>
<NetInfoBar/>
{/* React.Children.map(props.children, child =>
{React.Children.map(props.children, child =>
React.cloneElement(child, {}),
) */}
{props.children}
)}
{/* {props.children} */}
</SafeAreaView>
));

View File

@ -1,4 +1,5 @@
import { StyleSheet } from "react-native";
import { responsiveFontSize } from "react-native-responsive-dimensions";
export const FontWeight = {
thin: "100",
@ -26,7 +27,7 @@ export const Typography = StyleSheet.create({
fontWeight: FontWeight.regular
},
title3: {
fontSize: 20,
fontSize: responsiveFontSize(2),
fontWeight: FontWeight.regular
},
headline: {

View File

@ -20,6 +20,7 @@ import {
TouchableOpacity,
View
} from 'react-native';
import { NetInfoBar } from '../../components/NetInfoBar';
import axios from "axios";
import IMap from './IMap'
import ActionButton from 'react-native-action-button';
@ -1736,8 +1737,10 @@ class Home extends BaseScreen {
<StatusBar
backgroundColor="#00000030"
barStyle="light-content"
translucent={true}
translucent={false}
/>
{/* Start here to comment */}
{/* {
(this.state.loadingDialog || this.props.loading) ?
@ -1793,6 +1796,8 @@ class Home extends BaseScreen {
}])
}}
/>
{this.makeCardSearch()}
{this.showInterticiel()}
{this.makeSlidingUp()}
@ -1807,7 +1812,6 @@ class Home extends BaseScreen {
autoHidingTime={5000}
/>
{this.makeActionButon()}
</View>
)
}

View File

@ -562,7 +562,7 @@ export default class CreateUserStep2 extends Component {
/>
</View>}
<Text
{/* <Text
style={{
fontSize: 16,
marginTop: 10,
@ -611,7 +611,8 @@ export default class CreateUserStep2 extends Component {
marginTop: 10, marginRight: responsiveWidth(6), color: 'white', fontWeight: 'bold'
}}
>{this.state.textadress !== undefined ? this.state.textadress : I18n.t('TAKE_MY_POSITION')}</Text>
</TouchableOpacity>
</TouchableOpacity> */}
<Button style={styles.btnvalide} textStyle={styles.textbtnvalide}
isLoading={this.state.isLoading}
onPress={() => {

View File

@ -29,6 +29,7 @@ import {readUser} from "../../../webservice/AuthApi";
import Spinner from "react-native-loading-spinner-overlay";
import Geolocation from "react-native-geolocation-service";
import {callingCodes} from '@ideditor/country-coder';
import { ScreenComponent } from '../../../components/ScreenComponent';
let theme = require('./../../../utils/theme.json');
@ -390,14 +391,18 @@ export class LoginUi extends Component {
render() {
return (
<Animated.View style={[style.container,
{backgroundColor: this.BackgroundColorConfig}]}>
<ScreenComponent>
<StatusBar
backgroundColor={theme.primaryDark}
barStyle="light-content"
translucent={false}
/><Spinner
/>
</ScreenComponent>
<Spinner
visible={this.state.loadingDialog}
textContent={I18n.t("LOADING_PROGRESS")}
textStyle={{color: '#FFF'}}
@ -516,6 +521,7 @@ export class LoginUi extends Component {
</Animated.View>
)
}

View File

@ -2371,6 +2371,6 @@ const styles = StyleSheet.create({
flex: 1,
},
contentTitle: {
paddingTop: 5,
paddingTop: 15,
}
})

View File

@ -18,11 +18,12 @@ import I18n from 'react-native-i18n'
import * as Utils from '../../utils/DeviceUtils';
import Icons from 'react-native-vector-icons/Ionicons'
import {Color} from '../../config/Color';
import { ToastProvider, useToast } from 'react-native-toast-notifications';
import omit from 'lodash/omit';
import Tag from '../../components/Tag';
import {IlinkEmitter} from "../../utils/events";
import {Typography} from '../../config/typography';
import {responsiveWidth,} from 'react-native-responsive-dimensions';
import {responsiveHeight, responsiveWidth, responsiveFontSize} from 'react-native-responsive-dimensions';
import {
getWalletDetailActivated,
passwordValidationAction,
@ -70,6 +71,8 @@ import {Fumi} from "react-native-textinput-effects";
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome";
import Button from "../../components/Button";
import Entypo from "react-native-vector-icons/Entypo";
import Clipboard from '@react-native-clipboard/clipboard';
import DropdownAlert from 'react-native-dropdownalert';
let moment = require('moment-timezone');
@ -79,6 +82,7 @@ let route = require('./../../route.json');
let slugify = require('slugify');
require('../../utils/Translations');
class WalletDetailUser extends Component {
constructor(props) {
@ -98,9 +102,12 @@ class WalletDetailUser extends Component {
isIdentified: false,
isIdentifiedValidated: false,
password: '',
isLogged: false
};
isLogged: false,
isCopied: false,
};
this.copyToClipboard = this.copyToClipboard.bind(this);
// this.dropdownAlertRef = React.createRef();
slugify.extend({'+': 'plus'});
this.scrollY = new Animated.Value(0);
@ -168,7 +175,6 @@ class WalletDetailUser extends Component {
};
getWalletDetail = () => {
readUser().then((user) => {
if (user) {
@ -415,8 +421,36 @@ class WalletDetailUser extends Component {
)
}
renderAccountDetail = (wallet) => (
<View style={{flexDirection: 'row', flex: 1, justifyContent: 'space-between'}}>
copyToClipboard = (wallet) => {
const textToCopy = `${wallet.user_code}`;
Clipboard.setString(textToCopy);
Clipboard.getString().then((copiedText) => {
console.log('Texte copié :', copiedText);
this.setState({ isCopied: true });
// this.dropdownAlertRef.current.alertWithType('success', 'Copié avec succès', copiedText);
showToast({
type: 'success', // ou 'warn', 'error', 'info'
text1: 'Code copier avec succès',
text2: copiedText,
visibilityTime: 2000,
});
});
}
renderAccountDetail = (wallet) => {
return(
<>
<ToastProvider>
<View style={{ flexDirection: 'row', flex: 1, justifyContent: 'space-between' }}>
<View
style={{
@ -426,23 +460,20 @@ class WalletDetailUser extends Component {
<View
style={[
styles.circlePoint,
{backgroundColor: Color.primaryColor},
{ backgroundColor: Color.primaryColor },
]}>
<Icons name='md-wallet'
size={28}
color={Color.whiteColor}
/>
color={Color.whiteColor} />
</View>
<View>
<Text style={[Typography.title3, Color.primaryColor, {marginBottom: 3}]}>
<Text style={[Typography.title3, Color.primaryColor, { marginBottom: 3 }]}>
{I18n.t('PRINCIPAL_ACCOUNT_TITLE')}
</Text>
<Text
style={[Typography.body2]}>{`${thousands(wallet.balance, ' ')} ${wallet.currency_code}`}</Text>
</View>
</View>
<View
</View><View
style={{
flexDirection: 'row',
alignItems: 'center',
@ -450,26 +481,48 @@ class WalletDetailUser extends Component {
<View
style={[
styles.circlePoint,
{backgroundColor: Color.primaryColor},
{ backgroundColor: Color.primaryColor },
]}>
<Icons name='md-key'
size={28}
color={Color.whiteColor}
/>
color={Color.whiteColor} />
</View>
<View>
<Text style={[Typography.title3, Color.primaryColor, {marginBottom: 3}]}>
<Text style={[Typography.title3, Color.primaryColor, { marginBottom: 3 }]}>
{I18n.t('NUMERO_COMPTE')}
</Text>
<Text style={[Typography.body2]}>{wallet.user_code}</Text>
<TouchableOpacity onPress={() => this.copyToClipboard(wallet)}>
<View style={{ flexDirection: 'row' }}>
<Animatable.Text
style={[Typography.body2, { color: this.state.isCopied ? 'green' : 'black' }]}
animation={this.state.isCopied ? 'fadeIn' : null}
>
{wallet.user_code}
</Animatable.Text>
{this.state.isCopied ? (
<Icons name='md-checkmark' size={16} color={Color.greenColor} style={{ marginLeft: 6 }} />
) : (
<Icons name='md-copy' size={16} color={Color.greenColor} style={{ marginLeft: 6 }} />
)}
</View>
</TouchableOpacity>
</View>
</View>
);
</View>
</ToastProvider>
{/* <DropdownAlert ref={this.dropdownAlertRef} /> */}
</>
)
};
renderDetailWallet = (wallet) => {
const { width } = Dimensions.get('window');
// const { width } = Dimensions.get('window');
return (
!isEmptyObject(wallet) ?
(<>
@ -479,7 +532,7 @@ class WalletDetailUser extends Component {
//</>style={styles.container}
style={{
flex: 1,
width: width >= 768 ? '50%' : '100%',
// width: width >= 768 ? '50%' : '100%',
backgroundColor: Color.containerBackgroundColor
}}
>
@ -551,7 +604,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t('ENVOIE_ARGENT')}
</Text>
@ -589,7 +642,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t('RETRAIT_ARGENT')}
</Text>
@ -640,7 +693,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={{paddingTop: 5,}}>
<View style={styles.centerText}>
<Text
style={[Typography.headline, Typography.semibold]}>
{I18n.t('NANO_CREDIT')}
@ -672,7 +725,7 @@ class WalletDetailUser extends Component {
style={styles.imageBanner}/>
<View style={[styles.content]}>
<View style={{paddingTop: 20,}}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t('NANO_SANTE')}
</Text>
@ -707,7 +760,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t('PAIEMENT_FACTURE')}
</Text>
@ -752,7 +805,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={{paddingTop: 20,}}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t('CREATION_IDENTIFICATION_CLIENT')}
</Text>
@ -787,7 +840,7 @@ class WalletDetailUser extends Component {
<View style={[styles.content]}>
<View style={styles.contentTitle}>
<View style={styles.centerText}>
<Text style={[Typography.headline, Typography.semibold]}>
Agency Banking
</Text>
@ -1233,6 +1286,9 @@ class WalletDetailUser extends Component {
console.warn("Wallet Detail user Props", this.props);
return (
<>
<ToastProvider >
{this.state.displayModalHistory && this.renderModalHistoryDetail()}
<StatusBar
backgroundColor={Color.primaryDarkColor}
@ -1297,7 +1353,7 @@ class WalletDetailUser extends Component {
)
)
}
</ToastProvider>
</>
);
}
@ -1421,8 +1477,8 @@ const styles = StyleSheet.create({
borderBottomWidth: 0.5,
},
circlePoint: {
width: 50,
height: 50,
width: responsiveWidth(10),
height: responsiveHeight(5),
borderRadius: 25,
marginRight: 5,
alignItems: 'center',
@ -1431,7 +1487,7 @@ const styles = StyleSheet.create({
transactionContainer: {
flexDirection: 'row',
flex: 1,
paddingTop: 10,
paddingTop: 20,
paddingLeft: 10,
paddingRight: 10,
},
@ -1444,6 +1500,7 @@ const styles = StyleSheet.create({
borderColor: Color.borderColor,
borderWidth: 0.5,
shadowOffset: {width: 1.5, height: 1.5},
height: responsiveHeight(10),
shadowOpacity: 1.0,
elevation: 5,
borderRadius: 10,
@ -1468,6 +1525,13 @@ const styles = StyleSheet.create({
flex: 1,
},
contentTitle: {
paddingTop: 5,
textAlign: 'center',
},
centerText: {
display: 'flex',
marginTop: 22,
textAlign: 'center',
}
})

View File

@ -22,6 +22,7 @@ import {connect} from 'react-redux';
import {readUser} from '../../webservice/AuthApi';
import {bindActionCreators} from 'redux';
import {Typography} from '../../config/typography';
import { ScreenComponent } from '../../components/ScreenComponent';
const route = require('./../../route.json');
let slugify = require('slugify');
@ -186,7 +187,7 @@ class WalletSelect extends Component {
<StatusBar
backgroundColor={Color.primaryDarkColor}
barStyle="light-content"
translucent={false}
translucent={true}
/>
<Appbar.Header dark={true} style={{backgroundColor: Color.primaryColor}}>

View File

@ -678,7 +678,7 @@
"EXAMENS_SUCCESSFULLY_ADD": "Examen ajouté avec succès",
"PRESCRIPTIONS_SUCCESSFULLY_ADD": "Prescription ajouté avec succès",
"PRESCRIPTIONS_SUCCESSFULLY_MODIFY": "Prescription modifié avec succès",
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATION": "Vous devez ajouter au moins une prestation",
"YOU_MUST_ADD_AT_LEAST_ONE_PRESTATIONcode ": "Vous devez ajouter au moins une prestation",
"NO_DRUG_MATCH_YOU_SEARCH": "Aucun médicament ne correspond à votre recherche, voulez-vous en ajouter ?",
"COMPRESSED": "Comprimé",
"SYRUP": "Sirop",

29430
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,7 @@
"dependencies": {
"@expo/react-native-action-sheet": "^3.8.0",
"@ideditor/country-coder": "^4.0.0",
"@react-native-clipboard/clipboard": "^1.12.1",
"@react-native-community/async-storage": "^1.9.0",
"@react-native-community/datetimepicker": "^3.5.2",
"@react-native-community/netinfo": "^6.0.2",
@ -89,6 +90,7 @@
"react-native-switch-selector": "^1.1.14",
"react-native-tab-view": "^2.14.0",
"react-native-textinput-effects": "^0.5.1",
"react-native-toast-notifications": "^3.4.0",
"react-native-vector-icons": "^6.5.0",
"react-native-webview": "^11.26.1",
"react-native-wizard": "^2.1.0",