fix: stuff

This commit is contained in:
Daniel Ledda
2023-01-04 13:17:44 +01:00
parent f5a6ad745e
commit 4955bf6c92
2 changed files with 20 additions and 13 deletions

View File

@@ -28,25 +28,25 @@ export default class ToolboxView extends Rung<HTMLDivElement> implements ISubscr
switch (this.state.selectedTool) {
case "track-unit-type":
return <div className={"details"}>{...TrackUnitTypeList.map(type => (
<button
<div
className={`toolbox-button${type === this.state.activeTrackUnitType ? " active" : ""}`}
onclick={() => this.state.selectTrackUnitTypePaint(type)}>
<div classes={TrackUnitView.getClasses({ on: true, type, stickingType: "none" })} />
</button>
</div>
))}</div>;
case "sticking":
return <div className={"details"}>{...TrackUnitStickingTypeList.reduce((prev, stickingType) => {
if (stickingType !== "none") {
prev.push(<button
prev.push(<div
className={`toolbox-button${stickingType === this.state.activeStickingType ? " active" : ""}`}
onclick={() => this.state.selectStickingTypePaint(stickingType)}>
{new IconView({ iconName: StickingTypeIconMap[stickingType] })}
</button> as HTMLButtonElement);
</div> as HTMLButtonElement);
}
return prev;
}, [] as HTMLElement[])}</div>;
case "eraser":
return <></>;
return <div className={"details hidden"} />;
}
}