-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathTintColors.tsx
More file actions
81 lines (76 loc) · 2.16 KB
/
Copy pathTintColors.tsx
File metadata and controls
81 lines (76 loc) · 2.16 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
import TabView, { SceneMap } from 'react-native-bottom-tabs';
import { useState } from 'react';
import { Article } from '../Screens/Article';
import { Albums } from '../Screens/Albums';
import { Contacts } from '../Screens/Contacts';
import { Chat } from '../Screens/Chat';
import { Button, Platform, StyleSheet, View } from 'react-native';
const renderScene = SceneMap({
article: Article,
albums: Albums,
contacts: Contacts,
chat: Chat,
});
const isAndroid = Platform.OS === 'android';
export default function TintColorsExample() {
const [index, setIndex] = useState(0);
const [bakedTintColors, setBakedTintColors] = useState(false);
const [routes] = useState([
{
key: 'article',
title: 'Article',
focusedIcon: require('../../assets/icons/article_dark.png'),
unfocusedIcon: require('../../assets/icons/chat_dark.png'),
badge: '!',
},
{
key: 'albums',
title: 'Albums',
unfocusedIcon: require('../../assets/avatar-3.png'),
focusedIcon: require('../../assets/avatar-4.png'),
activeTintColor: 'purple',
iconRenderingMode: 'original',
},
{
key: 'contacts',
focusedIcon: isAndroid
? require('../../assets/icons/person_dark.png')
: { sfSymbol: 'person.fill' },
title: 'Contacts',
activeTintColor: 'blue',
},
{
key: 'chat',
focusedIcon: require('../../assets/icons/chat_dark.png'),
title: 'Chat',
},
]);
return (
<View style={styles.container}>
<View style={styles.controls}>
<Button
title={`${bakedTintColors ? 'Disable' : 'Enable'} Experimental Baked Tint Colors`}
onPress={() => setBakedTintColors((value) => !value)}
/>
</View>
<TabView
sidebarAdaptable
navigationState={{ index, routes }}
onIndexChange={setIndex}
renderScene={renderScene}
tabBarActiveTintColor="red"
tabBarInactiveTintColor="orange"
experimental_bakedTintColors={bakedTintColors}
scrollEdgeAppearance="default"
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
controls: {
padding: 12,
},
});