ldc-com-app/ComApp/src/App/Views/HomeScreen.js

54 lines
2 KiB
JavaScript
Raw Normal View History

2022-09-30 17:40:03 +02:00
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';
2022-09-30 17:40:03 +02:00
class HomeScreen extends React.Component {
2022-09-30 17:40:03 +02:00
render() {
let buttons = Setting.get("HomeFolders");
buttons = JSON.parse(buttons.value);
//console.log(typeof Object.values(buttons))
const arr = [1, 2, 3]
2022-09-30 17:40:03 +02:00
return (
<ImageBackground source={{ uri: FileSystem.documentDirectory + 'BackgroundImage.png' }} style={commonStyles.background}>
<View style={styles.container}>
{/* {this.getHomeButton()} */}
2022-09-30 17:40:03 +02:00
<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)
}
2022-09-30 17:40:03 +02:00
}
export default HomeScreen;