Skip to content

Commit 0f3aff0

Browse files
add collapsible to 3d inspector
1 parent e3a7b22 commit 0f3aff0

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

editor/scaffolds/inspector/section-layout.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ import {
1010
import { useTargetContainer } from "hooks/use-target-node";
1111
import { IRadius } from "@reflect-ui/core";
1212
import { InspectLayout } from "./inspect-layout";
13+
import {
14+
Collapsible,
15+
CollapsibleTrigger,
16+
CollapsibleContent,
17+
} from "@radix-ui/react-collapsible";
18+
19+
import { ChevronUpIcon, ChevronDownIcon } from "@radix-ui/react-icons";
1320

1421
export function LayoutSection() {
1522
const { target, root } = useTargetContainer();
23+
const [inspectorOpen, setInspectorOpen] = React.useState(false);
1624

1725
if (!target) {
1826
return <></>;
@@ -71,7 +79,21 @@ export function LayoutSection() {
7179
)}
7280
</PropertyLines>
7381
<PropertyLines padding={0}>
74-
<InspectLayout />
82+
<Collapsible open={inspectorOpen} onOpenChange={setInspectorOpen}>
83+
<CollapsibleTrigger asChild>
84+
<PropertyGroupHeader>
85+
<h6>Inspect Layout</h6>
86+
{inspectorOpen ? (
87+
<ChevronUpIcon color="white" />
88+
) : (
89+
<ChevronDownIcon color="white" />
90+
)}
91+
</PropertyGroupHeader>
92+
</CollapsibleTrigger>
93+
<CollapsibleContent>
94+
<InspectLayout />
95+
</CollapsibleContent>
96+
</Collapsible>
7597
</PropertyLines>
7698
</PropertyGroup>
7799
);

ui/editor-ui

0 commit comments

Comments
 (0)