From 9625f6a447ba57428d9bc2823a147c6d44109c40 Mon Sep 17 00:00:00 2001 From: Delaney H Date: Sat, 30 Mar 2024 21:50:12 -0230 Subject: [PATCH] Updated Garage page to fix row formatting Updated History page for vehicles Updated GUI and added return buttons on both Upload pages for history (pages are incomplete) --- frontend/src/pages/garage/Garage.js | 34 +++++++++---------- .../ManualVehicleHistory.js | 12 +++++-- .../pages/maintenance-history/UploadNavbar.js | 20 +++++++++-- .../UploadVehicleHistory.js | 11 ++++-- frontend/src/pages/vehicle/VehicleHistory.js | 22 ++++++++---- frontend/src/pages/vehicle/VehicleNavbar.js | 24 ++++++------- 6 files changed, 79 insertions(+), 44 deletions(-) diff --git a/frontend/src/pages/garage/Garage.js b/frontend/src/pages/garage/Garage.js index 9211cb0..3f3c103 100644 --- a/frontend/src/pages/garage/Garage.js +++ b/frontend/src/pages/garage/Garage.js @@ -59,25 +59,23 @@ function Garage(props) { { props.info != null ? - props.info.map((vehicle, index) => { - //console.log(garageVehicles[0][0].configurations.year); - vehicle_count++; - if (vehicle_count === 1 || vehicle_count % 3 === 0) { - return ( - - - - - - ) - } - return ( - - - - ) - }) : null + props.info.reduce((rows, vehicle, index) => { + if (index % 3 === 0) { + rows.push([]); + } + rows[rows.length - 1].push( + + + + ); + return rows; + }, []).map((row, rowIndex) => ( + + {row} + + )) : null } +
diff --git a/frontend/src/pages/maintenance-history/ManualVehicleHistory.js b/frontend/src/pages/maintenance-history/ManualVehicleHistory.js index e3277c3..9a7a03f 100644 --- a/frontend/src/pages/maintenance-history/ManualVehicleHistory.js +++ b/frontend/src/pages/maintenance-history/ManualVehicleHistory.js @@ -1,9 +1,17 @@ +import Button from "react-bootstrap/Button"; +import {Link} from "react-router-dom"; +import { useNavigate} from "react-router-dom"; + function ManualVehicleHistory() { + let navigate = useNavigate(); + return (

Manual Vehicle History

-

Enter vehicle history manually

-

Placeholder

+

Uh oh! This page isn't finished yet!

+
) } diff --git a/frontend/src/pages/maintenance-history/UploadNavbar.js b/frontend/src/pages/maintenance-history/UploadNavbar.js index b64b1dd..dce2eaa 100644 --- a/frontend/src/pages/maintenance-history/UploadNavbar.js +++ b/frontend/src/pages/maintenance-history/UploadNavbar.js @@ -1,10 +1,24 @@ import {Link} from "react-router-dom"; +import Button from "react-bootstrap/Button"; function UploadNavbar() { return ( -
- Upload - Manual +
+
+
+
+
+ + + + + + + +
+
+
+
); } diff --git a/frontend/src/pages/maintenance-history/UploadVehicleHistory.js b/frontend/src/pages/maintenance-history/UploadVehicleHistory.js index 77f9e52..7e2e2fc 100644 --- a/frontend/src/pages/maintenance-history/UploadVehicleHistory.js +++ b/frontend/src/pages/maintenance-history/UploadVehicleHistory.js @@ -1,9 +1,16 @@ +import {useNavigate} from "react-router-dom"; +import Button from "react-bootstrap/Button"; + function UploadVehicleHistory() { + let navigate = useNavigate(); + return (

Upload Vehicle History

-

Upload a file

-

Placeholder

+

Uh oh! This page isn't finished yet!

+
) } diff --git a/frontend/src/pages/vehicle/VehicleHistory.js b/frontend/src/pages/vehicle/VehicleHistory.js index a8c6dc4..70a525a 100644 --- a/frontend/src/pages/vehicle/VehicleHistory.js +++ b/frontend/src/pages/vehicle/VehicleHistory.js @@ -46,18 +46,26 @@ function VehicleHistory(props) { - - - - -
-
-

Vehicle History

+
+ + +

Vehicle History

+ + + + + + + + + +
+
diff --git a/frontend/src/pages/vehicle/VehicleNavbar.js b/frontend/src/pages/vehicle/VehicleNavbar.js index eea6888..91abd9e 100644 --- a/frontend/src/pages/vehicle/VehicleNavbar.js +++ b/frontend/src/pages/vehicle/VehicleNavbar.js @@ -9,23 +9,23 @@ function VehicleNavbar(props) { return (
-
- - {} - - - - -
+
+ + {} + + + + +