-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.js
58 lines (47 loc) · 1.28 KB
/
Main.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
/**
* Sweethome CP ~ Source
* React Native 0.60+
*
* @format
* @flow strict-local
*/
import React from 'react';
import {
View,
StatusBar,
ToastAndroid,
Text,
DevSettings
} from 'react-native';
const css = require('./styles')
import MainPageContent from './views/MainMenu'
import DAO from './dao/InternalDAO'
const Main: () => React$Node = () => {
DevSettings.addMenuItem('[DEBUG] Limpar dados', async () => {
console.log("[SAVE][LOAD] Limpando storage")
await DAO.deleteStorage()
});
console.log("[MAIN] Execution started")
DAO.prepareStorage().then(async ()=>{
console.log("[MAIN] Storage ready!")
await DAO.loadDevices();
// await DAO.loadConfig();
})
return (
<View style={{flex:1, backgroundColor:"black"}}>
{/* Android Status header */}
<StatusBar barStyle="light-content" backgroundColor="#000000" />
{/* Company logo view */}
<View style={{ justifyContent: "center", flex: 1, backgroundColor:'#040404' }}>
<View style={css.header}>
<Text style={[css.textLight, {fontSize:26}]}>SweetHome</Text>
</View>
</View>
{/* Application content view */}
<View style={[css.body]}>
<MainPageContent></MainPageContent>
</View>
</View>
);
};
export default Main;