From 3675f693e8086095cb75a47339bac9363b3af048 Mon Sep 17 00:00:00 2001 From: Delaney H Date: Sun, 24 Mar 2024 23:18:01 -0230 Subject: [PATCH] Setting Offcanvas created and functional --- frontend/src/index.js | 1 + frontend/src/pages/App.js | 2 +- frontend/src/pages/Garage.js | 1 + frontend/src/pages/NavBar.js | 3 ++- frontend/src/pages/Settings.js | 19 ++++++++----------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/src/index.js b/frontend/src/index.js index a15f953..b40ce2b 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client'; import './index.css'; import App from './pages/App'; import reportWebVitals from './reportWebVitals'; +import 'bootstrap/dist/css/bootstrap.min.css'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( diff --git a/frontend/src/pages/App.js b/frontend/src/pages/App.js index 3f18d82..6191ef8 100644 --- a/frontend/src/pages/App.js +++ b/frontend/src/pages/App.js @@ -28,7 +28,7 @@ function App() { } /> } /> - }/> + }/> diff --git a/frontend/src/pages/Garage.js b/frontend/src/pages/Garage.js index 1c7b6ed..61dca1a 100644 --- a/frontend/src/pages/Garage.js +++ b/frontend/src/pages/Garage.js @@ -2,6 +2,7 @@ import {BrowserRouter, Routes, Route, Link, useNavigate} from "react-router-dom" import GarageNavbar from "./GarageNavbar"; import AddRemoveNavbar from "./AddRemoveNavbar"; import VehicleInfo from "./VehicleInfo"; +import Settings from "./Settings"; function Garage() { // TODO: REPLACE WITH REAL VALUES, THESE ARE USED AS TEST VALUES diff --git a/frontend/src/pages/NavBar.js b/frontend/src/pages/NavBar.js index 6a69218..ba24fa0 100644 --- a/frontend/src/pages/NavBar.js +++ b/frontend/src/pages/NavBar.js @@ -1,4 +1,5 @@ import {Link} from "react-router-dom"; +import Settings from "./Settings"; function NavBar() { return ( @@ -6,7 +7,7 @@ function NavBar() { Home Login Garage - Settings + ); } diff --git a/frontend/src/pages/Settings.js b/frontend/src/pages/Settings.js index 1b4c8dc..0ab63c3 100644 --- a/frontend/src/pages/Settings.js +++ b/frontend/src/pages/Settings.js @@ -1,17 +1,14 @@ import { useState } from 'react'; -import ReactDOM from 'react-dom'; -import Offcanvas from "react-bootstrap/Offcanvas"; -import Button from "react-bootstrap/Button"; +import Button from 'react-bootstrap/Button'; +import Offcanvas from 'react-bootstrap/Offcanvas'; export const Settings = () => { const [darkMode, setDarkMode] = useState(false); const [notifications, setNotifications] = useState(false); const [unitOfMeasurement, setUnitOfMeasurement] = useState('metric'); - const [visibility, setVisibility] = useState(false); - const handleVisibilityChange = () => { - setVisibility(!visibility); - } + const [show, setShow] = useState(false); + const handleShow = () => setShow(!show); const handleSubmit = (e) => { e.preventDefault(); @@ -19,14 +16,14 @@ export const Settings = () => { return (
- - + + - + Settings
- + setDarkMode(e.target.checked)}/>