diff --git a/frontend/src/components/AdminHeader.tsx b/frontend/src/components/AdminHeader.tsx index 8d9fcfc..c8c9101 100644 --- a/frontend/src/components/AdminHeader.tsx +++ b/frontend/src/components/AdminHeader.tsx @@ -89,17 +89,17 @@ const AdminHeader = () => { - Violator's List + Violators List - Driver's List + Drivers List - Registration's List + Registrations List )} diff --git a/frontend/src/hooks/useLogin.ts b/frontend/src/hooks/useLogin.ts index b70438f..ea003ec 100644 --- a/frontend/src/hooks/useLogin.ts +++ b/frontend/src/hooks/useLogin.ts @@ -48,7 +48,8 @@ const useLogin = () => { // To either navigate to the previous page where they go logged off or the landing page navigate(userInfo.isAdmin ? "/admin" : "/homepage"); } catch (error) { - alert(error); + const errorMessage = (error as Error).message; + toast.error(errorMessage); } finally { // stop the loadings setAppLoading!(false); diff --git a/frontend/src/pages/AddViolationPage.tsx b/frontend/src/pages/AddViolationPage.tsx index da60502..cc7f6bf 100644 --- a/frontend/src/pages/AddViolationPage.tsx +++ b/frontend/src/pages/AddViolationPage.tsx @@ -2,17 +2,17 @@ import { useNavigate } from "react-router-dom"; import AdminHeader from "../components/AdminHeader"; import { useState } from "react"; import { toast } from "react-toastify"; -import useCheckLicenseNumber from "../hooks/car-hooks/useCheckLicenseNumber"; +import useCheckLicenseNumber from "../hooks/car-hooks/useCheckLicenseNumber"; import { DriverWithVandC } from "../types/datatypes"; import AddViolationComponent from "../components/AddViolationComponent"; const AddViolation = () => { const navigate = useNavigate(); - const { checkLicenseNumber, loading } = useCheckLicenseNumber(); + const { checkLicenseNumber, loading } = useCheckLicenseNumber(); const [currentStep, setCurrentStep] = useState(1); const [licenseNumber, setLicenseNumber] = useState(""); - const [driverProfile, setDriverProfile] = useState(); + const [driverProfile, setDriverProfile] = useState(); const [violationModalActive, setViolationModalActive] = useState(false); const handleCancelButton = () => { @@ -47,14 +47,19 @@ const AddViolation = () => {
-

Adding a Violation

+

+ Adding a Violation +

Find the driver by searching for the license number.

-