| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; | 
					
						
							|  |  |  | import { Image } from "react-native"; | 
					
						
							|  |  |  | import CameraScreen from "../component/video/camera"; | 
					
						
							|  |  |  | import Session from "../screens/session"; | 
					
						
							|  |  |  | import { createNativeStackNavigator } from "@react-navigation/native-stack"; | 
					
						
							|  |  |  | import RecordScreen from "../screens/video-stack/record"; | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // TODO: add ts support for assets folder to use imports
 | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | const Icon = require("../assets/favicon.png"); | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | const Tab = createBottomTabNavigator(); | 
					
						
							| 
									
										
										
										
											2024-02-02 18:52:19 -08:00
										 |  |  | const RecordStack = createNativeStackNavigator(); | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // tabBarIcon configuration should live on separate file and contain all logic/icons/rendering for the Tabs
 | 
					
						
							|  |  |  | const tabIcons = { | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | 	Session: <Image source={Icon} style={{ width: 20, height: 20 }} />, | 
					
						
							|  |  |  | 	VideoStack: <Image source={Icon} style={{ width: 20, height: 20 }} />, | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-02 18:52:19 -08:00
										 |  |  | function VideoTabStack() { | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | 	return ( | 
					
						
							|  |  |  | 		<RecordStack.Navigator screenOptions={{ headerShown: false }}> | 
					
						
							|  |  |  | 			<RecordStack.Screen name="Record" component={RecordScreen} /> | 
					
						
							|  |  |  | 			<RecordStack.Screen name="Camera" component={CameraScreen} /> | 
					
						
							|  |  |  | 		</RecordStack.Navigator> | 
					
						
							|  |  |  | 	); | 
					
						
							| 
									
										
										
										
											2024-02-02 18:52:19 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  | /** | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  |  * Functional component creating a tab navigator with called | 
					
						
							| 
									
										
										
										
											2024-01-31 15:55:33 -08:00
										 |  |  |  * Uses React Navigation's Tab.Navigator. Customizes tab bar appearance and icons. | 
					
						
							|  |  |  |  * Import screens and call them on component of Tab.Screen. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @returns {React.ComponentType} A Tab.Navigator component with bottom tabs with screens. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default function Tabs(): React.JSX.Element { | 
					
						
							| 
									
										
										
										
											2024-02-03 20:23:31 -07:00
										 |  |  | 	return ( | 
					
						
							|  |  |  | 		<Tab.Navigator | 
					
						
							|  |  |  | 			screenOptions={({ route }) => ({ | 
					
						
							|  |  |  | 				headerShown: false, | 
					
						
							|  |  |  | 				tabBarActiveTintColor: "tomato", | 
					
						
							|  |  |  | 				tabBarInactiveTintColor: "gray", | 
					
						
							|  |  |  | 				tabBarIcon: () => { | 
					
						
							|  |  |  | 					return tabIcons[route.name]; | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			})} | 
					
						
							|  |  |  | 		> | 
					
						
							|  |  |  | 			<Tab.Screen | 
					
						
							|  |  |  | 				name="Session" | 
					
						
							|  |  |  | 				component={Session} | 
					
						
							|  |  |  | 				options={{ tabBarLabel: "Session" }} | 
					
						
							|  |  |  | 			/> | 
					
						
							|  |  |  | 			<Tab.Screen | 
					
						
							|  |  |  | 				name="VideoStack" | 
					
						
							|  |  |  | 				component={VideoTabStack} | 
					
						
							|  |  |  | 				options={{ tabBarLabel: "Record" }} | 
					
						
							|  |  |  | 			/> | 
					
						
							|  |  |  | 		</Tab.Navigator> | 
					
						
							|  |  |  | 	); | 
					
						
							|  |  |  | } |