From edfefcceda34c8889a0d6fe8b39298fe88be6e51 Mon Sep 17 00:00:00 2001 From: FaintSpeaker Date: Wed, 29 Dec 2021 12:08:14 -0500 Subject: [PATCH] Use the white property to replace the hard-coded "white" in the city map. --- src/Locations/ui/City.tsx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Locations/ui/City.tsx b/src/Locations/ui/City.tsx index 3bd246f17..d0e54a24b 100644 --- a/src/Locations/ui/City.tsx +++ b/src/Locations/ui/City.tsx @@ -17,11 +17,27 @@ import { IRouter } from "../../ui/Router"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; import { LocationType } from "../LocationTypeEnum"; +import { Theme } from "@mui/material/styles"; +import makeStyles from "@mui/styles/makeStyles"; +import createStyles from "@mui/styles/createStyles"; type IProps = { city: City; }; +const useStyles = makeStyles((theme: Theme) => + createStyles({ + location: { + color: theme.colors.white, + whiteSpace: "nowrap", + margin: "0px", + padding: "0px", + cursor: "pointer", + }, + }) +); + + function toLocation(router: IRouter, location: Location): void { if (location.name === LocationName.TravelAgency) { router.toTravel(); @@ -35,6 +51,7 @@ function toLocation(router: IRouter, location: Location): void { function LocationLetter(location: Location): React.ReactElement { location.types; const router = use.Router(); + const classes = useStyles(); let L = "X"; if (location.types.includes(LocationType.Company)) L = "C"; if (location.types.includes(LocationType.Gym)) L = "G"; @@ -51,13 +68,7 @@ function LocationLetter(location: Location): React.ReactElement { toLocation(router, location)} > {L}