Skip to content

Commit bd53294

Browse files
committed
add icons
1 parent f6c7210 commit bd53294

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

examples/RNOneSignalTS/App.tsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
99
import { NavigationContainer } from '@react-navigation/native';
10-
import { StatusBar, useColorScheme } from 'react-native';
10+
import { StatusBar, Text, useColorScheme } from 'react-native';
1111
import { SafeAreaProvider } from 'react-native-safe-area-context';
1212
import DetailsScreen from './DetailsScreen';
1313
import OSDemo from './OSDemo';
@@ -19,6 +19,14 @@ export type RootTabParamList = {
1919

2020
const Tab = createBottomTabNavigator<RootTabParamList>();
2121

22+
function HomeIcon() {
23+
return <Text style={{ fontSize: 24 }}>🏠</Text>;
24+
}
25+
26+
function DetailsIcon() {
27+
return <Text style={{ fontSize: 24 }}></Text>;
28+
}
29+
2230
function App() {
2331
const isDarkMode = useColorScheme() === 'dark';
2432

@@ -27,8 +35,20 @@ function App() {
2735
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
2836
<NavigationContainer>
2937
<Tab.Navigator>
30-
<Tab.Screen name="Home" component={OSDemo} />
31-
<Tab.Screen name="Details" component={DetailsScreen} />
38+
<Tab.Screen
39+
name="Home"
40+
component={OSDemo}
41+
options={{
42+
tabBarIcon: () => <HomeIcon />,
43+
}}
44+
/>
45+
<Tab.Screen
46+
name="Details"
47+
component={DetailsScreen}
48+
options={{
49+
tabBarIcon: () => <DetailsIcon />,
50+
}}
51+
/>
3252
</Tab.Navigator>
3353
</NavigationContainer>
3454
</SafeAreaProvider>

0 commit comments

Comments
 (0)