diff --git a/frontend/occupi-mobile4/app/_layout.tsx b/frontend/occupi-mobile4/app/_layout.tsx
index a9fcb4f7..9093268b 100644
--- a/frontend/occupi-mobile4/app/_layout.tsx
+++ b/frontend/occupi-mobile4/app/_layout.tsx
@@ -6,6 +6,7 @@ import { Stack } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen';
import 'react-native-reanimated';
import { GluestackUIProvider } from "@gluestack-ui/themed";
+import { NavBarProvider } from '@/components/NavBarProvider';
import { config } from "@gluestack-ui/config"; // Optional if you want to use default theme
// Prevent the splash screen from auto-hiding before asset loading is complete.
@@ -31,6 +32,7 @@ export default function RootLayout() {
return (
+
@@ -56,6 +58,7 @@ export default function RootLayout() {
+
);
}
\ No newline at end of file
diff --git a/frontend/occupi-mobile4/components/NavBar.tsx b/frontend/occupi-mobile4/components/NavBar.tsx
index b10a2b22..3dfd448a 100644
--- a/frontend/occupi-mobile4/components/NavBar.tsx
+++ b/frontend/occupi-mobile4/components/NavBar.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useState } from 'react';
import { StyleSheet } from 'react-native';
import { Text, Button, Icon, CalendarDaysIcon, BellIcon } from '@gluestack-ui/themed';
import { Feather } from '@expo/vector-icons';
@@ -7,31 +7,145 @@ import { router } from 'expo-router';
import { BlurView } from 'expo-blur';
import { useColorScheme } from 'react-native';
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen';
+import { useNavBar } from './NavBarProvider';
const NavBar = () => {
let colorScheme = useColorScheme();
const styles = getStyles(colorScheme);
+ const { currentTab, setCurrentTab } = useNavBar();
+
+ const handleTabPress = (tabName, route) => {
+ setCurrentTab(tabName);
+ router.replace(route);
+ };
+ console.log(currentTab);
+
return (
-
-