reste tests

This commit is contained in:
Vincent BRIDIER 2022-10-10 16:52:03 +02:00
parent 35778ef292
commit 3f36ad5b12
No known key found for this signature in database
GPG key ID: 8571BFA20420D512
40 changed files with 1058 additions and 176 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -3,6 +3,7 @@
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
<item name="android:textColor">#000000</item>
</style>
<style name="Theme.App.SplashScreen" parent="AppTheme">
<!-- Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually -->

View file

@ -325,13 +325,13 @@ class App extends React.Component {
onPress={() => {
store.dispatch({ type: 'UPDATE_LOCALE' });
}}
style={{ marginRight: 15 }}>
style={{ marginRight: 25 }}>
<Image source={flag} style={{ width: 25, height: 25 }} />
</TouchableOpacity>
{this.state.ShowIsActive === '1' && (
<TouchableOpacity
onPress={() => navigation.navigation.navigate('MySpaceScreen')}
style={{ marginRight: 15 }}>
style={{ marginRight: 25 }}>
<Icon name="user-circle" size={25} />
</TouchableOpacity>
)}
@ -341,14 +341,14 @@ class App extends React.Component {
isInstalled: true,
})
}
style={{ marginRight: 15 }}>
style={{ marginRight: 25 }}>
<Icon name="sync-alt" size={20} />
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
store.dispatch({ type: 'SET_LOGGED', data: false });
}}
style={{ marginRight: 15 }}>
style={{ marginRight: 25 }}>
<Icon name="sign-out-alt" size={20} />
</TouchableOpacity>
</View>
@ -394,7 +394,8 @@ class App extends React.Component {
component={VideoScreen}
options={(navigation, route) => ({
headerTitle: () => this.LogoTitle(i18n.t('app.video')),
headerRight: () => this.SendEmail()
headerRight: () => this.SendEmail(),
orientation: 'landscape'
})}
/>
<Stack.Screen
@ -430,7 +431,7 @@ class App extends React.Component {
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<TouchableOpacity
onPress={() => {
const folder = store.getState().directories.filter(tmp => tmp.id === 131);
const folder = store.getState().directories.filter(tmp => tmp.id === 1);
navigation.navigation.navigate('DirectoriesScreen', { folder: folder })
}}
style={{ marginRight: 15 }}>
@ -451,7 +452,7 @@ class App extends React.Component {
const styles = StyleSheet.create({
searchInput: {
borderWidth: 1,
borderColor: '#ce3029',
borderColor: '#ea4f52',
width: 200,
paddingLeft: 20,
},
@ -460,7 +461,7 @@ const styles = StyleSheet.create({
height: 50,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ce3029'
backgroundColor: '#ea4f52'
}
});

View file

@ -354,7 +354,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.customer')}
checkedIcon="dot-circle-o"
@ -364,7 +364,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('client')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.prospect')}
checkedIcon="dot-circle-o"
@ -374,7 +374,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('prospect')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.other')}
checkedIcon="dot-circle-o"
@ -510,28 +510,28 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p1')}
checked={this.state.p1}
onPress={() => this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p2')}
checked={this.state.p2}
onPress={() => this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p3')}
checked={this.state.p3}
onPress={() => this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p4')}
checked={this.state.p4}
onPress={() => this.setState({ p4: !this.state.p4 })}
@ -543,7 +543,7 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flex: 1 }}>
<ButtonGroup
buttons={[i18n.t('contact_details_s.visits'), i18n.t('contact_details_s.notes')]}
selectedButtonStyle={{ backgroundColor: '#ce3029' }}
selectedButtonStyle={{ backgroundColor: '#ea4f52' }}
containerStyle={{ height: 30 }}
selectedIndex={this.state.selectedIndex}
onPress={index => this.setState({ selectedIndex: index })}
@ -595,13 +595,13 @@ class ContactDetailsScreen extends React.Component {
<TouchableOpacity
style={styles.button}
onPress={() => this.setState({ showNewVisit: true })}>
<FontAwesome5 name="plus-circle" size={20} color={'#ce3029'} />
<FontAwesome5 name="plus-circle" size={20} color={'#ea4f52'} />
</TouchableOpacity>
{this.state.visits.length > 0 && (
<TouchableOpacity
style={styles.button}
onPress={() => this.deleteVisit()}>
<FontAwesome5 name="trash" size={20} color={'#ce3029'} />
<FontAwesome5 name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
)}
</View>
@ -634,10 +634,10 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly' }}>
{this.state.action === 'add' && (
<>
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ce3029'} />
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ea4f52'} />
</>
)}
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ce3029'} />
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ea4f52'} />
</View>
</View>
<Overlay
@ -671,9 +671,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showNewVisit: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ce3029'} />
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ea4f52'} />
</View>
</View>
</Overlay>
@ -707,9 +707,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showQRcodevCard: false, scanned: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ce3029'} />}
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ea4f52'} />}
</View>
</View>
</Overlay>
@ -814,7 +814,7 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showDynContact: false, scanned: false, parsedName: '', parsedFirstname: '', parsedEmail: '', parsedCompany: '', parsedAddress: '', parsedPhone: '' })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button
title={i18n.t('global.next')}
@ -834,7 +834,7 @@ class ContactDetailsScreen extends React.Component {
showDynContact: false,
scanned: false,
})}
color={'#ce3029'}
color={'#ea4f52'}
/>
</View>
</View>

View file

@ -174,7 +174,7 @@ class ContactScreen extends React.Component {
onPress={() => {
this.deleteContact(item.id);
}}>
<FontAwesome5 name="trash" size={20} color={'#ce3029'} />
<FontAwesome5 name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
@ -184,7 +184,7 @@ class ContactScreen extends React.Component {
contactToTransfer: item,
});
}}>
<FontAwesome5 name="paper-plane" size={20} color={'#ce3029'} />
<FontAwesome5 name="paper-plane" size={20} color={'#ea4f52'} />
</TouchableOpacity>
</View>
</View>
@ -291,7 +291,7 @@ class ContactScreen extends React.Component {
alignItems: 'center',
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.add')}
onPress={() =>
this.props.navigation.navigate('ContactDetailsScreen', {
@ -300,7 +300,7 @@ class ContactScreen extends React.Component {
}
/>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('contact_s.send_flyer')}
onPress={() => this.setState({ showSendBrochure: true })}
/>
@ -354,12 +354,12 @@ class ContactScreen extends React.Component {
width: 400,
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showTransferContact: false })}
/>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('contact_s.transfer')}
onPress={() => this.transferContact()}
/>
@ -514,7 +514,7 @@ class ContactScreen extends React.Component {
marginTop: 15,
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.cancel')}
onPress={() =>
this.setState({
@ -528,7 +528,7 @@ class ContactScreen extends React.Component {
})
}
/>
<Button title={i18n.t('global.send')} onPress={() => this.sendBrochure()} color={'#ce3029'} />
<Button title={i18n.t('global.send')} onPress={() => this.sendBrochure()} color={'#ea4f52'} />
</View>
</View>
</Overlay>

View file

@ -55,7 +55,7 @@ class LoginScreen extends React.Component {
<Button
title={i18n.t('global.login')}
onPress={() => this.login(this.state.login, this.state.password)}
color={'#ce3029'}
color={'#ea4f52'}
/>
</View>
</View>

View file

@ -48,12 +48,12 @@ class SyncScreen extends React.Component {
size={250}
progress={this.state.progress}
showsText={true}
color={'#ce3029'}
color={'#ea4f52'}
/>
<View style={styles.btnWrapper}>
<Button
disabled={this.state.processing}
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('sync_s.start_sync')}
onPress={() => this.sync()}
/>

View file

@ -21,7 +21,7 @@ class VideoScreen extends React.Component {
},
}}
showFullscreenButton={false}
sliderColor={'#ce3029'}
sliderColor={'#ea4f52'}
showControlsOnLoad={true}
/>
</View>

View file

@ -2,10 +2,10 @@ import NetInfo from '@react-native-community/netinfo';
import Constants from 'expo-constants';
const axios = require('axios');
const api_url = 'https://app.maitrecoq.fr';
const api_token = 'Np5smPey2q94HxY8xV27c2TN7C6VpC';
const api_url = 'https://app-intl.ldc.fr';
const api_token = 'gP8K77n4568UXYLV63bqykDRs8pyMy';
const endpoint = api_url + '/api';
const app_uuid = '1f6eda31-1f6d-49fe-aa81-4f0aece0f7ca';
const app_uuid = '746ceb52-2354-40d9-b270-57ca541f2751';
import UsersModel from '../Models/Users';
import DirectoriesModel from '../Models/Directories';

View file

@ -42,8 +42,8 @@
"password": "Passwort"
},
"home_s": {
"1": "Kataloge",
"2": "Datenblätter",
"1": "Die Gruppe",
"2": "Unsere Marken",
"3": "Andere"
},
"search_s": {
@ -108,29 +108,29 @@
},
"custom": {
"select-1": {
"title": "Type de commerce",
"c1": "Commerce de détail",
"title": "Art des Geschäfts",
"c1": "Einzelhandel",
"c2": "Home Service / Freezer Center",
"c3": "Restauration service à table",
"c4": "Fast food et snacking",
"c5": "Cafétaria / Self Service",
"c6": "Société de restauration",
"c7": "Restauration gré à gré / cuisine Centrale",
"c8": "Distributeur indépendant",
"c9": "Boulangerie pâtisserie",
"c10": "PAI",
"c11": "Destockeur",
"c12": "Commerce Halal",
"c13": "Restauration d'hébergement",
"c14": "Centrale restauration commerciale",
"c15": "Restauration évenementielle et parc",
"c16": "Restauration de transport",
"c17": "Marché public",
"c3": "Restauration Tischservice",
"c4": "Fast Food und Snacking",
"c5": "Cafeteria / Selbstbedienungsladen",
"c6": "Catering-Unternehmen",
"c7": "Freihändige Verpflegung / Centrale Küche",
"c8": "Unabhängiger Vertriebspartner",
"c9": "Bäckerei Konditorei",
"c10": "Lebensmittel Zwischenprodukte",
"c11": "Destocker",
"c12": "Halal-Handel",
"c13": "Verpflegung von Unterkünften",
"c14": "Zentrale Geschäftsrestauration",
"c15": "Catering und Park",
"c16": "Verpflegung von Transport",
"c17": "Öffentlicher Markt",
"c18": "Cash",
"c19": "Distributeur national",
"c19": "Nationaler Vertriebspartner",
"c20": "Rungis",
"c21": "Abbatoir",
"c22": "Autre"
"c21": "Schlachthof",
"c22": "Andere"
},
"select-2": {
"title": "Site",
@ -148,10 +148,10 @@
"c12": "Favreau"
},
"interest": {
"p1": "Poulet",
"p2": "Dinde",
"p3": "Canard",
"p4": "Autre"
"p1": "Huhn",
"p2": "Pute",
"p3": "Ente",
"p4": "Andere"
}
}
}

