mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
Use the white property to replace the hard-coded "white" in the world map.
This commit is contained in:
parent
b3c5465ac2
commit
106b8e13a3
@ -2,6 +2,9 @@ import React from "react";
|
|||||||
import { CityName } from "../../Locations/data/CityNames";
|
import { CityName } from "../../Locations/data/CityNames";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Tooltip from "@mui/material/Tooltip";
|
import Tooltip from "@mui/material/Tooltip";
|
||||||
|
import { Theme } from "@mui/material/styles";
|
||||||
|
import makeStyles from "@mui/styles/makeStyles";
|
||||||
|
import createStyles from "@mui/styles/createStyles";
|
||||||
|
|
||||||
interface ICityProps {
|
interface ICityProps {
|
||||||
currentCity: CityName;
|
currentCity: CityName;
|
||||||
@ -9,13 +12,25 @@ interface ICityProps {
|
|||||||
onTravel: (city: CityName) => void;
|
onTravel: (city: CityName) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
travel: {
|
||||||
|
color: theme.colors.white,
|
||||||
|
lineHeight: "1em",
|
||||||
|
whiteSpace: "pre",
|
||||||
|
cursor: "pointer"
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
function City(props: ICityProps): React.ReactElement {
|
function City(props: ICityProps): React.ReactElement {
|
||||||
|
const classes = useStyles();
|
||||||
if (props.city !== props.currentCity) {
|
if (props.city !== props.currentCity) {
|
||||||
return (
|
return (
|
||||||
<Tooltip title={<Typography>{props.city}</Typography>}>
|
<Tooltip title={<Typography>{props.city}</Typography>}>
|
||||||
<span
|
<span
|
||||||
onClick={() => props.onTravel(props.city)}
|
onClick={() => props.onTravel(props.city)}
|
||||||
style={{ color: "white", lineHeight: "1em", whiteSpace: "pre", cursor: "pointer" }}
|
className={classes.travel}
|
||||||
>
|
>
|
||||||
{props.city[0]}
|
{props.city[0]}
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user