-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
58 lines (51 loc) · 1.2 KB
/
App.tsx
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/
import React from 'react';
import {ScrollView, StyleSheet, Text, View} from 'react-native';
const Item = ({item}: {item: number}) => (
<View
testID={`item-${item}`}
style={{
backgroundColor: item % 2 ? 'green' : 'yellow',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
height: 100,
}}>
<Text style={{fontSize: 20}}>{item}</Text>
</View>
);
const BottomView = () => {
return (
<View style={style.bottomView}>
<Text style={style.bottomViewText}>Should "hide" elements</Text>
</View>
);
};
const style = StyleSheet.create({
bottomView: {
height: 100,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'orange',
},
bottomViewText: {fontSize: 20},
});
function App(): React.JSX.Element {
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
return (
<View style={{flex: 1}}>
<ScrollView testID={'scrollview'}>
{data.map(item => (
<Item item={item} key={`item-${item}`} />
))}
</ScrollView>
<BottomView />
</View>
);
}
export default App;