diff --git a/booking-app/app/theme/theme.ts b/booking-app/app/theme/theme.ts index 0bf21caa..e8f8b645 100644 --- a/booking-app/app/theme/theme.ts +++ b/booking-app/app/theme/theme.ts @@ -1,8 +1,9 @@ "use client"; +import { deepPurple, lightGreen } from "@mui/material/colors"; + import { Roboto } from "next/font/google"; import { createTheme } from "@mui/material/styles"; -import { deepPurple } from "@mui/material/colors"; const theme = createTheme({ palette: { @@ -20,7 +21,7 @@ const theme = createTheme({ gray3: "rgba(0,0,0,0.3)", border: "#e3e3e3", }, - success: { main: "rgb(0 255 0)" }, + success: { main: lightGreen.A400 }, warning: { main: "rgb(255 167 0)" }, error: { main: "rgba(255, 26, 26, 1)" }, }, diff --git a/booking-app/components/src/client/routes/booking/components/BookingStatusBar.tsx b/booking-app/components/src/client/routes/booking/components/BookingStatusBar.tsx index 1878d427..99866ad3 100644 --- a/booking-app/components/src/client/routes/booking/components/BookingStatusBar.tsx +++ b/booking-app/components/src/client/routes/booking/components/BookingStatusBar.tsx @@ -1,13 +1,20 @@ -import { Alert, AlertColor, Box, Button, Tooltip } from "@mui/material"; +import { + Alert, + AlertColor, + Box, + Button, + Tooltip, + useMediaQuery, + useTheme, +} from "@mui/material"; import { Check, ChevronLeft, ChevronRight } from "@mui/icons-material"; import React, { useContext } from "react"; import { BookingContext } from "../bookingProvider"; import { FormContextLevel } from "@/components/src/types"; -import Grid from "@mui/material/Unstable_Grid2"; +import { styled } from "@mui/system"; import useCalculateOverlap from "../hooks/useCalculateOverlap"; import useCheckAutoApproval from "../hooks/useCheckAutoApproval"; -import { usePathname } from "next/navigation"; interface Props { formContext: FormContextLevel; @@ -17,6 +24,14 @@ interface Props { hideNextButton: boolean; } +const NavGrid = styled(Box)` + display: grid; + grid-template-columns: 94px 1fr 94px; + grid-gap: 12px; + padding-left: 24px; + padding-right: 18px; +`; + export default function BookingStatusBar({ formContext, ...props }: Props) { const isWalkIn = formContext === FormContextLevel.WALK_IN; const { isAutoApproval, errorMessage } = useCheckAutoApproval(isWalkIn); @@ -24,6 +39,9 @@ export default function BookingStatusBar({ formContext, ...props }: Props) { useContext(BookingContext); const isOverlap = useCalculateOverlap(); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down("sm")); + const showAlert = isBanned || needsSafetyTraining || @@ -127,54 +145,62 @@ export default function BookingStatusBar({ formContext, ...props }: Props) { return [false, ""]; })(); + const backBtn = !props.hideBackButton && ( + + ); + + const nextBtn = !props.hideNextButton && ( + + + + + + ); + + const alert = showAlert && state && ( + + {state.message} + + ); + + if (isMobile) { + return ( + + + {backBtn} + + {nextBtn} + + {alert} + + ); + } + return ( - - - {!props.hideBackButton && ( - - )} - - - {showAlert && state && ( - - {state.message} - - )} - - - {!props.hideNextButton && ( - - - - - - )} - - + + {backBtn} + {alert} + {nextBtn} + ); }