Skip to content

Commit

Permalink
Merge pull request #2 from RyugaRyuzaki/develop
Browse files Browse the repository at this point in the history
develop
  • Loading branch information
RyugaRyuzaki authored May 8, 2024
2 parents 5b1122b + bb3d390 commit 9c8eea0
Show file tree
Hide file tree
Showing 17 changed files with 709 additions and 75 deletions.
241 changes: 241 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"axios": "^1.6.8",
"camera-controls": "^2.8.3",
"class-variance-authority": "^0.7.0",
Expand Down
2 changes: 2 additions & 0 deletions src/BimModel/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Components,
CubeMapComponent,
disposeSignals,
MaterialComponent,
ModelingComponent,
PropertyComponent,
Expand All @@ -25,6 +26,7 @@ export class BimModel {
}
async dispose() {
this.components.dispose();
disposeSignals();
}

private init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React, {FC, useState} from "react";
import {IDiscipline, IModeling, ITool} from "@BimModel/src/types";
import ModelingButton from "./ModelingButton";
import {useSignalEffect} from "@preact/signals-react";
import {modelingSignal} from "@BimModel/src/Signals";
import {getModelings} from "../constants";
import ToolButton from "./ToolButton";

const ContentModeling: FC<Props> = ({types, discipline}) => {
const [tools, setTools] = useState<IModeling[]>([]);
useSignalEffect(() => {
const modelings = modelingSignal.value
? getModelings(modelingSignal.value.type)
: [];
setTools(modelings);
if (!modelingSignal.value) return;
const {discipline} = modelingSignal.value;
});
return (
<div className="relative h-full w-full flex justify-start items-center">
{types.map((type: ITool, index: number) => (
<ModelingButton
key={type.type + "-" + index}
type={type}
discipline={discipline}
/>
))}
{tools.length > 0 && (
<div className="h-[80%] w-[1px] dark:bg-white bg-black mx-2 my-auto"></div>
)}
{tools.map((tool: IModeling, index: number) => (
<ToolButton
key={`${tool.drawType}-${index}-${discipline}`}
tool={tool}
/>
))}
</div>
);
};
interface Props {
types: ITool[];
discipline: IDiscipline;
}
export default ContentModeling;
Loading

0 comments on commit 9c8eea0

Please sign in to comment.