merged contracts page fix

This commit is contained in:
Carter 2025-11-10 13:07:40 -06:00
commit 4c5c9ba8be
3 changed files with 39 additions and 40 deletions

View file

@ -35,7 +35,7 @@ interface Props {
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = makeStyles((theme: Theme) => ({
avatar: { avatar: {
color: useThemeType() === "light" ? theme.palette.common.black : theme.palette.common.white, color: theme.palette.mode === "light" ? theme.palette.common.black : theme.palette.common.white,
backgroundColor: "transparent", backgroundColor: "transparent",
width: theme.spacing(5), width: theme.spacing(5),
height: theme.spacing(5), height: theme.spacing(5),

View file

@ -248,7 +248,7 @@ export default function GateSVG(props: Props) {
values.push( values.push(
<g key={"finalTemp"} id={"finalTemp"} data-name={"finalTemp"}> <g key={"finalTemp"} id={"finalTemp"} data-name={"finalTemp"}>
<text fontSize={7} className={classes.fontBase} x={100} y={85}> <text fontSize={7} className={classes.fontBase} x={100} y={85}>
{convertFinalTemp(finalTemp).toFixed(2)}° {convertFinalTemp(finalTemp).toFixed(2)}
{user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT {user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
? "°F" ? "°F"
: "°C"} : "°C"}
@ -259,7 +259,7 @@ export default function GateSVG(props: Props) {
values.push( values.push(
<g key={"ambientTemp"} id={"ambientTemp"} data-name={"ambientTemp"}> <g key={"ambientTemp"} id={"ambientTemp"} data-name={"ambientTemp"}>
<text fontSize={7} className={classes.fontBase} x={30} y={114}> <text fontSize={7} className={classes.fontBase} x={30} y={114}>
Ambient: {ambientTemp}° Ambient: {ambientTemp}
{user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT {user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
? "°F" ? "°F"
: "°C"} : "°C"}
@ -270,11 +270,11 @@ export default function GateSVG(props: Props) {
values.push( values.push(
<g key={"tempChain"} id={"tempChain"} data-name={"tempChain"}> <g key={"tempChain"} id={"tempChain"} data-name={"tempChain"}>
<text fontSize={7} className={classes.fontBase} x={30} y={149}> <text fontSize={7} className={classes.fontBase} x={30} y={149}>
T1: {innerTemps.t1}° T1: {innerTemps.t1}
{user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT {user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
? "°F" ? "°F"
: "°C"} : "°C"}
, T2: {innerTemps.t2}° , T2: {innerTemps.t2}
{user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT {user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
? "°F" ? "°F"
: "°C"} : "°C"}

View file

@ -52,11 +52,9 @@ function TabPanelMine(props: TabPanelProps) {
); );
} }
const useStyles = makeStyles((theme: Theme) => { const useStyles = makeStyles((theme: Theme) => ({
const themeType = useThemeType();
return ({
inactiveButton: { inactiveButton: {
color: themeType === "light" ? theme.palette.common.black : theme.palette.common.white, color: theme.palette.mode === "light" ? theme.palette.common.black : theme.palette.common.white,
backgroundColor: "transparent", backgroundColor: "transparent",
width: theme.spacing(5), width: theme.spacing(5),
height: theme.spacing(5), height: theme.spacing(5),
@ -64,7 +62,7 @@ const useStyles = makeStyles((theme: Theme) => {
borderColor: theme.palette.divider borderColor: theme.palette.divider
}, },
activeButton: { activeButton: {
color: themeType === "light" ? theme.palette.common.black : theme.palette.common.white, color: theme.palette.mode === "light" ? theme.palette.common.black : theme.palette.common.white,
backgroundColor: theme.palette.primary.main, backgroundColor: theme.palette.primary.main,
width: theme.spacing(5), width: theme.spacing(5),
height: theme.spacing(5), height: theme.spacing(5),
@ -75,8 +73,7 @@ const useStyles = makeStyles((theme: Theme) => {
height: "100%", height: "100%",
width: "30%" width: "30%"
} }
}); }));
});
export default function Contract() { export default function Contract() {
// const match = useRouteMatch<MatchParams>(); // const match = useRouteMatch<MatchParams>();
@ -148,7 +145,9 @@ export default function Contract() {
}) })
.catch(err => { .catch(err => {
//setInvalid(true); //setInvalid(true);
}); }).finally(() => {
setLoading(false)
})
} }
}, [contractKey, contractAPI, as]); // eslint-disable-line react-hooks/exhaustive-deps }, [contractKey, contractAPI, as]); // eslint-disable-line react-hooks/exhaustive-deps