View file

@ -42,8 +42,8 @@
"password": "Password"
},
"home_s": {
"1": "Catalogs",
"2": "Data sheets",
"1": "The Group",
"2": "Our Brands",
"3": "Others"
},
"search_s": {
@ -108,29 +108,29 @@
},
"custom": {
"select-1": {
"title": "Type de commerce",
"c1": "Commerce de détail",
"title": "Type of business",
"c1": "Retail trade",
"c2": "Home Service / Freezer Center",
"c3": "Restauration service à table",
"c4": "Fast food et snacking",
"c5": "Cafétaria / Self Service",
"c6": "Société de restauration",
"c7": "Restauration gré à gré / cuisine Centrale",
"c8": "Distributeur indépendant",
"c9": "Boulangerie pâtisserie",
"c10": "PAI",
"c11": "Destockeur",
"c12": "Commerce Halal",
"c13": "Restauration d'hébergement",
"c14": "Centrale restauration commerciale",
"c15": "Restauration évenementielle et parc",
"c16": "Restauration de transport",
"c17": "Marché public",
"c3": "Catering table service",
"c4": "Fast food and snacking",
"c5": "Cafeteria / Self Service",
"c6": "Catering company",
"c7": "Contract catering / Central kitchen",
"c8": "Independent distributor",
"c9": "Bakery and pastry shop",
"c10": "Intermediate Food Products",
"c11": "Destocker",
"c12": "Halal trade",
"c13": "Accommodation catering",
"c14": "Commercial catering centre",
"c15": "Event catering and park",
"c16": "Restoration of transport",
"c17": "Public procurement",
"c18": "Cash",
"c19": "Distributeur national",
"c19": "National distributor",
"c20": "Rungis",
"c21": "Abbatoir",
"c22": "Autre"
"c21": "Slaughterhouse",
"c22": "Other"
},
"select-2": {
"title": "Site",
@ -148,10 +148,10 @@
"c12": "Favreau"
},
"interest": {
"p1": "Poulet",
"p2": "Dinde",
"p3": "Canard",
"p4": "Autre"
"p1": "Chicken",
"p2": "Turkey",
"p3": "Duck",
"p4": "Other"
}
}
}

