-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
85 lines (79 loc) · 2.89 KB
/
App.tsx
File metadata and controls
85 lines (79 loc) · 2.89 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
82
83
84
85
import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
import { Ionicons } from '@expo/vector-icons';
import { StatusBar } from 'expo-status-bar';
// Screens
import HomeScreen from './src/screens/HomeScreen';
import SearchScreen from './src/screens/SearchScreen';
import BlockListScreen from './src/screens/BlockListScreen';
import HistoryScreen from './src/screens/HistoryScreen';
import SettingsScreen from './src/screens/SettingsScreen';
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();
function TabNavigator() {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName: keyof typeof Ionicons.glyphMap;
if (route.name === 'Home') {
iconName = focused ? 'home' : 'home-outline';
} else if (route.name === 'Search') {
iconName = focused ? 'search' : 'search-outline';
} else if (route.name === 'BlockList') {
iconName = focused ? 'shield' : 'shield-outline';
} else if (route.name === 'History') {
iconName = focused ? 'time' : 'time-outline';
} else if (route.name === 'Settings') {
iconName = focused ? 'settings' : 'settings-outline';
} else {
iconName = 'home-outline';
}
return <Ionicons name={iconName} size={size} color={color} />;
},
tabBarActiveTintColor: '#007AFF',
tabBarInactiveTintColor: 'gray',
tabBarStyle: {
backgroundColor: 'white',
borderTopWidth: 1,
borderTopColor: '#e0e0e0',
paddingBottom: 5,
paddingTop: 5,
height: 60,
},
tabBarLabelStyle: {
fontSize: 12,
fontWeight: '500',
},
headerShown: false,
})}
>
<Tab.Screen
name='Home'
component={HomeScreen}
options={{
title: 'ホーム',
tabBarBadge: undefined, // 必要に応じて通知バッジを表示
}}
/>
<Tab.Screen name='Search' component={SearchScreen} options={{ title: '検索' }} />
<Tab.Screen name='BlockList' component={BlockListScreen} options={{ title: 'ブロック' }} />
<Tab.Screen name='History' component={HistoryScreen} options={{ title: '履歴' }} />
<Tab.Screen name='Settings' component={SettingsScreen} options={{ title: '設定' }} />
</Tab.Navigator>
);
}
export default function App() {
return (
<>
<StatusBar style='auto' />
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name='Main' component={TabNavigator} options={{ headerShown: false }} />
</Stack.Navigator>
</NavigationContainer>
</>
);
}