-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
44 lines (39 loc) · 1.38 KB
/
App.js
File metadata and controls
44 lines (39 loc) · 1.38 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
import * as React from 'react';
import {SafeAreaView} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import About from './Navigation/About';
import Tickers from './Navigation/Tickers';
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome';
import {
faChartArea,
faChartLine,
faMobile,
faMobileAlt,
} from '@fortawesome/free-solid-svg-icons';
const Tab = createBottomTabNavigator();
export default function App() {
return (
<SafeAreaView style={{flex: 1}}>
<NavigationContainer>
<Tab.Navigator
screenOptions={({route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
if (route.name === 'О приложении') {
iconName = focused ? faMobile : faMobileAlt;
} else if (route.name === 'Котировки') {
iconName = focused ? faChartArea : faChartLine;
}
return (
<FontAwesomeIcon icon={iconName} size={size} color={color} />
);
},
})}>
<Tab.Screen name="О приложении" component={About} />
<Tab.Screen name="Котировки" component={Tickers} />
</Tab.Navigator>
</NavigationContainer>
</SafeAreaView>
);
}