-
Notifications
You must be signed in to change notification settings - Fork 297
Expand file tree
/
Copy pathApp.tsx
More file actions
92 lines (86 loc) · 1.93 KB
/
App.tsx
File metadata and controls
92 lines (86 loc) · 1.93 KB
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
import React from 'react';
import {
Text,
View,
ScrollView,
Platform,
StyleSheet,
} from 'react-native';
import {examples, Props as ExamplesTabProperties} from './Examples';
import {propsExamples, Props as PropsTabProperties} from './Props';
function App() {
const renderExampleTab = (
sliders: PropsTabProperties[] | ExamplesTabProperties[],
filtered?: boolean,
) => {
return (
<View>
<ScrollView
style={styles.scrollView}
contentContainerStyle={styles.container}>
{(filtered
? (sliders as ExamplesTabProperties[]).filter(
e => !e.platform || e.platform === Platform.OS,
)
: sliders
).map((e, i) => (
<View key={`slider${i}`} style={styles.sliderWidget}>
<Text style={styles.instructions}>{e.title}</Text>
{e.render()}
</View>
))}
</ScrollView>
</View>
);
};
return (
<div className="App">
<header className="App-header">
<View style={{ width: '100%', margin: 'auto' }}>
{renderExampleTab(examples, true)}
{renderExampleTab(propsExamples)}
</View>
</header>
</div>
);
}
export default App;
const pageViewPositionSlider = {
trackColor: '#ABABAB',
thumbColor: '#1411AB',
style: {
width: '100%',
},
};
const styles = StyleSheet.create({
pagerViewContainer: {
flex: 1,
},
homeScreenContainer: {
flex: 1,
},
scrollView: {
backgroundColor: '#F5FCFF',
},
container: {
justifyContent: 'center',
alignItems: 'center',
paddingVertical: 20,
},
title: {
fontSize: 30,
color: pageViewPositionSlider.thumbColor,
textAlign: 'center',
width: '100%',
marginVertical: 20,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
fontSize: 20,
},
sliderWidget: {
marginVertical: 30,
},
});