Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
Remove narbar and two previous pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zoi23333 committed Oct 6, 2023
1 parent c2b1aef commit d47f5ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 58 deletions.
Binary file modified .DS_Store
Binary file not shown.
13 changes: 2 additions & 11 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import { FC } from 'react';
import { BrowserRouter as Router, Navigate } from 'react-router-dom';

import Navbar from './Components/Navbar';
import RoadConditions from './pages/RoadConditions';
import Conditions from './pages/Conditions';

import './App.css';

import { Route, Routes } from 'react-router-dom';
import RoadDetails from './pages/RoadDetails';
import './App.css';
import './css/roadDetails.css';

const App: FC = () => {
return (
<div className="App">
<Router>
<Navbar />
<Routes>
<Route index element={<Navigate to="/conditions" replace />} />
<Route path="/conditions" element={<Conditions />} />
<Route path="/road_conditions" element={<RoadConditions />} />
<Route index element={<Navigate to="/road-details" replace />} />

<Route path="/road-details" element={<RoadDetails />} />
</Routes>
</Router>
Expand Down
49 changes: 2 additions & 47 deletions frontend/src/Components/roadDetails/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Link, useNavigate } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom'; // Import useNavigate

interface TopBarProps {
setShowMiddleArea2: React.Dispatch<React.SetStateAction<boolean>>;
Expand All @@ -22,7 +22,7 @@ const return_btn = (
);

const TopBar: React.FC<TopBarProps> = ({ setShowMiddleArea2 }) => {
const navigate = useNavigate();
const navigate = useNavigate(); // Get the navigate function

const handleReturn = () => {
// Navigate back to the home page when the button is clicked
Expand Down Expand Up @@ -54,48 +54,3 @@ const TopBar: React.FC<TopBarProps> = ({ setShowMiddleArea2 }) => {
};

export default TopBar;

// import React, { useState } from 'react';
// import { Link, useNavigate } from 'react-router-dom';

// const return_btn = (
// <svg
// xmlns="http://www.w3.org/2000/svg"
// width="16"
// height="16"
// fill="currentColor"
// className="btn bi bi-chevron-left btnWhite"
// viewBox="0 0 16 16"
// >
// <path
// fillRule="evenodd"
// d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"
// />
// </svg>
// );

// const TopBar: React.FC = () => {
// const navigate = useNavigate();
// const [showMiddleArea2, setShowMiddleArea2] = useState(false);

// const handleReturn = () => {
// // Navigate back to the home page when the button is clicked
// navigate('/');
// };

// const handleToggleMiddleArea = () => {
// // Toggle the state to show/hide MiddleArea2
// setShowMiddleArea2((prevState) => !prevState);
// };

// return (
// <div className="top-bar">
// <Link to="/" onClick={handleReturn} className="btnLinkContainer">
// {return_btn}
// </Link>
// <button onClick={handleToggleMiddleArea}>Toggle Middle Area</button>
// </div>
// );
// };

// export default TopBar;

0 comments on commit d47f5ea

Please sign in to comment.