-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
94 lines (89 loc) · 2.28 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
83
84
85
86
87
88
89
90
91
92
93
94
import React from 'react';
import { ImageBackground, StyleSheet, /* ScrollView */ SafeAreaView /* ,StatusBar */ } from 'react-native';
import RootStore from '~/mobx';
import { Provider } from 'mobx-react';
// import AppNavigator from './src/navigation';
import HomeScreen from '~/pages/Home/HomeScreen';
import { width, height, px2dp } from '~/utils/screenKits';
import settings from '~/settings';
import { testApi } from '~/api/index';
const { theme } = settings;
testApi()
.then(/* (res) => console.log('res=======', res) */)
.catch((err) => {
console.log('err======', err);
});
console.log(width, height, px2dp(200));
const App = () => (
<SafeAreaView style={styles.backgroundStyle}>
{/* <ScrollView style={styles.appContainer}> */}
<Provider RootStore={RootStore}>
{/* <AppNavigator></AppNavigator> */}
<ImageBackground style={styles.homeBg} source={require('./src/assets/img/collection/11.jpg')}>
<HomeScreen></HomeScreen>
</ImageBackground>
</Provider>
{/* </ScrollView> */}
</SafeAreaView>
);
const styles = StyleSheet.create({
backgroundStyle: {
flex: 1,
},
appContainer: {
// width: '100%',
// height: '100%',
// width: width,
// height: height,
// borderWidth: 10,
// borderColor: 'red',
flex: 1,
},
homeBg: {
width: '100%',
height: '100%',
// flex: 1,
// width: width,
// height: height,
// borderWidth: 10,
// borderColor: 'blue',
},
homeSloganWare: {
padding: 40,
textAlign: 'center',
flex: 1,
},
homeSlogan: {
color: theme.fontColor,
fontSize: 52,
},
homeSloganBig: {
color: theme.fontColor,
fontSize: 62,
},
homeAddUp: {
color: theme.fontColor,
fontSize: 14,
},
writeBtnWare: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center', // 垂直居中
alignItems: 'center', // 水平居中
// backgroundColor: 'blue',
},
writeBtn: {
position: 'absolute',
bottom: px2dp(70),
// left: '50%',
// justifyContent: 'center',
// transform: [{ translate: 50 }],
},
writeTextColor: {
position: 'absolute',
bottom: px2dp(40),
color: '#fff',
fontSize: 14,
},
});
export default App;