2022-10-10 11:51:31 +02:00
|
|
|
import 'react-native-gesture-handler';
|
2022-09-28 18:08:39 +02:00
|
|
|
import React from 'react';
|
2022-10-10 11:51:31 +02:00
|
|
|
import { createStore } from 'redux';
|
2022-10-04 19:02:39 +02:00
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
|
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
2022-10-10 11:51:31 +02:00
|
|
|
import { TouchableOpacity, View, Image, Text, TextInput, StyleSheet, Alert } from 'react-native';
|
|
|
|
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
|
|
|
|
|
|
|
|
|
import FlashMessage, { showMessage } from 'react-native-flash-message';
|
2022-10-10 12:51:36 +02:00
|
|
|
import * as SplashScreen from 'expo-splash-screen';
|
2022-10-10 11:51:31 +02:00
|
|
|
|
|
|
|
|
import LoginScreen from './Views/Login';
|
|
|
|
|
import HomeScreen from './Views/Home';
|
|
|
|
|
import DirectoriesScreen from './Views/Directories';
|
|
|
|
|
import VideoScreen from './Views/Video';
|
|
|
|
|
import PDFScreen from './Views/PDF';
|
|
|
|
|
import SyncScreen from './Views/Sync';
|
|
|
|
|
import ContactScreen from './Views/Contact';
|
|
|
|
|
import ContactDetailsScreen from './Views/ContactDetails';
|
|
|
|
|
import OnlyVideosScreen from './Views/OnlyVideos';
|
|
|
|
|
import SearchScreen from "./Views/Search";
|
|
|
|
|
import MySpaceScreen from './Views/MySpace';
|
|
|
|
|
|
|
|
|
|
import UsersModel from './Models/Users';
|
|
|
|
|
import DirectoriesModel from './Models/Directories';
|
|
|
|
|
import DocumentsModel from './Models/Documents';
|
|
|
|
|
import ContactsModel from './Models/Contacts';
|
|
|
|
|
import SendBrochureModel from './Models/SendBrochure';
|
|
|
|
|
import CommonModel from './Models/Common';
|
|
|
|
|
|
|
|
|
|
import Sync from './Controllers/Sync';
|
|
|
|
|
import Helpers from "./Controllers/Helpers";
|
2022-10-04 19:02:39 +02:00
|
|
|
import i18n from "./I18n";
|
|
|
|
|
|
2022-10-10 12:51:36 +02:00
|
|
|
SplashScreen.preventAutoHideAsync();
|
|
|
|
|
|
2022-10-10 11:51:31 +02:00
|
|
|
const initialState = {
|
|
|
|
|
locale: 'fr',
|
|
|
|
|
users: {},
|
|
|
|
|
directories: {},
|
|
|
|
|
documents: {},
|
|
|
|
|
contacts: {},
|
|
|
|
|
syncVersion: 0,
|
|
|
|
|
logged: undefined,
|
|
|
|
|
currentUser: {},
|
|
|
|
|
currentOpenedDoc: {},
|
|
|
|
|
ShowIsActive: 0,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function reducer(state = initialState, action) {
|
|
|
|
|
//console.log('reducer', state, action);
|
|
|
|
|
//console.log('DISPATCH');
|
|
|
|
|
|
|
|
|
|
switch (action.type) {
|
|
|
|
|
case 'INIT':
|
|
|
|
|
let docs = DocumentsModel.getAll(DirectoriesModel.getAll(
|
|
|
|
|
state.currentUser.role,
|
|
|
|
|
state.currentUser.authorizedFolders,
|
|
|
|
|
false,
|
|
|
|
|
state.locale
|
|
|
|
|
));
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
users: UsersModel.getAll(),
|
|
|
|
|
directories: DirectoriesModel.getAll(
|
|
|
|
|
state.currentUser.role,
|
|
|
|
|
state.currentUser.authorizedFolders,
|
|
|
|
|
true,
|
|
|
|
|
state.locale
|
|
|
|
|
),
|
|
|
|
|
documents: docs.filter(item => item.lang === state.locale),
|
|
|
|
|
contacts: ContactsModel.getByUser(state.currentUser.id),
|
|
|
|
|
ShowIsActive: CommonModel.get('ShowIsActive')['value'],
|
|
|
|
|
};
|
|
|
|
|
case 'INIT_USERS':
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
users: UsersModel.getAll(),
|
|
|
|
|
};
|
|
|
|
|
case 'SET_CURRENT_USER':
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
currentUser: JSON.parse(action.data),
|
|
|
|
|
};
|
|
|
|
|
case 'SET_LOGGED':
|
|
|
|
|
if (action.data === false) {
|
|
|
|
|
CommonModel.delete('isLogged');
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
logged: action.data,
|
|
|
|
|
};
|
|
|
|
|
case 'UPDATE_LOCALE':
|
|
|
|
|
let nxt;
|
|
|
|
|
if (action.data === undefined) {
|
|
|
|
|
const availableLocales = ['fr', 'en', 'de'];
|
|
|
|
|
if (availableLocales.indexOf(i18n.locale) === availableLocales.length - 1) {
|
|
|
|
|
nxt = availableLocales[0];
|
|
|
|
|
} else {
|
|
|
|
|
nxt = availableLocales[availableLocales.indexOf(i18n.locale) + 1];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
nxt = action.data;
|
|
|
|
|
}
|
|
|
|
|
i18n.locale = nxt;
|
|
|
|
|
CommonModel.update({ key: 'locale', value: nxt });
|
|
|
|
|
let docsL = DocumentsModel.getAll(DirectoriesModel.getAll(
|
|
|
|
|
state.currentUser.role,
|
|
|
|
|
state.currentUser.authorizedFolders,
|
|
|
|
|
false,
|
|
|
|
|
nxt
|
|
|
|
|
));
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
locale: nxt,
|
|
|
|
|
directories: DirectoriesModel.getAll(
|
|
|
|
|
state.currentUser.role,
|
|
|
|
|
state.currentUser.authorizedFolders,
|
|
|
|
|
true,
|
|
|
|
|
nxt
|
|
|
|
|
),
|
|
|
|
|
documents: docsL.filter(item => item.lang === nxt),
|
|
|
|
|
};
|
|
|
|
|
case 'SET_CURRENT_OPENED_DOC':
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
currentOpenedDoc: action.data
|
|
|
|
|
};
|
|
|
|
|
case 'UPDATE_VERSION':
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
syncVersion: action.data,
|
|
|
|
|
};
|
|
|
|
|
case 'UPDATE_SHOW_IS_ACTIVE':
|
|
|
|
|
Sync.updateShowIsActive(action.data);
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
ShowIsActive: action.data,
|
|
|
|
|
};
|
|
|
|
|
case 'UPDATE_CONTACT':
|
|
|
|
|
ContactsModel.update(action.data);
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
contacts: ContactsModel.getByUser(state.currentUser.id),
|
|
|
|
|
};
|
|
|
|
|
case 'ADD_CONTACT':
|
|
|
|
|
ContactsModel.add(action.data);
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
contacts: ContactsModel.getByUser(state.currentUser.id),
|
|
|
|
|
};
|
|
|
|
|
case 'DELETE_CONTACT':
|
|
|
|
|
ContactsModel.delete(action.data);
|
|
|
|
|
return {
|
|
|
|
|
...state,
|
|
|
|
|
contacts: ContactsModel.getByUser(state.currentUser.id),
|
|
|
|
|
};
|
|
|
|
|
case 'SEND_BROCHURE':
|
|
|
|
|
SendBrochureModel.add(action.data);
|
|
|
|
|
return state;
|
|
|
|
|
default:
|
|
|
|
|
return state;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const store = createStore(reducer);
|
2022-10-04 19:02:39 +02:00
|
|
|
const Stack = createNativeStackNavigator();
|
|
|
|
|
|
2022-10-06 16:25:15 +02:00
|
|
|
store.dispatch({ type: 'INIT_USERS' });
|
|
|
|
|
|
|
|
|
|
class App extends React.Component {
|
2022-10-04 19:02:39 +02:00
|
|
|
state = {
|
|
|
|
|
logged: false,
|
|
|
|
|
searchTxt: '',
|
|
|
|
|
sendEmail: '',
|
|
|
|
|
ShowIsActive: '0'
|
|
|
|
|
};
|
|
|
|
|
|
2022-10-10 11:51:31 +02:00
|
|
|
componentDidMount(): void {
|
|
|
|
|
const unsubscribe = store.subscribe(this.handleChange.bind(this));
|
|
|
|
|
if (Sync.isInstalled() && Sync.isLogged()) {
|
2022-10-06 16:25:15 +02:00
|
|
|
store.dispatch({
|
|
|
|
|
type: 'SET_CURRENT_USER',
|
2022-10-10 11:51:31 +02:00
|
|
|
data: CommonModel.get('isLogged').value,
|
2022-10-06 16:25:15 +02:00
|
|
|
});
|
|
|
|
|
store.dispatch({ type: 'SET_LOGGED', data: true });
|
|
|
|
|
}
|
2022-10-10 11:51:31 +02:00
|
|
|
const savedLocale = CommonModel.get('locale');
|
2022-10-06 16:25:15 +02:00
|
|
|
if (savedLocale !== undefined && savedLocale !== false) {
|
|
|
|
|
store.dispatch({ type: 'UPDATE_LOCALE', data: savedLocale.value });
|
|
|
|
|
}
|
2022-10-04 19:02:39 +02:00
|
|
|
}
|
2022-09-28 18:08:39 +02:00
|
|
|
|
2022-10-10 11:51:31 +02:00
|
|
|
handleChange() {
|
|
|
|
|
const logged = store.getState().logged;
|
|
|
|
|
if (logged === false) {
|
|
|
|
|
CommonModel.delete('isLogged');
|
|
|
|
|
}
|
|
|
|
|
if (logged !== undefined) {
|
|
|
|
|
this.setState({ logged: logged });
|
|
|
|
|
}
|
|
|
|
|
this.setState({ ShowIsActive: store.getState().ShowIsActive });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogoTitle(title) {
|
|
|
|
|
return (
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
|
<Image
|
|
|
|
|
style={{ width: 100, height: 50, resizeMode: 'stretch' }}
|
|
|
|
|
source={require('./assets/img/logo.png')}
|
|
|
|
|
/>
|
|
|
|
|
<Text style={{ marginLeft: 10, fontSize: 18 }}>{title}</Text>
|
|
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SendEmail() {
|
|
|
|
|
return (
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center', marginRight: 10 }}>
|
|
|
|
|
<TextInput style={styles.searchInput} placeholder={i18n.t('global.email')} value={this.state.sendEmail} onChangeText={(text) => this.setState({ sendEmail: text })} />
|
|
|
|
|
<TouchableOpacity style={styles.btnSearch} onPress={() => {
|
|
|
|
|
if (this.state.sendEmail.length > 0) {
|
|
|
|
|
if (Helpers.isEmailValid(this.state.sendEmail)) {
|
|
|
|
|
const email = {
|
|
|
|
|
email: this.state.sendEmail,
|
|
|
|
|
subject: i18n.t('app.file_sharing'),
|
|
|
|
|
message: '',
|
|
|
|
|
documents: JSON.stringify([store.getState().currentOpenedDoc]),
|
|
|
|
|
user_id: store.getState().currentUser.id
|
|
|
|
|
};
|
|
|
|
|
store.dispatch({ type: 'SEND_BROCHURE', data: email });
|
|
|
|
|
showMessage({
|
|
|
|
|
message: i18n.t('global.message_sent') + '.',
|
|
|
|
|
description: i18n.t('global.message_will_be_sent_after_sync') + '.',
|
|
|
|
|
type: 'success',
|
|
|
|
|
duration: 1500,
|
|
|
|
|
});
|
|
|
|
|
this.setState({ sendEmail: '' });
|
|
|
|
|
} else {
|
|
|
|
|
Alert.alert(i18n.t('global.warning') + ' !', i18n.t('error.invalid_email_address') + '.', [
|
|
|
|
|
{ text: 'OK' },
|
|
|
|
|
],
|
|
|
|
|
{ cancelable: false },
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}}>
|
|
|
|
|
<Icon name={'paper-plane'} size={20} color={'white'} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-06 16:25:15 +02:00
|
|
|
render() {
|
2022-10-10 11:51:31 +02:00
|
|
|
const savedLocale = CommonModel.get('locale');
|
2022-10-06 16:25:15 +02:00
|
|
|
let locale;
|
|
|
|
|
if (savedLocale !== undefined) {
|
|
|
|
|
locale = savedLocale.value;
|
|
|
|
|
} else {
|
2022-10-10 11:51:31 +02:00
|
|
|
locale = store.getState().locale;
|
2022-10-06 16:25:15 +02:00
|
|
|
}
|
|
|
|
|
let flag;
|
2022-10-10 11:51:31 +02:00
|
|
|
switch (locale) {
|
|
|
|
|
case "fr":
|
|
|
|
|
flag = require('./assets/img/flags/fr.png');
|
2022-10-04 19:02:39 +02:00
|
|
|
break;
|
2022-10-10 11:51:31 +02:00
|
|
|
case "en":
|
|
|
|
|
flag = require('./assets/img/flags/en.png');
|
2022-10-04 19:02:39 +02:00
|
|
|
break;
|
2022-10-10 11:51:31 +02:00
|
|
|
case "de":
|
|
|
|
|
flag = require('./assets/img/flags/de.png');
|
2022-10-04 19:02:39 +02:00
|
|
|
break;
|
2022-10-10 11:51:31 +02:00
|
|
|
case "es":
|
|
|
|
|
flag = require('./assets/img/flags/es.png');
|
2022-10-04 19:02:39 +02:00
|
|
|
break;
|
2022-10-10 11:51:31 +02:00
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<NavigationContainer>
|
|
|
|
|
<Stack.Navigator>
|
|
|
|
|
{this.state.logged === false ? (
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="LoginScreen"
|
|
|
|
|
component={LoginScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
|
|
|
|
headerTitle: () => this.LogoTitle(i18n.t('global.login')),
|
|
|
|
|
headerRight: () => (
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() => {
|
|
|
|
|
store.dispatch({ type: 'UPDATE_LOCALE' });
|
|
|
|
|
this.setState({ state: this.state }); // to force re-rendering
|
|
|
|
|
}}
|
|
|
|
|
style={{ marginRight: 15 }}>
|
|
|
|
|
<Image source={flag} style={{ width: 25, height: 25 }} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
2022-10-06 16:25:15 +02:00
|
|
|
<Stack.Screen
|
|
|
|
|
name="HomeScreen"
|
|
|
|
|
component={HomeScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
2022-10-10 11:51:31 +02:00
|
|
|
headerTitle: () => this.LogoTitle(i18n.t('global.home')),
|
2022-10-06 16:25:15 +02:00
|
|
|
headerRight: () => (
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
|
<View style={{ flexDirection: 'row', marginRight: 50 }}>
|
|
|
|
|
<TextInput style={styles.searchInput} placeholder={i18n.t('global.search')} value={this.state.searchTxt} onChangeText={(text) => this.setState({ searchTxt: text })} />
|
|
|
|
|
<TouchableOpacity style={styles.btnSearch} onPress={() => {
|
|
|
|
|
if (this.state.searchTxt.length > 0) {
|
|
|
|
|
navigation.navigation.navigate('SearchScreen', {
|
|
|
|
|
needle: this.state.searchTxt,
|
|
|
|
|
onlyVideos: false,
|
|
|
|
|
});
|
|
|
|
|
this.setState({ searchTxt: '' });
|
|
|
|
|
}
|
|
|
|
|
}}>
|
2022-10-10 11:51:31 +02:00
|
|
|
<Icon name={'search'} size={20} color={'white'} />
|
2022-10-06 16:25:15 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() => {
|
|
|
|
|
store.dispatch({ type: 'UPDATE_LOCALE' });
|
|
|
|
|
}}
|
2022-10-10 16:52:03 +02:00
|
|
|
style={{ marginRight: 25 }}>
|
2022-10-06 16:25:15 +02:00
|
|
|
<Image source={flag} style={{ width: 25, height: 25 }} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
{this.state.ShowIsActive === '1' && (
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() => navigation.navigation.navigate('MySpaceScreen')}
|
2022-10-10 16:52:03 +02:00
|
|
|
style={{ marginRight: 25 }}>
|
2022-10-10 11:51:31 +02:00
|
|
|
<Icon name="user-circle" size={25} />
|
2022-10-06 16:25:15 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
)}
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() =>
|
|
|
|
|
navigation.navigation.navigate('SyncScreen', {
|
|
|
|
|
isInstalled: true,
|
|
|
|
|
})
|
|
|
|
|
}
|
2022-10-10 16:52:03 +02:00
|
|
|
style={{ marginRight: 25 }}>
|
2022-10-10 11:51:31 +02:00
|
|
|
<Icon name="sync-alt" size={20} />
|
2022-10-06 16:25:15 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() => {
|
|
|
|
|
store.dispatch({ type: 'SET_LOGGED', data: false });
|
|
|
|
|
}}
|
2022-10-10 16:52:03 +02:00
|
|
|
style={{ marginRight: 25 }}>
|
2022-10-10 11:51:31 +02:00
|
|
|
<Icon name="sign-out-alt" size={20} />
|
2022-10-06 16:25:15 +02:00
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
2022-10-10 11:51:31 +02:00
|
|
|
),
|
2022-10-06 16:25:15 +02:00
|
|
|
})}
|
|
|
|
|
/>
|
2022-10-10 11:51:31 +02:00
|
|
|
)}
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="SyncScreen"
|
|
|
|
|
component={SyncScreen}
|
|
|
|
|
options={{ headerTitle: () => this.LogoTitle(i18n.t('global.synchronization')) }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="DirectoriesScreen"
|
|
|
|
|
component={DirectoriesScreen}
|
|
|
|
|
options={{ headerTitle: () => this.LogoTitle(i18n.t('app.folders')) }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="OnlyVideosScreen"
|
|
|
|
|
component={OnlyVideosScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
|
|
|
|
headerTitle: () => this.LogoTitle(i18n.t('global.videos')),
|
|
|
|
|
headerRight: () => (
|
|
|
|
|
<View style={{ flexDirection: 'row', marginRight: 5 }}>
|
|
|
|
|
<TextInput style={styles.searchInput} placeholder={i18n.t('global.search')} value={this.state.searchTxt} onChangeText={(text) => this.setState({ searchTxt: text })} />
|
|
|
|
|
<TouchableOpacity style={styles.btnSearch} onPress={() => {
|
|
|
|
|
if (this.state.searchTxt.length > 0) {
|
|
|
|
|
navigation.navigation.navigate('SearchScreen', {
|
|
|
|
|
needle: this.state.searchTxt,
|
|
|
|
|
onlyVideos: true,
|
|
|
|
|
});
|
|
|
|
|
this.setState({ searchTxt: '' });
|
|
|
|
|
}
|
|
|
|
|
}}>
|
|
|
|
|
<Icon name={'search'} size={20} color={'white'} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="VideoScreen"
|
|
|
|
|
component={VideoScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
|
|
|
|
headerTitle: () => this.LogoTitle(i18n.t('app.video')),
|
2022-10-10 16:52:03 +02:00
|
|
|
headerRight: () => this.SendEmail(),
|
|
|
|
|
orientation: 'landscape'
|
2022-10-10 11:51:31 +02:00
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="PDFScreen"
|
|
|
|
|
component={PDFScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
|
|
|
|
headerTitle: () => this.LogoTitle('PDF'),
|
|
|
|
|
headerRight: () => this.SendEmail()
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="ContactScreen"
|
|
|
|
|
component={ContactScreen}
|
|
|
|
|
options={{ headerTitle: () => this.LogoTitle(i18n.t('global.contacts')) }}
|
|
|
|
|
initialParams={{ contactAdded: false }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="ContactDetailsScreen"
|
|
|
|
|
component={ContactDetailsScreen}
|
|
|
|
|
options={{ headerTitle: () => this.LogoTitle(i18n.t('app.contact_details')) }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="SearchScreen"
|
|
|
|
|
component={SearchScreen}
|
|
|
|
|
options={{ headerTitle: () => this.LogoTitle(i18n.t('app.results_search')) }}
|
|
|
|
|
/>
|
|
|
|
|
<Stack.Screen
|
|
|
|
|
name="MySpaceScreen"
|
|
|
|
|
component={MySpaceScreen}
|
|
|
|
|
options={(navigation, route) => ({
|
|
|
|
|
headerTitle: () => this.LogoTitle(i18n.t('app.my_space')),
|
|
|
|
|
headerRight: () => (
|
|
|
|
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
|
<TouchableOpacity
|
|
|
|
|
onPress={() => {
|
2022-10-10 16:52:03 +02:00
|
|
|
const folder = store.getState().directories.filter(tmp => tmp.id === 1);
|
2022-10-10 11:51:31 +02:00
|
|
|
navigation.navigation.navigate('DirectoriesScreen', { folder: folder })
|
|
|
|
|
}}
|
|
|
|
|
style={{ marginRight: 15 }}>
|
|
|
|
|
<Icon name="briefcase" size={20} />
|
|
|
|
|
</TouchableOpacity>
|
|
|
|
|
</View>
|
|
|
|
|
),
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
</Stack.Navigator>
|
|
|
|
|
<FlashMessage position="top" />
|
|
|
|
|
</NavigationContainer>
|
|
|
|
|
</Provider>
|
|
|
|
|
);
|
2022-10-06 16:25:15 +02:00
|
|
|
}
|
2022-10-10 11:51:31 +02:00
|
|
|
}
|
2022-10-07 18:27:54 +02:00
|
|
|
|
2022-10-10 11:51:31 +02:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
|
searchInput: {
|
|
|
|
|
borderWidth: 1,
|
2022-10-10 16:52:03 +02:00
|
|
|
borderColor: '#ea4f52',
|
2022-10-10 11:51:31 +02:00
|
|
|
width: 200,
|
|
|
|
|
paddingLeft: 20,
|
|
|
|
|
},
|
|
|
|
|
btnSearch: {
|
|
|
|
|
width: 50,
|
|
|
|
|
height: 50,
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
2022-10-10 16:52:03 +02:00
|
|
|
backgroundColor: '#ea4f52'
|
2022-10-07 18:27:54 +02:00
|
|
|
}
|
2022-10-10 11:51:31 +02:00
|
|
|
});
|
2022-09-28 18:08:39 +02:00
|
|
|
|
2022-10-10 11:51:31 +02:00
|
|
|
export default App;
|