From 2645a8e8ecf14d4f4785c30078e122e143b5f248 Mon Sep 17 00:00:00 2001 From: ZL Asica <40444637+ZL-Asica@users.noreply.github.com> Date: Sun, 27 Oct 2024 23:44:00 -0500 Subject: [PATCH 1/4] refactor: move Footer out, use react router to get current page. --- src/App.css | 8 ------- src/App.jsx | 27 +++------------------- src/components/common/Footer.jsx | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 32 deletions(-) create mode 100644 src/components/common/Footer.jsx diff --git a/src/App.css b/src/App.css index f270304..57d64b9 100644 --- a/src/App.css +++ b/src/App.css @@ -8,11 +8,3 @@ flex: 1; padding-bottom: 56px; /* Space for the bottom navigation */ } - -.bottom-nav { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 10; /* Ensure it's above other elements */ -} diff --git a/src/App.jsx b/src/App.jsx index d8b15b9..1c0c50a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,22 +1,16 @@ -import { useState } from 'react'; -import { Link, Route, BrowserRouter as Router, Routes } from 'react-router-dom'; +import { Route, BrowserRouter as Router, Routes } from 'react-router-dom'; -import FlagIcon from '@mui/icons-material/Flag'; -import HomeIcon from '@mui/icons-material/Home'; -import BottomNavigation from '@mui/material/BottomNavigation'; -import BottomNavigationAction from '@mui/material/BottomNavigationAction'; import { ThemeProvider } from '@mui/material/styles'; import { theme } from '@utils/theme'; import Home from './pages/Home'; +import Footer from '@components/common/Footer'; import Header from '@components/common/Header'; import { UserProvider } from '@contexts/UserContext'; import './App.css'; const App = () => { - const [value, setValue] = useState(0); - return ( @@ -32,22 +26,7 @@ const App = () => { {/* Bottom Navigation with React Router links */} - { - setValue(newValue); - }} - showLabels - > - } component={Link} to="/" /> - } - component={Link} - to="/streak" - /> - +