forked from callstack/react-native-bottom-tabs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSFSymbols.tsx
More file actions
57 lines (53 loc) · 1.44 KB
/
SFSymbols.tsx
File metadata and controls
57 lines (53 loc) · 1.44 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
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 { Platform } from 'react-native';
const renderScene = SceneMap({
article: Article,
albums: Albums,
contacts: Contacts,
});
const isAndroid = Platform.OS === 'android';
export default function SFSymbols() {
const [index, setIndex] = useState(0);
const [routes] = useState([
{
key: 'article',
title: 'Article',
focusedIcon: isAndroid
? require('../../assets/icons/article_dark.png')
: { sfSymbol: 'document.fill' },
unfocusedIcon: isAndroid
? require('../../assets/icons/chat_dark.png')
: { sfSymbol: 'document' },
badge: '!',
},
{
key: 'albums',
title: 'Albums',
focusedIcon: isAndroid
? require('../../assets/icons/grid_dark.png')
: { sfSymbol: 'square.grid.3x2.fill' },
badge: '5',
},
{
key: 'contacts',
focusedIcon: isAndroid
? require('../../assets/icons/person_dark.png')
: { sfSymbol: 'person.fill' },
title: 'Contacts',
role: 'search',
},
]);
return (
<TabView
sidebarAdaptable
minimizeBehavior="onScrollDown"
navigationState={{ index, routes }}
onIndexChange={setIndex}
renderScene={renderScene}
/>
);
}