View file

@ -42,8 +42,8 @@
"password": "Mot de passe"
},
"home_s": {
"1": "Catalogues",
"2": "Fiches techniques",
"1": "Le Groupe",
"2": "Nos Marques",
"3": "Autres"
},
"search_s": {

View file

@ -18,7 +18,7 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontSize: 18,
width: width / 4,
color: '#ce3029',
color: '#ea4f52',
fontWeight: 'bold'
},
company: {
@ -69,7 +69,7 @@ const styles = StyleSheet.create({
width: 50,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ce3029'
backgroundColor: '#ea4f52'
}
});

View file

@ -22,7 +22,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -3,7 +3,7 @@ import { StyleSheet } from 'react-native';
const styles = StyleSheet.create({
searchInput: {
borderWidth: 1,
borderColor: '#ce3029',
borderColor: '#ea4f52',
width: 200,
paddingLeft: 20,
},
@ -12,7 +12,7 @@ const styles = StyleSheet.create({
height: 50,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ce3029'
backgroundColor: '#ea4f52'
}
});

View file

@ -19,7 +19,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -19,7 +19,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -167,7 +167,7 @@ class ContactScreen extends React.Component {
onPress={() => {
this.deleteContact(item.id);
}}>
<Icon name="trash" size={20} color={'#ce3029'} />
<Icon name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
@ -177,7 +177,7 @@ class ContactScreen extends React.Component {
contactToTransfer: item,
});
}}>
<Icon name="paper-plane" size={20} color={'#ce3029'} />
<Icon name="paper-plane" size={20} color={'#ea4f52'} />
</TouchableOpacity>
</View>
</View>
@ -284,7 +284,7 @@ class ContactScreen extends React.Component {
alignItems: 'center',
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.add')}
onPress={() =>
this.props.navigation.navigate('ContactDetailsScreen', {
@ -293,7 +293,7 @@ class ContactScreen extends React.Component {
}
/>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('contact_s.send_flyer')}
onPress={() => this.setState({ showSendBrochure: true })}
/>
@ -347,12 +347,12 @@ class ContactScreen extends React.Component {
width: 400,
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showTransferContact: false })}
/>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('contact_s.transfer')}
onPress={() => this.transferContact()}
/>
@ -507,7 +507,7 @@ class ContactScreen extends React.Component {
marginTop: 15,
}}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('global.cancel')}
onPress={() =>
this.setState({
@ -521,7 +521,7 @@ class ContactScreen extends React.Component {
})
}
/>
<Button title={i18n.t('global.send')} onPress={() => this.sendBrochure()} color={'#ce3029'} />
<Button title={i18n.t('global.send')} onPress={() => this.sendBrochure()} color={'#ea4f52'} />
</View>
</View>
</Overlay>
@ -548,7 +548,7 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontSize: 18,
width: width / 4,
color: '#ce3029',
color: '#ea4f52',
fontWeight: 'bold'
},
company: {
@ -599,7 +599,7 @@ const styles = StyleSheet.create({
width: 50,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#ce3029'
backgroundColor: '#ea4f52'
}
});

View file

@ -344,7 +344,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.customer')}
checkedIcon="dot-circle-o"
@ -354,7 +354,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('client')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.prospect')}
checkedIcon="dot-circle-o"
@ -364,7 +364,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('prospect')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.other')}
checkedIcon="dot-circle-o"
@ -500,28 +500,28 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p1')}
checked={this.state.p1}
onPress={() => this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p2')}
checked={this.state.p2}
onPress={() => this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p3')}
checked={this.state.p3}
onPress={() => this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p4')}
checked={this.state.p4}
onPress={() => this.setState({ p4: !this.state.p4 })}
@ -533,7 +533,7 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flex: 1 }}>
<ButtonGroup
buttons={[i18n.t('contact_details_s.visits'), i18n.t('contact_details_s.notes')]}
selectedButtonStyle={{ backgroundColor: '#ce3029' }}
selectedButtonStyle={{ backgroundColor: '#ea4f52' }}
containerStyle={{ height: 30 }}
selectedIndex={this.state.selectedIndex}
onPress={index => this.setState({ selectedIndex: index })}
@ -585,13 +585,13 @@ class ContactDetailsScreen extends React.Component {
<TouchableOpacity
style={styles.button}
onPress={() => this.setState({ showNewVisit: true })}>
<Icon name="plus-circle" size={20} color={'#ce3029'} />
<Icon name="plus-circle" size={20} color={'#ea4f52'} />
</TouchableOpacity>
{this.state.visits.length > 0 && (
<TouchableOpacity
style={styles.button}
onPress={() => this.deleteVisit()}>
<Icon name="trash" size={20} color={'#ce3029'} />
<Icon name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
)}
</View>
@ -624,10 +624,10 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly' }}>
{this.state.action === 'add' && (
<>
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ce3029'} />
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ea4f52'} />
</>
)}
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ce3029'} />
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ea4f52'} />
</View>
</View>
<Overlay
@ -661,9 +661,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showNewVisit: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ce3029'} />
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ea4f52'} />
</View>
</View>
</Overlay>
@ -697,9 +697,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showQRcodevCard: false, scanned: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ce3029'} />}
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ea4f52'} />}
</View>
</View>
</Overlay>
@ -804,7 +804,7 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showDynContact: false, scanned: false, parsedName: '', parsedFirstname: '', parsedEmail: '', parsedCompany: '', parsedAddress: '', parsedPhone: '' })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button
title={i18n.t('global.next')}
@ -824,7 +824,7 @@ class ContactDetailsScreen extends React.Component {
showDynContact: false,
scanned: false,
})}
color={'#ce3029'}
color={'#ea4f52'}
/>
</View>
</View>

View file

