diff --git a/ComApp/src/App.js b/ComApp/src/App.js
index 49afa7e..225cd9e 100644
--- a/ComApp/src/App.js
+++ b/ComApp/src/App.js
@@ -13,6 +13,8 @@ import FlashMessage, { showMessage } from 'react-native-flash-message';
import * as SplashScreen from 'expo-splash-screen';
// i18n
import i18n from "./I18n";
+// FileSytem
+import * as FileSystem from 'expo-file-system';
// Controllers
import SyncController from './App/Controllers/SyncController';
// Views
@@ -28,6 +30,8 @@ import ContactScreen from './App/Views/ContactScreen';
import ContactDetailsScreen from './App/Views/ContactDetailsScreen';
import SearchScreen from "./App/Views/SearchScreen";
import MySpaceScreen from './App/Views/MySpaceScreen';
+// Style
+import styles from './Resources/Styles/NavigationStyle';
// END V2
// V2
//SplashScreen.preventAutoHideAsync(); //Keep
@@ -44,7 +48,8 @@ class App extends React.Component {
isSetup: false,
isLogged: false,
searchTxt: '',
- sendEmail: ''
+ sendEmail: '',
+ mainColor: ''
};
componentDidMount() {
@@ -63,6 +68,7 @@ class App extends React.Component {
this.setState({
isSetup: store.getState().app.isSetup,
isLogged: store.getState().app.logged,
+ mainColor: store.getState().app.mainColor
}); // to force re-rendering
console.log("state changed")
}
@@ -77,7 +83,7 @@ class App extends React.Component {
name="InstallScreen"
component={InstallScreen}
options={(navigation, route) => ({
- headerTitle: () => this.LogoTitle(navigation, i18n.t('install.installation')),
+ headerTitle: () => this.LogoTitle(navigation, i18n.t('install.installation'), false),
headerRight: () => (
({
- headerTitle: () => this.LogoTitle(navigation, i18n.t('global.login')),
+ headerTitle: () => this.LogoTitle(navigation, i18n.t('global.login'), false),
headerRight: () => (
(
- this.setState({ searchTxt: text })} />
- {
+ this.setState({ searchTxt: text })}
+ />
+ {
if (this.state.searchTxt.length > 0) {
navigation.navigation.navigate('SearchScreen', {
needle: this.state.searchTxt,
@@ -189,8 +202,8 @@ class App extends React.Component {
headerTitle: () => this.LogoTitle(navigation, i18n.t('global.videos')),
headerRight: () => (
- this.setState({ searchTxt: text })} />
- {
+ this.setState({ searchTxt: text })} />
+ {
if (this.state.searchTxt.length > 0) {
navigation.navigation.navigate('SearchScreen', {
needle: this.state.searchTxt,
@@ -270,14 +283,25 @@ class App extends React.Component {
);
}
- LogoTitle(navigation, title) {
+ LogoTitle(navigation, title, wantBtn = true) {
return (
- { navigation.navigation.navigate('HomeScreen') }}>
-
+ {
+ if (wantBtn) {
+ navigation.navigation.navigate('HomeScreen')
+ }
+ }}>
+ {this.state.isSetup ? (
+
+ ) : (
+
+ )}
{title}
@@ -287,8 +311,8 @@ class App extends React.Component {
SendEmail() {
return (
- this.setState({ sendEmail: text })} />
- {
+ this.setState({ sendEmail: text })} />
+ {
if (this.state.sendEmail.length > 0) {
if (Helpers.isEmailValid(this.state.sendEmail)) {
const email = {
@@ -342,20 +366,4 @@ class App extends React.Component {
}
-const styles = StyleSheet.create({
- searchInput: {
- borderWidth: 1,
- borderColor: '#ea4f52',
- width: 200,
- paddingLeft: 20,
- },
- btnSearch: {
- width: 50,
- height: 50,
- alignItems: 'center',
- justifyContent: 'center',
- backgroundColor: '#ea4f52'
- }
-});
-
export default App;
diff --git a/ComApp/src/App/Store/Reducers/AppReducer.js b/ComApp/src/App/Store/Reducers/AppReducer.js
index b2eb8ba..53115e2 100644
--- a/ComApp/src/App/Store/Reducers/AppReducer.js
+++ b/ComApp/src/App/Store/Reducers/AppReducer.js
@@ -11,6 +11,7 @@ const initialState = {
currentOpenedDoc: {},
ShowIsActive: 0,
HomeBtns: {},
+ mainColor: '#ea4f52'
};
const reducer = (state = initialState, action) => {
@@ -18,11 +19,13 @@ const reducer = (state = initialState, action) => {
switch (action.type) {
case 'INIT':
let ShowIsActive = Setting.get('ShowIsActive');
+ let MainColor = Setting.get('MainColor');
saved = Setting.get('isSetup');
return {
...state,
isSetup: saved === undefined ? false : saved.value === "true" ? true : false,
- ShowIsActive: ShowIsActive === undefined ? false : ShowIsActive.value
+ ShowIsActive: ShowIsActive === undefined ? false : ShowIsActive.value,
+ mainColor: MainColor === undefined ? initialState.mainColor : MainColor === false ? initialState.mainColor : MainColor.value
};
case 'INIT_HOME_BTNS': {
let HomeFolders = Setting.get('HomeFolders');
diff --git a/ComApp/src/App/Views/ContactDetailsScreen.js b/ComApp/src/App/Views/ContactDetailsScreen.js
index 2244625..a551884 100644
--- a/ComApp/src/App/Views/ContactDetailsScreen.js
+++ b/ComApp/src/App/Views/ContactDetailsScreen.js
@@ -34,6 +34,7 @@ function mapStateToProps(state) {
return {
contacts: state.contacts,
currentUser: state.app.currentUser,
+ mainColor: state.app.mainColor
};
}
@@ -361,7 +362,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
this.updateContactType('client')}
/>
this.updateContactType('prospect')}
/>
this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p4: !this.state.p4 })}
@@ -550,7 +551,7 @@ class ContactDetailsScreen extends React.Component {
this.setState({ selectedIndex: index })}
@@ -602,13 +603,13 @@ class ContactDetailsScreen extends React.Component {
this.setState({ showNewVisit: true })}>
-
+
{this.state.visits.length > 0 && (
this.deleteVisit()}>
-
+
)}
@@ -641,10 +642,10 @@ class ContactDetailsScreen extends React.Component {
{this.state.action === 'add' && (
<>
-
this.setState({ showNewVisit: false })}
- color={'#ea4f52'}
+ color={this.props.mainColor}
/>
- this.newVisit()} color={'#ea4f52'} />
+ this.newVisit()} color={this.props.mainColor} />
@@ -714,9 +715,9 @@ class ContactDetailsScreen extends React.Component {
this.setState({ showQRcodevCard: false, scanned: false })}
- color={'#ea4f52'}
+ color={this.props.mainColor}
/>
- {this.state.scanned && this.setState({ scanned: false })} color={'#ea4f52'} />}
+ {this.state.scanned && this.setState({ scanned: false })} color={this.props.mainColor} />}
@@ -821,7 +822,7 @@ class ContactDetailsScreen extends React.Component {
this.setState({ showDynContact: false, scanned: false, parsedName: '', parsedFirstname: '', parsedEmail: '', parsedCompany: '', parsedAddress: '', parsedPhone: '' })}
- color={'#ea4f52'}
+ color={this.props.mainColor}
/>
diff --git a/ComApp/src/App/Views/ContactScreen.js b/ComApp/src/App/Views/ContactScreen.js
index 9449517..800942a 100644
--- a/ComApp/src/App/Views/ContactScreen.js
+++ b/ComApp/src/App/Views/ContactScreen.js
@@ -33,6 +33,7 @@ function mapStateToProps(state) {
contacts: state.contacts,
documents: state.documents,
currentUser: state.app.currentUser,
+ mainColor: state.app.mainColor
};
}
@@ -172,7 +173,7 @@ class ContactScreen extends React.Component {
contactId: item.id,
})
}>
-
+
{item.name.toUpperCase()} {item.firstname}
@@ -184,7 +185,7 @@ class ContactScreen extends React.Component {
onPress={() => {
this.deleteContactAction(item.id);
}}>
-
+
-
+
@@ -221,12 +222,12 @@ class ContactScreen extends React.Component {
{
this.sortContacts('name');
}}>
- {i18n.t('global.name')}
+ {i18n.t('global.name')}
{
this.sortContacts('company');
}}>
- {i18n.t('global.company')}
+ {i18n.t('global.company')}
{i18n.t('global.email')}
@@ -301,7 +302,7 @@ class ContactScreen extends React.Component {
alignItems: 'center',
}}>
this.props.navigation.navigate('ContactDetailsScreen', {
@@ -310,13 +311,13 @@ class ContactScreen extends React.Component {
}
/>
this.setState({ showSendBrochure: true })}
/>
this.handleSearchTxt(text)} />
- this.handleSearchBtn()}>
+ this.handleSearchBtn()}>
{this.state.searchTxt.length > 0 ? (
) : (
@@ -364,12 +365,12 @@ class ContactScreen extends React.Component {
width: 400,
}}>
this.setState({ showTransferContact: false })}
/>
this.transferContact()}
/>
@@ -524,7 +525,7 @@ class ContactScreen extends React.Component {
marginTop: 15,
}}>
this.setState({
@@ -538,7 +539,7 @@ class ContactScreen extends React.Component {
})
}
/>
- this.sendBrochure()} color={'#ea4f52'} />
+ this.sendBrochure()} color={this.props.mainColor} />
diff --git a/ComApp/src/App/Views/DirectoriesScreen.js b/ComApp/src/App/Views/DirectoriesScreen.js
index 7394e75..7b3e600 100644
--- a/ComApp/src/App/Views/DirectoriesScreen.js
+++ b/ComApp/src/App/Views/DirectoriesScreen.js
@@ -23,6 +23,7 @@ function mapStateToProps(state) {
documents: state.documents,
directories: state.directories,
locale: state.locale.locale,
+ mainColor: state.app.mainColor
};
}
@@ -37,7 +38,7 @@ class DirectoriesScreen extends React.Component {
return (
this.openDocument(document)}>
{document.type === 'pdf' ? (
@@ -59,7 +60,6 @@ class DirectoriesScreen extends React.Component {
rightImage={{ uri: Image.resolveAssetSource(arrowDown).uri }}
containerStyle={styles.treeviewContainer}
onClick={folder => {
- console.log(folder, this.props.documents)
this.setState({
documents: this.props.documents.filter(
tmp => tmp.directory === folder.id,
diff --git a/ComApp/src/App/Views/HomeScreen.js b/ComApp/src/App/Views/HomeScreen.js
index 0e1089b..eee21cf 100644
--- a/ComApp/src/App/Views/HomeScreen.js
+++ b/ComApp/src/App/Views/HomeScreen.js
@@ -45,10 +45,15 @@ class HomeScreen extends React.Component {
render() {
i18n.locale = this.props.locale;
return (
-
+
{this.renderBtns()}
- this.props.navigation.navigate('OnlyVideosScreen')} style={styles.button}>
+ {
+ this.props.initDocuments(this.props.locale, this.props.directories.global);
+ this.props.navigation.navigate('OnlyVideosScreen');
+ }}
+ style={styles.button}>
{i18n.t('global.videos')}
diff --git a/ComApp/src/App/Views/LoginScreen.js b/ComApp/src/App/Views/LoginScreen.js
index adfc837..f4760d1 100644
--- a/ComApp/src/App/Views/LoginScreen.js
+++ b/ComApp/src/App/Views/LoginScreen.js
@@ -22,6 +22,7 @@ function mapStateToProps(state) {
app: state.app,
users: state.users.users,
locale: state.locale.locale,
+ mainColor: state.app.mainColor
};
}
@@ -69,7 +70,7 @@ class LoginScreen extends React.Component {
this.login(this.state.login, this.state.password)}
- color={'#ea4f52'}
+ color={this.props.mainColor}
/>
diff --git a/ComApp/src/App/Views/OnlyVideosScreen.js b/ComApp/src/App/Views/OnlyVideosScreen.js
index 19b2ccc..fb9c4f6 100644
--- a/ComApp/src/App/Views/OnlyVideosScreen.js
+++ b/ComApp/src/App/Views/OnlyVideosScreen.js
@@ -15,6 +15,7 @@ import styles from '../../Resources/Styles/OnlyVideosStyle';
function mapStateToProps(state) {
return {
documents: state.documents,
+ mainColor: state.app.mainColor
};
}
@@ -32,7 +33,7 @@ class OnlyVideosScreen extends React.Component {
return (
{
this.props.dispatch({ type: 'SET_CURRENT_OPENED_DOC', data: document });
this.props.navigation.navigate('VideoScreen', { uuid: document.uuid });
diff --git a/ComApp/src/App/Views/SearchScreen.js b/ComApp/src/App/Views/SearchScreen.js
index 9e76caa..b029450 100644
--- a/ComApp/src/App/Views/SearchScreen.js
+++ b/ComApp/src/App/Views/SearchScreen.js
@@ -19,6 +19,7 @@ import styles from '../../Resources/Styles/SearchStyle';
function mapStateToProps(state) {
return {
documents: state.documents,
+ mainColor: state.app.mainColor
};
}
@@ -57,7 +58,7 @@ class SearchScreen extends React.Component {
return (
this.openDocument(document)}>
{document.type === 'pdf' ? (
diff --git a/ComApp/src/App/Views/SyncScreen.js b/ComApp/src/App/Views/SyncScreen.js
index 87f07d6..0effa4d 100644
--- a/ComApp/src/App/Views/SyncScreen.js
+++ b/ComApp/src/App/Views/SyncScreen.js
@@ -66,12 +66,12 @@ class SyncScreen extends React.Component {
size={250}
progress={this.state.progress}
showsText={true}
- color={'#ea4f52'}
+ color={this.props.mainColor}
/>
this.sync()}
/>
diff --git a/ComApp/src/App/Views/VideoScreen.js b/ComApp/src/App/Views/VideoScreen.js
index 6b0ec69..7eb42c9 100644
--- a/ComApp/src/App/Views/VideoScreen.js
+++ b/ComApp/src/App/Views/VideoScreen.js
@@ -1,11 +1,19 @@
import React from 'react';
import { View, Dimensions } from 'react-native';
+// Reduxs
+import { connect } from 'react-redux';
// FileSytem
import * as FileSystem from 'expo-file-system';
// Video
import { ResizeMode } from 'expo-av';
import VideoPlayer from 'expo-video-player';
+function mapStateToProps(state) {
+ return {
+ mainColor: state.app.mainColor
+ };
+}
+
class VideoScreen extends React.Component {
render() {
const { uuid } = this.props.route.params;
@@ -28,8 +36,8 @@ class VideoScreen extends React.Component {
visible: false
}}
slider={{
- minimumTrackTintColor: '#ea4f52',
- thumbTintColor: '#ea4f52',
+ minimumTrackTintColor: this.props.mainColor,
+ thumbTintColor: this.props.mainColor,
}}
style={{
height: height,
@@ -48,4 +56,4 @@ class VideoScreen extends React.Component {
}
}
-export default VideoScreen;
+export default connect(mapStateToProps)(VideoScreen);
\ No newline at end of file
diff --git a/ComApp/src/Resources/CommonStyles.js b/ComApp/src/Resources/CommonStyles.js
index c5f4257..2df8c77 100644
--- a/ComApp/src/Resources/CommonStyles.js
+++ b/ComApp/src/Resources/CommonStyles.js
@@ -1,19 +1,19 @@
import { StyleSheet } from 'react-native';
const commonStyles = StyleSheet.create({
- background: {
- width: '100%',
- height: '100%'
+ background: {
+ flex: 1,
+ justifyContent: "center"
},
- textInput: {
- height: 40,
- width: 300,
- borderColor: 'grey',
- borderWidth: 1,
- marginBottom: 20,
- backgroundColor: 'white',
- paddingLeft: 10
- }
+ textInput: {
+ height: 40,
+ width: 300,
+ borderColor: 'grey',
+ borderWidth: 1,
+ marginBottom: 20,
+ backgroundColor: 'white',
+ paddingLeft: 10
+ }
});
export default commonStyles;
\ No newline at end of file
diff --git a/ComApp/src/Resources/Styles/ContactStyle.js b/ComApp/src/Resources/Styles/ContactStyle.js
index 6d2f1d8..5a9776f 100644
--- a/ComApp/src/Resources/Styles/ContactStyle.js
+++ b/ComApp/src/Resources/Styles/ContactStyle.js
@@ -18,7 +18,6 @@ const styles = StyleSheet.create({
textAlign: 'center',
fontSize: 18,
width: width / 4,
- color: '#ea4f52',
fontWeight: 'bold'
},
company: {
@@ -68,8 +67,7 @@ const styles = StyleSheet.create({
btnSearch: {
width: 50,
alignItems: 'center',
- justifyContent: 'center',
- backgroundColor: '#ea4f52'
+ justifyContent: 'center'
}
});
diff --git a/ComApp/src/Resources/Styles/DirectoriesStyle.js b/ComApp/src/Resources/Styles/DirectoriesStyle.js
index 71b6344..224481f 100644
--- a/ComApp/src/Resources/Styles/DirectoriesStyle.js
+++ b/ComApp/src/Resources/Styles/DirectoriesStyle.js
@@ -22,7 +22,6 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
- backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {
diff --git a/ComApp/src/Resources/Styles/NavigationStyle.js b/ComApp/src/Resources/Styles/NavigationStyle.js
index c901ded..5ddb758 100644
--- a/ComApp/src/Resources/Styles/NavigationStyle.js
+++ b/ComApp/src/Resources/Styles/NavigationStyle.js
@@ -3,7 +3,6 @@ import { StyleSheet } from 'react-native';
const styles = StyleSheet.create({
searchInput: {
borderWidth: 1,
- borderColor: '#ea4f52',
width: 200,
paddingLeft: 20,
},
@@ -12,7 +11,6 @@ const styles = StyleSheet.create({
height: 50,
alignItems: 'center',
justifyContent: 'center',
- backgroundColor: '#ea4f52'
}
});
diff --git a/ComApp/src/Resources/Styles/OnlyVideosStyle.js b/ComApp/src/Resources/Styles/OnlyVideosStyle.js
index ba6a5fa..7cefdb5 100644
--- a/ComApp/src/Resources/Styles/OnlyVideosStyle.js
+++ b/ComApp/src/Resources/Styles/OnlyVideosStyle.js
@@ -19,7 +19,6 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
- backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {
diff --git a/ComApp/src/Resources/Styles/SearchStyle.js b/ComApp/src/Resources/Styles/SearchStyle.js
index ba6a5fa..7cefdb5 100644
--- a/ComApp/src/Resources/Styles/SearchStyle.js
+++ b/ComApp/src/Resources/Styles/SearchStyle.js
@@ -19,7 +19,6 @@ const styles = StyleSheet.create({
alignItems: 'center',
height: 200,
width: 180,
- backgroundColor: '#ea4f52',
margin: 10,
},
fileTxt: {
diff --git a/ComApp/src/Views/ContactDetails.js b/ComApp/src/Views/ContactDetails.js
index 161e7e1..6135ed2 100644
--- a/ComApp/src/Views/ContactDetails.js
+++ b/ComApp/src/Views/ContactDetails.js
@@ -344,7 +344,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
this.updateContactType('client')}
/>
this.updateContactType('prospect')}
/>
this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p4: !this.state.p4 })}
diff --git a/ComApp/src/Views/ContactDetails_MC.js b/ComApp/src/Views/ContactDetails_MC.js
index 7302dfa..2414324 100644
--- a/ComApp/src/Views/ContactDetails_MC.js
+++ b/ComApp/src/Views/ContactDetails_MC.js
@@ -344,7 +344,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
this.updateContactType('client')}
/>
this.updateContactType('prospect')}
/>
this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p4: !this.state.p4 })}
diff --git a/ComApp/src/Views/ContactDetails_RHD.js b/ComApp/src/Views/ContactDetails_RHD.js
index eb487c3..724a6d1 100644
--- a/ComApp/src/Views/ContactDetails_RHD.js
+++ b/ComApp/src/Views/ContactDetails_RHD.js
@@ -343,7 +343,7 @@ class ContactDetailsScreen extends React.Component {
justifyContent: 'center',
}}>
this.updateContactType('client')}
/>
this.updateContactType('prospect')}
/>
this.setState({ p1: !this.state.p1 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p2: !this.state.p2 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p3: !this.state.p3 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p4: !this.state.p4 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p5: !this.state.p5 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p6: !this.state.p6 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p7: !this.state.p7 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p8: !this.state.p8 })}
containerStyle={styles.clearCheckbox}
/>
this.setState({ p9: !this.state.p9 })}