54 lines
No EOL
2 KiB
JavaScript
54 lines
No EOL
2 KiB
JavaScript
import React from 'react';
|
|
import { View, ImageBackground, TouchableOpacity, Text, Image } from 'react-native';
|
|
// Common Styles
|
|
import commonStyles from '../../Resources/CommonStyles';
|
|
// Style
|
|
import styles from '../../Resources/Styles/HomeStyle';
|
|
// Translations
|
|
import i18n from "../../I18n";
|
|
// FileSytem
|
|
import * as FileSystem from 'expo-file-system';
|
|
// Database
|
|
import { Setting } from "../../Database";
|
|
import _ from 'lodash';
|
|
|
|
class HomeScreen extends React.Component {
|
|
|
|
render() {
|
|
let buttons = Setting.get("HomeFolders");
|
|
buttons = JSON.parse(buttons.value);
|
|
//console.log(typeof Object.values(buttons))
|
|
const arr = [1, 2, 3]
|
|
return (
|
|
<ImageBackground source={{ uri: FileSystem.documentDirectory + 'BackgroundImage.png' }} style={commonStyles.background}>
|
|
<View style={styles.container}>
|
|
{/* {this.getHomeButton()} */}
|
|
<TouchableOpacity onPress={() => { }} style={styles.button}>
|
|
<Image source={{ uri: FileSystem.documentDirectory + 'HomeButtonImage.png' }} style={styles.btnImg} />
|
|
<Text style={styles.btnTxt}>{i18n.t('global.videos')}</Text>
|
|
</TouchableOpacity>
|
|
<TouchableOpacity onPress={() => { }} style={styles.button}>
|
|
<Image source={{ uri: FileSystem.documentDirectory + 'HomeButtonImage.png' }} style={styles.btnImg} />
|
|
<Text style={styles.btnTxt}>{i18n.t('global.contacts')}</Text>
|
|
</TouchableOpacity>
|
|
</View>
|
|
</ImageBackground>
|
|
);
|
|
}
|
|
|
|
getHomeButtons() {
|
|
let buttons = Setting.get("HomeFolders");
|
|
if (buttons) {
|
|
buttons = JSON.parse(buttons.value);
|
|
_.forEach(buttons, function (value, key) {
|
|
console.log(JSON.parse(value.name).fr)
|
|
});
|
|
}
|
|
}
|
|
|
|
openFolder(id) {
|
|
console.log(id)
|
|
}
|
|
}
|
|
|
|
export default HomeScreen; |