-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
82 lines (77 loc) · 1.93 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React, { Component } from "react";
import { StyleSheet, View, Text, NativeModules } from "react-native";
import { RFPercentage } from "react-native-responsive-fontsize";
import i18n from "./i18n";
import Clock from "./components/Clock";
import TimeOfDay from "./components/TimeOfDay";
import Calendar from "./components/Calendar";
import Messages from "./components/Messages";
export default class App extends Component {
constructor(props) {
super(props);
const locale = NativeModules.SettingsManager.settings.AppleLocale;
i18n.changeLanguage(locale);
}
componentDidMount() {
const locale = NativeModules.SettingsManager.settings.AppleLocale;
i18n.changeLanguage(locale);
}
render() {
return (
<View style={styles.container}>
<View style={styles.topSection}>
<View style={styles.displayElement}>
<Calendar />
</View>
<View style={styles.displayElement}>
<TimeOfDay />
</View>
<View style={styles.displayElement}>
<Clock />
</View>
</View>
<View style={styles.botSection}>
<Messages />
</View>
<View>
<View />
<Text style={styles.footer}>
Elsa 2019 ©
</Text>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "space-around",
alignItems: "flex-start",
backgroundColor: "#FDFDFD",
margin: RFPercentage(2)
},
topSection: {
flex: 3,
justifyContent: "space-evenly"
},
botSection: {
flex: 1,
justifyContent: "flex-start"
},
displayElement: {
padding: RFPercentage(2),
backgroundColor: "#f4f4f4",
borderRadius: 10
},
footerContainer: {
flex: 1,
flexDirection: "row",
justifyContent: "space-between"
},
footer: {
fontSize: RFPercentage(2),
color: "#666666",
padding: 0
}
});