Add color selection and save it to localStorage

This commit is contained in:
Calli
2023-10-06 19:40:54 +03:00
parent 5a34784c9c
commit e69e65059e
9 changed files with 236 additions and 94 deletions

View File

@@ -1,8 +1,4 @@
import {
SessionContext,
ColorContext,
ColorContextType,
} from "@/app/context/Context";
import { SessionContext, ColorContext } from "@/app/context/Context";
import {
EXTRACTOR_TYPE_IDS,
FACTORY_IDS,
@@ -178,7 +174,7 @@ export const PlanetTableRow = ({
getPlanetUniverse(planet).then(setPlanetInfoUniverse);
}, [planet, character]);
const colorContext = useContext(ColorContext);
const { colors } = useContext(ColorContext);
return (
<TableRow sx={{ "&:last-child td, &:last-child th": { border: 0 } }}>
<TableCell component="th" scope="row">
@@ -210,7 +206,7 @@ export const PlanetTableRow = ({
style={{ display: "flex" }}
>
<Typography
color={timeColor(e.expiry_time, colorContext)}
color={timeColor(e.expiry_time, colors)}
fontSize={theme.custom.smallText}
paddingRight={1}
>