@ -0,0 +1,877 @@
import React from 'react';
import {
View,
StyleSheet,
Button,
TextInput,
TouchableOpacity,
Text,
Alert,
ScrollView
} from 'react-native';
import { CheckBox, ButtonGroup, Overlay } from '@rneui/themed';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/FontAwesome';
import { showMessage } from 'react-native-flash-message';
import Helpers from "../Controllers/Helpers";
import i18n from "../I18n";
import { BarCodeScanner } from 'expo-barcode-scanner';
import vCard from 'vcard-parser';
import { Picker } from '@react-native-picker/picker';
function mapStateToProps(state) {
return {
contacts: state.contacts,
currentUser: state.currentUser,
};
}
let date = new Date().getDate();
if (date < 10) {
date = '0' + date.toString();
}
let month = new Date().getMonth() + 1;
if (month < 10) {
month = '0' + month.toString();
}
const year = new Date().getFullYear();
class ContactDetailsScreen extends React.Component {
state = {
action: 'add',
visits: [],
selectedVisit: 0,
tmpVisitNote: '',
newVisitTitle: date + '/' + month + '/' + year,
selectedIndex: 0,
showNewVisit: false,
tmpID: 0,
tmpNote: '',
tmpName: '',
tmpFirstname: '',
tmpEmail: '',
tmpCompany: '',
tmpAddress: '',
tmpPhone: '',
tmpSelect1: '',
tmpSelect2: '',
tmpOther: '',
clientChecked: false,
prospectChecked: false,
otherChecked: false,
p1: false,
p2: false,
p3: false,
p4: false,
p5: false,
p6: false,
p7: false,
p8: false,
p9: false,
showQRcodevCard: false,
parsedType: null,
parsedDatas: [],
hasPermission: null,
scanned: false,
showDynContact: false,
parsedName: '',
parsedFirstname: '',
parsedEmail: '',
parsedCompany: '',
parsedAddress: '',
parsedPhone: ''
};
updateContact() {
let error = '';
const { action } = this.props.route.params;
// On récupère le texte courant
if (this.state.visits.length > 0) {
this.state.visits[
this.state.selectedVisit
].note = this.state.tmpVisitNote;
}
let type;
if (this.state.clientChecked === true) {
type = 'client';
} else if (this.state.prospectChecked === true) {
type = 'prospect';
} else if (this.state.otherChecked === true) {
type = 'other';
if (this.state.tmpOther.length === 0) {
error = error.concat(i18n.t('error.fill_other_field') + '.\n');
}
} else {
error = error.concat(i18n.t('error.specify_type_contact') + '.\n');
}
if (this.state.tmpEmail.length < 5 || !Helpers.isEmailValid(this.state.tmpEmail)) {
error = error.concat(i18n.t('error.invalid_email_address') + '.\n');
}
if (this.state.tmpName.length === 0) {
error = error.concat(i18n.t('error.invalid_name') + '.\n');
}
if (this.state.tmpFirstname.length === 0) {
error = error.concat(i18n.t('error.invalid_firstname') + '.\n');
}
if (error.length > 0) {
Alert.alert(i18n.t('global.warning') + ' !', error, [
{ text: 'OK' },
],
{ cancelable: false },
);
} else {
const products = [
this.state.p1,
this.state.p2,
this.state.p3,
this.state.p4,
this.state.p5,
this.state.p6,
this.state.p7,
this.state.p8,
this.state.p9
];
const contact = {
id: Helpers.generateUUID(),
email: this.state.tmpEmail,
type: type,
other: this.state.tmpOther,
select1: this.state.tmpSelect1,
select2: this.state.tmpSelect2,
name: this.state.tmpName,
firstname: this.state.tmpFirstname,
company: this.state.tmpCompany,
address: this.state.tmpAddress,
phone: this.state.tmpPhone,
products: JSON.stringify(products),
notes: this.state.tmpNote,
visits: JSON.stringify(this.state.visits),
to_delete: false,
synced: false,
};
if (action === 'edit') {
contact.id = this.state.tmpID;
this.props.dispatch({ type: 'UPDATE_CONTACT', data: contact });
this.populate();
showMessage({
message: i18n.t('contact_details_s.contact_saved') + '.',
type: 'success',
duration: 500,
});
} else {
contact.user_id = this.props.currentUser.id;
this.props.dispatch({ type: 'ADD_CONTACT', data: contact });
this.props.navigation.navigate('ContactScreen', { contactAdded: true });
}
}
}
updateContactType(type) {
if (type === 'client') {
this.setState({
clientChecked: true,
prospectChecked: false,
otherChecked: false,
tmpOther: '',
});
} else if (type === 'prospect') {
this.setState({
clientChecked: false,
prospectChecked: true,
otherChecked: false,
tmpOther: '',
});
} else {
this.setState({
clientChecked: false,
prospectChecked: false,
otherChecked: true,
});
}
}
newVisit() {
this.state.visits.unshift({ title: this.state.newVisitTitle, note: '' });
this.state.visits[this.state.selectedVisit].note = this.state.tmpVisitNote;
this.setState({
tmpVisitNote: '',
visits: this.state.visits,
showNewVisit: false,
selectedVisit: 0,
});
}
deleteVisit() {
Alert.alert(
i18n.t('global.confirmation'),
i18n.t('contact_details_s.confirm_visit_delete'),
[
{
text: i18n.t('global.no'),
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{
text: i18n.t('global.yes'),
onPress: () => {
this.state.visits.splice(this.state.selectedVisit, 1);
if (this.state.visits.length === 0) {
this.setState({
visits: this.state.visits,
selectedVisit: 0,
tmpVisitNote: '',
});
} else {
this.setState({
visits: this.state.visits,
selectedVisit: 0,
tmpVisitNote: this.state.visits[0].note,
});
}
},
},
],
{ cancelable: false },
);
}
populate() {
const { contactId } = this.props.route.params;
const contact = this.props.contacts.filter(tmp => tmp.id === contactId)[0];
this.setState({
tmpID: contact.id,
tmpNote: contact.notes,
tmpName: contact.name,
tmpFirstname: contact.firstname,
tmpEmail: contact.email,
tmpCompany: contact.company,
tmpAddress: contact.address,
tmpPhone: contact.phone,
tmpSelect1: contact.select1,
tmpSelect2: contact.select2,
tmpOther: contact.other,
tmpProducts: contact.product,
});
if (contact.type === 'client') {
this.setState({ clientChecked: true });
} else if (contact.type === 'prospect') {
this.setState({ prospectChecked: true });
} else {
this.setState({ otherChecked: true });
}
if (contact.visits !== null) {
const tmp = JSON.parse(contact.visits);
this.setState({ visits: tmp });
if (tmp.length > 0) {
this.setState({ tmpVisitNote: tmp[this.state.selectedVisit].note });
}
}
if (contact.products !== null) {
const tmp = JSON.parse(contact.products);
this.setState({
p1: tmp[0],
p2: tmp[1],
p3: tmp[2],
p4: tmp[3],
p5: tmp[4],
p6: tmp[5],
p7: tmp[6],
p8: tmp[7],
p9: tmp[8],
p10: tmp[9],
});
}
}
componentDidMount() {
const { action } = this.props.route.params;
if (action === 'edit') {
this.setState({ action: 'edit' });
this.populate();
}
BarCodeScanner.requestPermissionsAsync().then(res => {
this.setState({ hasPermission: res.status === 'granted' });
});
}
render() {
const handleBarCodeScanned = ({ type, data }) => {
this.setState({ scanned: true });
if (data.includes('VCARD')) {
let datas = vCard.parse(data);
let tmpDatas = [];
if (datas['n'] !== undefined) {
const nx = Object.assign({ n1: [{ value: datas['n'][0].value[0] }] }, { n2: [{ value: datas['n'][0].value[1] }] });
datas = Object.assign(datas, nx);
}
if (datas['adr'] !== undefined) {
let tmp = datas['adr'][0].value;
let tmpadr = '';
for (let i = 0; i < tmp.length; i++) {
if (tmp[i].length > 0) {
if (tmpadr.length > 0) {
tmpadr = tmpadr + ', ' + tmp[i];
} else {
tmpadr = tmp[i];
}
}
}
datas['adr'] = [{ value: tmpadr }];
}
Object.keys(datas).map((objectKey, index) => {
if (objectKey === 'email' || objectKey === 'adr' || objectKey === 'tel' || objectKey === 'org' || objectKey === 'n1' || objectKey === 'n2') {
let value = datas[objectKey][0].value;
if (typeof value === 'string') {
tmpDatas.push(value);
}
}
});
this.setState({ parsedType: 'vcard', parsedDatas: tmpDatas, showQRcodevCard: false, showDynContact: true })
} else {
Alert.alert(i18n.t('contact_details_s.qrcode_not_vcard_format'));
}
};
return (
<View style={styles.container}>
<ScrollView style={{ flex: 1 }}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.customer')}
checkedIcon="dot-circle-o"
uncheckedIcon="circle-o"
checked={this.state.clientChecked}
containerStyle={styles.clearRadio}
onPress={() => this.updateContactType('client')}
/>
<CheckBox
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.prospect')}
checkedIcon="dot-circle-o"
uncheckedIcon="circle-o"
checked={this.state.prospectChecked}
containerStyle={styles.clearRadio}
onPress={() => this.updateContactType('prospect')}
/>
<CheckBox
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.other')}
checkedIcon="dot-circle-o"
uncheckedIcon="circle-o"
checked={this.state.otherChecked}
containerStyle={styles.clearRadio}
onPress={() => this.updateContactType('other')}
/>
{this.state.otherChecked === true && (
<TextInput
style={{
backgroundColor: 'white',
margin: 10,
padding: 10,
flex: 2,
}}
value={this.state.tmpOther}
placeholder={i18n.t('contact_details_s.description')}
onChangeText={text => this.setState({ tmpOther: text })}
/>
)}
</View>
<View style={{ flexDirection: 'row' }}>
<TextInput
style={{ backgroundColor: 'white', margin: 10, padding: 10, flex: 1 }}
value={this.state.tmpName}
placeholder={i18n.t('global.name') + ' (' + i18n.t('global.required') + ')'}
onChangeText={text => this.setState({ tmpName: text })}
/>
<TextInput
style={{ backgroundColor: 'white', margin: 10, padding: 10, flex: 1 }}
value={this.state.tmpFirstname}
placeholder={i18n.t('global.firstname') + ' (' + i18n.t('global.required') + ')'}
onChangeText={text => this.setState({ tmpFirstname: text })}
/>
</View>
<TextInput
style={styles.input}
value={this.state.tmpEmail}
placeholder={i18n.t('global.email') + ' (' + i18n.t('global.required') + ')'}
onChangeText={text => this.setState({ tmpEmail: text })}
autoCapitalize={'none'}
autoCorrect={false}
keyboardType={'email-address'}
/>
<TextInput
style={styles.input}
value={this.state.tmpCompany}
placeholder={i18n.t('global.company')}
onChangeText={text => this.setState({ tmpCompany: text })}
/>
<TextInput
style={styles.input}
value={this.state.tmpAddress}
placeholder={i18n.t('global.address')}
onChangeText={text => this.setState({ tmpAddress: text })}
/>
<TextInput
style={styles.input}
value={this.state.tmpPhone}
placeholder={i18n.t('global.phone')}
onChangeText={text => this.setState({ tmpPhone: text })}
autoCompleteType={'tel'}
dataDetectorTypes={'phoneNumber'}
keyboardType={'phone-pad'}
/>
<View style={{ flexDirection: 'row' }}>
<View style={{ flex: 1, flexDirection: 'row' }}>
<Icon name="sort-down" size={20} color={'black'} style={{ zIndex: 1, position: 'absolute', right: 25, top: 20 }} />
<Picker
selectedValue={this.state.tmpSelect1}
style={styles.select}
onValueChange={(itemValue, itemIndex) => {
if (itemValue !== '0') {
this.setState({ tmpSelect1: itemValue });
}
}}>
<Picker.Item label={i18n.t('custom.select-1.title')} value="0" />
<Picker.Item label={i18n.t('custom.select-1.c1')} value="commerce-de-detail" />
<Picker.Item label={i18n.t('custom.select-1.c2')} value={'home-service-freezer-center'} />
<Picker.Item label={i18n.t('custom.select-1.c3')} value={'restauration-service-a-table'} />
<Picker.Item label={i18n.t('custom.select-1.c4')} value={'fast-food-et-snacking'} />
<Picker.Item label={i18n.t('custom.select-1.c5')} value={'cafetaria-self-service'} />
<Picker.Item label={i18n.t('custom.select-1.c6')} value={'societe-de-restauration'} />
<Picker.Item label={i18n.t('custom.select-1.c7')} value={'restauration-gre-a-gre-cuisine-centrale'} />
<Picker.Item label={i18n.t('custom.select-1.c8')} value={'distributeur-independant'} />
<Picker.Item label={i18n.t('custom.select-1.c9')} value={'boulangerie-patisserie'} />
<Picker.Item label={i18n.t('custom.select-1.c10')} value={'pai'} />
<Picker.Item label={i18n.t('custom.select-1.c11')} value={'destockeur'} />
<Picker.Item label={i18n.t('custom.select-1.c12')} value={'commerce-halal'} />
<Picker.Item label={i18n.t('custom.select-1.c13')} value={'restauration-d-hebergement'} />
<Picker.Item label={i18n.t('custom.select-1.c14')} value={'centrale-restauration-commerciale'} />
<Picker.Item label={i18n.t('custom.select-1.c15')} value={'restauration-evenementielle-et-parc'} />
<Picker.Item label={i18n.t('custom.select-1.c16')} value={'restauration-de-transport'} />
<Picker.Item label={i18n.t('custom.select-1.c17')} value={'marche-public'} />
<Picker.Item label={i18n.t('custom.select-1.c18')} value={'cash'} />
<Picker.Item label={i18n.t('custom.select-1.c19')} value={'distributeur-national'} />
<Picker.Item label={i18n.t('custom.select-1.c20')} value={'rungis'} />
<Picker.Item label={i18n.t('custom.select-1.c21')} value={'abbatoir'} />
<Picker.Item label={i18n.t('custom.select-1.c22')} value={'autre'} />
</Picker>
</View>
<View style={{ flex: 1, flexDirection: 'row' }}>
<Icon name="sort-down" size={20} color={'black'} style={{ zIndex: 1, position: 'absolute', right: 25, top: 20 }} />
<Picker
selectedValue={this.state.tmpSelect2}
style={styles.select}
onValueChange={(itemValue, itemIndex) => {
if (itemValue !== '0') {
this.setState({ tmpSelect2: itemValue });
}
}}>
<Picker.Item label={i18n.t('custom.select-2.title')} value="0" />
<Picker.Item label={i18n.t('custom.select-2.c1')} value={'celvia-dinde'} />
<Picker.Item label={i18n.t('custom.select-2.c2')} value={'celvia-elabores'} />
<Picker.Item label={i18n.t('custom.select-2.c3')} value={'celvia-serent'} />
<Picker.Item label={i18n.t('custom.select-2.c4')} value={'procanar'} />
<Picker.Item label={i18n.t('custom.select-2.c5')} value={'celtys'} />
<Picker.Item label={i18n.t('custom.select-2.c6')} value={'farmor'} />
<Picker.Item label={i18n.t('custom.select-2.c7')} value={'robichon'} />
<Picker.Item label={i18n.t('custom.select-2.c8')} value={'les-volailles-de-keranna'} />
<Picker.Item label={i18n.t('custom.select-2.c9')} value={'bosher-volaille'} />
<Picker.Item label={i18n.t('custom.select-2.c10')} value={'ldc-bretagne'} />
<Picker.Item label={i18n.t('custom.select-2.c11')} value={'doux-farmor'} />
<Picker.Item label={i18n.t('custom.select-2.c12')} value={'favreau'} />
</Picker>
</View>
</View>
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p1')}
checked={this.state.p1}
onPress={() => this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p2')}
checked={this.state.p2}
onPress={() => this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p3')}
checked={this.state.p3}
onPress={() => this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p4')}
checked={this.state.p4}
onPress={() => this.setState({ p4: !this.state.p4 })}
containerStyle={styles.clearCheckbox}
/>
</View>
</ScrollView>
<View style={{ flex: 1, margin: 5 }}>
<View style={{ flex: 1 }}>
<ButtonGroup
buttons={[i18n.t('contact_details_s.visits'), i18n.t('contact_details_s.notes')]}
selectedButtonStyle={{ backgroundColor: '#ea4f52' }}
containerStyle={{ height: 30 }}
selectedIndex={this.state.selectedIndex}
onPress={index => this.setState({ selectedIndex: index })}
/>
{this.state.selectedIndex === 0 && (
<View style={{ flex: 1 }}>
<View style={{ flexDirection: 'row' }}>
{this.state.visits.length > 0 && (
<View style={{ flex: 2, flexDirection: 'row' }}>
<Icon name="sort-down" size={20} color={'black'} style={{ zIndex: 1, position: 'absolute', right: 25, top: 20 }} />
<Picker
style={styles.select}
selectedValue={this.state.selectedVisit}
onValueChange={(itemValue, itemIndex) => {
this.state.visits[
this.state.selectedVisit
].note = this.state.tmpVisitNote;
this.setState({
visits: this.state.visits,
selectedVisit: itemIndex,
tmpVisitNote: this.state.visits[itemIndex].note,
});
}}>
{this.state.visits.map((item, index) => {
return <Picker.Item label={item.title} value={index} />;
})}
</Picker>
</View>
)}
{this.state.visits.length === 0 && (
<View
style={{
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
}}>
<Text>{i18n.t('contact_details_s.no_visits')}.</Text>
</View>
)}
<View
style={{
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-evenly',
margin: 10,
}}>
<TouchableOpacity
style={styles.button}
onPress={() => this.setState({ showNewVisit: true })}>
<Icon name="plus-circle" size={20} color={'#ea4f52'} />
</TouchableOpacity>
{this.state.visits.length > 0 && (
<TouchableOpacity
style={styles.button}
onPress={() => this.deleteVisit()}>
<Icon name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
)}
</View>
</View>
{this.state.visits.length > 0 && (
<TextInput
style={styles.textArea}
underlineColorAndroid="transparent"
placeholder={i18n.t('contact_details_s.notes') + '...'}
placeholderTextColor="grey"
multiline={true}
value={this.state.tmpVisitNote}
onChangeText={text => this.setState({ tmpVisitNote: text })}
/>
)}
</View>
)}
{this.state.selectedIndex === 1 && (
<TextInput
style={styles.textArea}
underlineColorAndroid="transparent"
placeholder={i18n.t('contact_details_s.notes') + '...'}
placeholderTextColor="grey"
multiline={true}
value={this.state.tmpNote}
onChangeText={text => this.setState({ tmpNote: text })}
/>
)}
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly' }}>
{this.state.action === 'add' && (
<>
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ea4f52'} />
</>
)}
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ea4f52'} />
</View>
</View>
<Overlay
isVisible={this.state.showNewVisit}
windowBackgroundColor="rgba(255, 255, 255, .9)"
overlayBackgroundColor="white"
width={400}
height={300}>
<View
style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text style={{ marginBottom: 10 }}>{i18n.t('contact_details_s.visit_name')} :</Text>
<TextInput
placeholder={i18n.t('contact_details_s.visit_name')}
value={this.state.newVisitTitle}
onChangeText={text => this.setState({ newVisitTitle: text })}
style={{
borderWidth: 1,
borderColor: 'lightgrey',
width: 300,
marginBottom: 15,
paddingLeft: 10,
}}
/>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-evenly',
alignItems: 'center',
width: 400,
}}>
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showNewVisit: false })}
color={'#ea4f52'}
/>
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ea4f52'} />
</View>
</View>
</Overlay>
<Overlay
isVisible={this.state.showQRcodevCard}
windowBackgroundColor="rgba(255, 255, 255, .9)"
overlayBackgroundColor="white"
width={400}
height={300}>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
{this.state.hasPermission === true && (
<BarCodeScanner
onBarCodeScanned={this.state.scanned ? undefined : handleBarCodeScanned}
barCodeTypes={[BarCodeScanner.Constants.BarCodeType.qr]}
style={{ flex: 1, width: 380, height: 200 }}
/>
)}
{this.state.hasPermission === false && (
<Text>{i18n.t('error.camera_permission_denied')}.</Text>
)}
{this.state.hasPermission === null && (
<Text>{i18n.t('error.pending_camera_permission')}.</Text>
)}
<View
style={{
flexDirection: 'row',
justifyContent: 'space-evenly',
alignItems: 'center',
width: 400,
}}>
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showQRcodevCard: false, scanned: false })}
color={'#ea4f52'}
/>
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ea4f52'} />}
</View>
</View>
</Overlay>
<Overlay
isVisible={this.state.showDynContact}
windowBackgroundColor="rgba(255, 255, 255, .9)"
overlayBackgroundColor="white"
width={400}
height={400}>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'space-evenly' }}>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.name')}</Text>
<Picker
selectedValue={this.state.parsedName}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) => {
this.setState({ parsedName: itemValue });
}}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.firstname')}</Text>
<Picker
selectedValue={this.state.parsedFirstname}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ parsedFirstname: itemValue })
}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.email')}</Text>
<Picker
selectedValue={this.state.parsedEmail}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ parsedEmail: itemValue })
}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.company')}</Text>
<Picker
selectedValue={this.state.parsedCompany}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ parsedCompany: itemValue })
}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.address')}</Text>
<Picker
selectedValue={this.state.parsedAddress}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ parsedAddress: itemValue })
}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<Text style={{ flex: 1, paddingLeft: 10 }}>{i18n.t('global.phone')}</Text>
<Picker
selectedValue={this.state.parsedPhone}
style={{ height: 50, width: 250 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ parsedPhone: itemValue })
}>
<Picker.Item label="" value="0" key={0} />
{this.state.parsedType === 'vcard' && this.state.parsedDatas.map((item, index) => {
return <Picker.Item label={item} value={item} key={(index + 1).toString()} />;
})}
</Picker>
</View>
<View
style={{
flexDirection: 'row',
justifyContent: 'space-evenly',
alignItems: 'center',
width: 400,
}}>
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showDynContact: false, scanned: false, parsedName: '', parsedFirstname: '', parsedEmail: '', parsedCompany: '', parsedAddress: '', parsedPhone: '' })}
color={'#ea4f52'}
/>
<Button
title={i18n.t('global.next')}
onPress={() => this.setState({
tmpName: this.state.parsedName,
tmpFirstname: this.state.parsedFirstname,
tmpEmail: this.state.parsedEmail,
tmpCompany: this.state.parsedCompany,
tmpAddress: this.state.parsedAddress,
tmpPhone: this.state.parsedPhone,
parsedName: '',
parsedFirstname: '',
parsedEmail: '',
parsedCompany: '',
parsedAddress: '',
parsedPhone: '',
showDynContact: false,
scanned: false,
})}
color={'#ea4f52'}
/>
</View>
</View>
</Overlay>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
},
input: {
backgroundColor: 'white',
margin: 10,
padding: 10,
},
clearCheckbox: {
backgroundColor: '#00000000',
borderWidth: 0,
},
clearRadio: {
flex: 1,
backgroundColor: '#00000000',
borderWidth: 0,
},
select: {
flex: 2,
margin: 10,
backgroundColor: 'white',
},
textArea: {
flex: 1,
margin: 10,
padding: 10,
backgroundColor: 'white',
textAlignVertical: 'top',
},
button: {
width: 35,
height: 35,
justifyContent: 'center',
alignItems: 'center',
margin: 2,
},
});
export default connect(mapStateToProps)(ContactDetailsScreen);

