various display updates to use the custom grain name and colors

This commit is contained in:
csawatzky 2025-12-17 14:04:37 -06:00
parent e2ad43975d
commit be8dc1d11f
8 changed files with 64 additions and 46 deletions

View file

@ -391,7 +391,6 @@ export default function ComponentForm(props: Props) {
};
const updateCustomGrain = (grainSettings?: pond.GrainSettings) => {
console.log("update custom grain")
let f = cloneDeep(form)
f.component.settings.customGrain = grainSettings
f.component.settings.grainType = pond.Grain.GRAIN_CUSTOM

View file

@ -10,6 +10,7 @@ import { Pressure } from "models/Pressure";
import { GrainCable } from "models/GrainCable";
import { extension, Summary } from "pbHelpers/ComponentType";
import { makeStyles } from "@mui/styles";
import { stringToMaterialColour } from "utils";
interface Props {
component: Component | Plenum | Pressure | GrainCable;
@ -109,7 +110,7 @@ export default function UnitMeasurementSummary(props: Props) {
const grainColor = () => {
if(component.settings.grainType === pond.Grain.GRAIN_CUSTOM && component.settings.customGrain?.name){
return
return stringToMaterialColour(component.settings.customGrain.name)
}
return GrainDescriber(component.settings.grainType).colour
}