Tweak style for stats page

This commit is contained in:
nickofolas 2022-04-07 13:17:27 -05:00
parent 3651a8d379
commit a9a31662ce

@ -19,7 +19,6 @@ import { Money } from "./React/Money";
import { StatsRow } from "./React/StatsRow"; import { StatsRow } from "./React/StatsRow";
import { StatsTable } from "./React/StatsTable"; import { StatsTable } from "./React/StatsTable";
interface EmployersModalProps { interface EmployersModalProps {
open: boolean; open: boolean;
onClose: () => void; onClose: () => void;
@ -101,12 +100,13 @@ function CurrentBitNode(): React.ReactElement {
const player = use.Player(); const player = use.Player();
if (player.sourceFiles.length > 0) { if (player.sourceFiles.length > 0) {
const index = "BitNode" + player.bitNodeN; const index = "BitNode" + player.bitNodeN;
const currentSourceFile = player.sourceFiles.find((sourceFile) => sourceFile.n == player.bitNodeN);
const lvl = currentSourceFile ? currentSourceFile.lvl : 0;
return ( return (
<Box sx={{ width: "75%" }}> <Box sx={{ width: "75%" }}>
<Paper sx={{ p: 1 }}> <Paper sx={{ p: 1 }}>
<Typography variant="h6"> <Typography variant="h6">
BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {Math.min(SourceFileFlags[player.bitNodeN] + 1, 3)} BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl})
)
</Typography> </Typography>
<Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography> <Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography>
</Paper> </Paper>
@ -239,7 +239,9 @@ export function CharacterStats(): React.ReactElement {
return ( return (
<> <>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", width: "75%", minWidth: "fit-content" }}> <Box
sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", width: "75%", minWidth: "fit-content", mb: 1, gap: 1 }}
>
<Paper sx={{ p: 1 }}> <Paper sx={{ p: 1 }}>
<Typography variant="h6">General</Typography> <Typography variant="h6">General</Typography>
<Table> <Table>
@ -344,7 +346,7 @@ export function CharacterStats(): React.ReactElement {
</Table> </Table>
</Paper> </Paper>
</Box> </Box>
<Box sx={{ width: "75%", minWidth: "fit-content" }}> <Box sx={{ width: "75%", minWidth: "fit-content", mb: 1 }}>
<Paper sx={{ p: 1 }}> <Paper sx={{ p: 1 }}>
<Typography variant="h6">Multipliers</Typography> <Typography variant="h6">Multipliers</Typography>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }}> <Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 1 }}>
@ -495,15 +497,13 @@ export function CharacterStats(): React.ReactElement {
</Paper> </Paper>
</Box> </Box>
<Box sx={{ width: "75%", minWidth: "fit-content" }}> <Box sx={{ width: "75%", minWidth: "fit-content", mb: 1 }}>
<Paper sx={{ p: 1 }}> <Paper sx={{ p: 1 }}>
<Typography variant="h6">Time Played</Typography> <Typography variant="h6">Time Played</Typography>
<Table> <Table>
<TableBody> <TableBody>
{timeRows.map(([name, content]) => ( {timeRows.map(([name, content]) => (
<React.Fragment key={name}> <StatsRow key={name} name={name} color={Settings.theme.primary} data={{ content: content }} />
<StatsRow name={name} color={Settings.theme.primary} data={{ content: content }} />
</React.Fragment>
))} ))}
</TableBody> </TableBody>
</Table> </Table>