View file

@ -343,7 +343,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.customer')}
checkedIcon="dot-circle-o"
@ -353,7 +353,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('client')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.prospect')}
checkedIcon="dot-circle-o"
@ -363,7 +363,7 @@ class ContactDetailsScreen extends React.Component {
onPress={() => this.updateContactType('prospect')}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
center
title={i18n.t('contact_details_s.other')}
checkedIcon="dot-circle-o"
@ -480,63 +480,63 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p1')}
checked={this.state.p1}
onPress={() => this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p2')}
checked={this.state.p2}
onPress={() => this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p3')}
checked={this.state.p3}
onPress={() => this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p4')}
checked={this.state.p4}
onPress={() => this.setState({ p4: !this.state.p4 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p5')}
checked={this.state.p5}
onPress={() => this.setState({ p5: !this.state.p5 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p6')}
checked={this.state.p6}
onPress={() => this.setState({ p6: !this.state.p6 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p7')}
checked={this.state.p7}
onPress={() => this.setState({ p7: !this.state.p7 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p8')}
checked={this.state.p8}
onPress={() => this.setState({ p8: !this.state.p8 })}
containerStyle={styles.clearCheckbox}
/>
<CheckBox
checkedColor={'#ce3029'}
checkedColor={'#ea4f52'}
title={i18n.t('custom.interest.p9')}
checked={this.state.p9}
onPress={() => this.setState({ p9: !this.state.p9 })}
@ -548,7 +548,7 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flex: 1 }}>
<ButtonGroup
buttons={[i18n.t('contact_details_s.visits'), i18n.t('contact_details_s.notes')]}
selectedButtonStyle={{ backgroundColor: '#ce3029' }}
selectedButtonStyle={{ backgroundColor: '#ea4f52' }}
containerStyle={{ height: 30 }}
selectedIndex={this.state.selectedIndex}
onPress={index => this.setState({ selectedIndex: index })}
@ -600,13 +600,13 @@ class ContactDetailsScreen extends React.Component {
<TouchableOpacity
style={styles.button}
onPress={() => this.setState({ showNewVisit: true })}>
<Icon name="plus-circle" size={20} color={'#ce3029'} />
<Icon name="plus-circle" size={20} color={'#ea4f52'} />
</TouchableOpacity>
{this.state.visits.length > 0 && (
<TouchableOpacity
style={styles.button}
onPress={() => this.deleteVisit()}>
<Icon name="trash" size={20} color={'#ce3029'} />
<Icon name="trash" size={20} color={'#ea4f52'} />
</TouchableOpacity>
)}
</View>
@ -639,10 +639,10 @@ class ContactDetailsScreen extends React.Component {
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly' }}>
{this.state.action === 'add' && (
<>
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ce3029'} />
<Button title="QRCode vCard" onPress={() => this.setState({ showQRcodevCard: true })} color={'#ea4f52'} />
</>
)}
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ce3029'} />
<Button title={i18n.t('global.save')} onPress={() => this.updateContact()} color={'#ea4f52'} />
</View>
</View>
<Overlay
@ -676,9 +676,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showNewVisit: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ce3029'} />
<Button title={i18n.t('global.add')} onPress={() => this.newVisit()} color={'#ea4f52'} />
</View>
</View>
</Overlay>
@ -712,9 +712,9 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showQRcodevCard: false, scanned: false })}
color={'#ce3029'}
color={'#ea4f52'}
/>
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ce3029'} />}
{this.state.scanned && <Button title={i18n.t('global.retry')} onPress={() => this.setState({ scanned: false })} color={'#ea4f52'} />}
</View>
</View>
</Overlay>
@ -819,7 +819,7 @@ class ContactDetailsScreen extends React.Component {
<Button
title={i18n.t('global.cancel')}
onPress={() => this.setState({ showDynContact: false, scanned: false, parsedName: '', parsedFirstname: '', parsedEmail: '', parsedCompany: '', parsedAddress: '', parsedPhone: '' })}
color={'#ce3029'}
color={'#ea4f52'}
/>
<Button
title={i18n.t('global.next')}
@ -839,7 +839,7 @@ class ContactDetailsScreen extends React.Component {
showDynContact: false,
scanned: false,
})}
color={'#ce3029'}
color={'#ea4f52'}
/>
</View>
</View>

View file

@ -99,7 +99,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -59,10 +59,6 @@ class HomeScreen extends React.Component {
<Image source={require('../assets/img/guillemets.png')} style={styles.btnImg} />
<Text style={styles.btnTxt}>{i18n.t('home_s.2')}</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.openFolder(4)} style={styles.button}>
<Image source={require('../assets/img/guillemets.png')} style={styles.btnImg} />
<Text style={styles.btnTxt}>{i18n.t('home_s.3')}</Text>
</TouchableOpacity>
<TouchableOpacity onPress={() => this.props.navigation.navigate('OnlyVideosScreen')} style={styles.button}>
<Image source={require('../assets/img/guillemets.png')} style={styles.btnImg} />
<Text style={styles.btnTxt}>{i18n.t('global.videos')}</Text>

View file

@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { verify } from 'react-native-b-crypt-bridge';
import Sync from '../Controllers/Sync';
import CommonModel from '../Models/Common';
//import SplashScreen from 'react-native-splash-screen';
import * as SplashScreen from 'expo-splash-screen';
import NetInfo from "@react-native-community/netinfo";
import i18n from "../I18n";
@ -22,7 +22,7 @@ class LoginScreen extends React.Component {
};
componentDidMount(): void {
//SplashScreen.hide();
SplashScreen.hideAsync();
}
login(login, password) {
@ -92,7 +92,7 @@ class LoginScreen extends React.Component {
return (
<View style={{ marginTop: 20 }}>
<Button
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('login_s.install')}
onPress={() =>
this.props.navigation.navigate('SyncScreen', { isInstalled: false })
@ -132,7 +132,7 @@ class LoginScreen extends React.Component {
<Button
title={i18n.t('global.login')}
onPress={() => this.login(this.state.login, this.state.password)}
color={'#ce3029'}
color={'#ea4f52'}
/>
</View>
)}

View file

@ -80,7 +80,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -96,7 +96,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
backgroundColor: '#ce3029',
backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {

View file

@ -289,12 +289,12 @@ class SyncScreen extends React.Component {
size={250}
progress={this.state.progress}
showsText={true}
color={'#ce3029'}
color={'#ea4f52'}
/>
<View style={{marginTop: 20}}>
<Button
disabled={this.state.processing}
color={'#ce3029'}
color={'#ea4f52'}
title={i18n.t('sync_s.start_sync')}
onPress={() => this.checkConnection()}
/>

View file

@ -7,31 +7,38 @@ import { ResizeMode } from 'expo-av';
class VideoScreen extends React.Component {
state = {
height: Dimensions.get("window").height - 100
}
render() {
console.log("render")
const { uuid } = this.props.route.params;
let width = Dimensions.get("window").width;
let height = Dimensions.get("window").height;
// if portrait
if (height > width) {
let tmpHeight = height;
height = width - 150;
width = tmpHeight + 100;
} else {
height = height - 100;
}
return (
<View>
<View style={{ flex: 1, backgroundColor: 'black' }}>
<VideoPlayer
defaultControlsVisible={true}
fullscreen={{
visible: false
}}
slider={{
minimumTrackTintColor: '#ce3029',
thumbTintColor: '#ce3029',
minimumTrackTintColor: '#ea4f52',
thumbTintColor: '#ea4f52',
}}
style={{
height: this.state.height
height: height,
width: width
}}
videoProps={{
shouldPlay: true,
resizeMode: ResizeMode.COVER,
resizeMode: ResizeMode.CONTAIN,
source: {
uri: FileSystem.documentDirectory + uuid + '.mp4',
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB