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

@ -34,14 +34,14 @@ 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),
border: "1px solid", border: "1px solid",
borderColor: theme.palette.divider borderColor: theme.palette.divider
} }
})); }));
export default function ObjectControls(props: Props) { export default function ObjectControls(props: Props) {
@ -215,4 +215,4 @@ export default function ObjectControls(props: Props) {
</Grid> </Grid>
</Box> </Box>
); );
} }

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,31 +52,28 @@ function TabPanelMine(props: TabPanelProps) {
); );
} }
const useStyles = makeStyles((theme: Theme) => { const useStyles = makeStyles((theme: Theme) => ({
const themeType = useThemeType(); inactiveButton: {
return ({ color: theme.palette.mode === "light" ? theme.palette.common.black : theme.palette.common.white,
inactiveButton: { backgroundColor: "transparent",
color: themeType === "light" ? theme.palette.common.black : theme.palette.common.white, width: theme.spacing(5),
backgroundColor: "transparent", height: theme.spacing(5),
width: theme.spacing(5), border: "1px solid",
height: theme.spacing(5), borderColor: theme.palette.divider
border: "1px solid", },
borderColor: theme.palette.divider activeButton: {
}, color: theme.palette.mode === "light" ? theme.palette.common.black : theme.palette.common.white,
activeButton: { backgroundColor: theme.palette.primary.main,
color: themeType === "light" ? theme.palette.common.black : theme.palette.common.white, width: theme.spacing(5),
backgroundColor: theme.palette.primary.main, height: theme.spacing(5),
width: theme.spacing(5), border: "1px solid",
height: theme.spacing(5), borderColor: theme.palette.divider
border: "1px solid", },
borderColor: theme.palette.divider drawerPaper: {
}, height: "100%",
drawerPaper: { width: "30%"
height: "100%", }
width: "30%" }));
}
});
});
export default function Contract() { export default function Contract() {
// const match = useRouteMatch<MatchParams>(); // const match = useRouteMatch<MatchParams>();
@ -112,7 +109,7 @@ export default function Contract() {
setPermissions(resp.permissions); setPermissions(resp.permissions);
}); });
}, [as, contractKey, userAPI, user]); }, [as, contractKey, userAPI, user]);
useEffect(() => { useEffect(() => {
if (!loading) { if (!loading) {
setLoading(true); setLoading(true);
@ -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