-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
72 lines (66 loc) · 1.74 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
/**
* Sample React Native App
* Showcasing the use of Class & Functional components
* Using the React-Native Final Tree View and creating branching links using the data provided
* @format
* @flow strict-local
*/
import React, {Component} from 'react';
import type {Node} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
Dimensions,
} from 'react-native';
import HomeScreen from './components/HomeScreen';
import EStyleSheet from 'react-native-extended-stylesheet';
const entireScreenWidth = Dimensions.get('window').width;
const entireScreenHeight = Dimensions.get('window').height;
const rem =
entireScreenWidth > entireScreenHeight
? entireScreenHeight / 380
: entireScreenWidth / 380;
EStyleSheet.build({$rem: rem});
const App: () => Node = () => {
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? '#00000' : '#fffff',
};
return (
<SafeAreaView style={backgroundStyle}>
<View
style={{
width: '100%',
height: 50,
backgroundColor: '#333aff',
justifyContent: 'center',
}}>
<Text
style={{
color: 'white',
textAlign: 'center',
fontSize: EStyleSheet.value('14rem'),
}}>
{'Tree View Branch Example'}
</Text>
</View>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
<View
style={{
backgroundColor: isDarkMode ? '#00000' : '#fffff',
}}>
<HomeScreen />
</View>
</ScrollView>
</SafeAreaView>
);
};
const styles = StyleSheet.create({});
export default App;