various display updates to use the custom grain name and colors
This commit is contained in:
parent
e2ad43975d
commit
be8dc1d11f
8 changed files with 64 additions and 46 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue