From e80a8a090211508308aad965dcad69e0ecea14ff Mon Sep 17 00:00:00 2001 From: ostatni5 <26521377+ostatni5@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:50:36 +0100 Subject: [PATCH] remove adding new quantity (#752) --- .../propeteries/category/ObjectInfo.tsx | 29 ++++++++++++------- .../category/PropertiesCategory.tsx | 2 +- .../Sidebar/tabs/EditorSidebarTabTree.tsx | 15 ++++++---- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/ThreeEditor/components/Sidebar/propeteries/category/ObjectInfo.tsx b/src/ThreeEditor/components/Sidebar/propeteries/category/ObjectInfo.tsx index 1ca352db9..1f2315549 100644 --- a/src/ThreeEditor/components/Sidebar/propeteries/category/ObjectInfo.tsx +++ b/src/ThreeEditor/components/Sidebar/propeteries/category/ObjectInfo.tsx @@ -4,23 +4,32 @@ import { Editor } from '../../../../js/Editor'; import { LabelPropertyField, TextPropertyField } from '../fields/PropertyField'; import { useSmartWatchEditorState } from '../../../../util/hooks/signals'; import { PropertiesCategory } from './PropertiesCategory'; +import { isBeam } from '../../../../util/Beam'; export function ObjectInfo(props: { editor: Editor; object: Object3D }) { const { object, editor } = props; const { state: watchedObject } = useSmartWatchEditorState(editor, object); + const visibleFlag = !isBeam(watchedObject); + return ( - - - - { - editor.execute(new SetValueCommand(editor, watchedObject.object, 'name', value)); - }} - /> + + {visibleFlag && ( + <> + + + { + editor.execute( + new SetValueCommand(editor, watchedObject.object, 'name', value) + ); + }} + /> + + )} ); } diff --git a/src/ThreeEditor/components/Sidebar/propeteries/category/PropertiesCategory.tsx b/src/ThreeEditor/components/Sidebar/propeteries/category/PropertiesCategory.tsx index ec19ab095..be406372d 100644 --- a/src/ThreeEditor/components/Sidebar/propeteries/category/PropertiesCategory.tsx +++ b/src/ThreeEditor/components/Sidebar/propeteries/category/PropertiesCategory.tsx @@ -9,7 +9,7 @@ export function PropertiesCategory(props: { const { category, children, visible = true } = props; return ( - + }> {category} diff --git a/src/ThreeEditor/components/Sidebar/tabs/EditorSidebarTabTree.tsx b/src/ThreeEditor/components/Sidebar/tabs/EditorSidebarTabTree.tsx index 51aa12768..c28f16742 100644 --- a/src/ThreeEditor/components/Sidebar/tabs/EditorSidebarTabTree.tsx +++ b/src/ThreeEditor/components/Sidebar/tabs/EditorSidebarTabTree.tsx @@ -9,7 +9,8 @@ import { AccordionSummaryProps, styled, Divider, - Stack + Stack, + AccordionProps } from '@mui/material'; import { ReactElement } from 'react'; import { Object3D } from 'three'; @@ -47,11 +48,13 @@ const AccordionDetails = styled(MuiAccordionDetails)(({ theme }) => ({ paddingTop: 0 })); -const Accordion = styled(MuiAccordion)(({ theme }) => ({ - '&.Mui-expanded': { - margin: '0' - } -})); +const Accordion = styled((props: AccordionProps) => )( + ({ theme }) => ({ + '&.Mui-expanded': { + margin: '0' + } + }) +); interface TreeElement { title: string;