import React from 'react'; import { View, ImageBackground, TouchableOpacity, Text, Image } from 'react-native'; // Common Styles import commonStyles from '../../Resources/CommonStyles'; // Redux import { connect } from 'react-redux'; // Style import styles from '../../Resources/Styles/HomeStyle'; // Translations import i18n from "../../I18n"; // FileSytem import * as FileSystem from 'expo-file-system'; function mapStateToProps(state) { return { directories: state.app.directories, locale: state.app.locale, }; } class HomeScreen extends React.Component { componentDidMount() { this.props.dispatch({ type: 'INIT' }); } render() { i18n.locale = this.props.locale; return ( this.openFolder(2)} style={styles.button}> {i18n.t('global.videos')} this.props.navigation.navigate('OnlyVideosScreen')} style={styles.button}> {i18n.t('global.videos')} this.props.navigation.navigate('ContactScreen')} style={styles.button}> {i18n.t('global.contacts')} ); } openFolder(id) { const folder = this.props.directories.filter(tmp => tmp.id === id); this.props.navigation.navigate('DirectoriesScreen', { folder: folder }); } } export default connect(mapStateToProps)(HomeScreen);