-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
60 lines (55 loc) · 1.61 KB
/
Copy pathApp.tsx
File metadata and controls
60 lines (55 loc) · 1.61 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
import React, {useState} from 'react';
import {StyleSheet, Text, View, Pressable} from 'react-native';
import EaseWall from './src/EaseWall';
import ReanimatedWall from './src/ReanimatedWall';
type Tab = 'ease' | 'reanimated';
export default function App() {
const [tab, setTab] = useState<Tab>('ease');
return (
<View style={styles.container}>
{tab === 'ease' ? <EaseWall /> : <ReanimatedWall />}
<View style={styles.tabBar}>
<Pressable
style={styles.tab}
onPress={() => setTab('ease')}>
<Text
style={[styles.tabLabel, tab === 'ease' && styles.tabLabelActive]}>
EaseView
</Text>
<Text style={styles.tabSub}>Core Animation</Text>
</Pressable>
<Pressable
style={styles.tab}
onPress={() => setTab('reanimated')}>
<Text
style={[
styles.tabLabel,
tab === 'reanimated' && styles.tabLabelActive,
]}>
Reanimated
</Text>
<Text style={styles.tabSub}>Worklets</Text>
</Pressable>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {flex: 1, backgroundColor: '#0F0F1A'},
tabBar: {
flexDirection: 'row',
backgroundColor: '#1A1A2E',
borderTopWidth: 1,
borderTopColor: '#2A2A4A',
paddingBottom: 28,
paddingTop: 10,
},
tab: {
flex: 1,
alignItems: 'center',
paddingVertical: 6,
},
tabLabel: {fontSize: 14, fontWeight: '700', color: '#6C6C8A'},
tabLabelActive: {color: '#6C5CE7'},
tabSub: {fontSize: 10, color: '#4A4A6A', marginTop: 2},
});