From 9cdea6a91825c4e1b075d7bfa4ef7480724801f3 Mon Sep 17 00:00:00 2001 From: Aditya Mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:16:36 +0530 Subject: [PATCH] cleanup unused imports and fix styling in panel layout (#10291) * replace inline style with tailwind * remove unused imports in panel --------- Co-authored-by: Andy Chen --- .../ui/src/components/editor/layout/Panel.tsx | 84 +++---------------- .../panels/Properties/material/index.tsx | 4 +- 2 files changed, 12 insertions(+), 76 deletions(-) diff --git a/packages/ui/src/components/editor/layout/Panel.tsx b/packages/ui/src/components/editor/layout/Panel.tsx index 04dbd6926f..d36f46a517 100755 --- a/packages/ui/src/components/editor/layout/Panel.tsx +++ b/packages/ui/src/components/editor/layout/Panel.tsx @@ -26,47 +26,8 @@ Ethereal Engine. All Rights Reserved. import React, { ReactNode } from 'react' import Text from '../../../primitives/tailwind/Text' -const panelIconStyles = { - color: 'var(--textColor)', - marginRight: '6px', - width: '18px' -} - -const panelCheckboxStyles = { - color: 'var(--textColor)', - position: 'relative', - padding: '0px' -} - -const panelContainerStyles = { - position: 'relative', - display: 'flex', - flex: 1, - flexDirection: 'column', - borderRadius: '4px', - backgroundColor: 'var(--dockBackground)', - overflow: 'hidden', - userSelect: 'none' -} - -const panelToolbarStyles = { - display: 'flex', - padding: '4px', - height: '24px', - alignItems: 'center', - borderBottom: '1px solid rgba(0, 0, 0, 0.2)' -} - -const panelContentStyles = { - display: 'flex', - flex: 1, - flexDirection: 'column', - position: 'relative', - overflow: 'hidden' -} - -export const PanelIcon = ({ as: IconComponent, size = 12 }) => { - return +const PanelIcon = ({ as: IconComponent, size = 12 }) => { + return } export const PanelTitle = ({ children }) => { @@ -77,33 +38,8 @@ export const PanelTitle = ({ children }) => { ) } -export const PanelCheckbox = ({ children }) => { - return
{children}
-} - export const PanelDragContainer = ({ children }) => { - // .dock-tab styled in Editor2Container.css - return
{children}
-} - -export const PanelContainer = ({ children, ...rest }) => { - return ( -
- {children} -
- ) -} - -export const PanelToolbar = ({ children }) => { - return ( -
- {children} -
- ) -} - -export const PanelContent = ({ children }) => { - return
{children}
+ return
{children}
} interface PanelProps { @@ -111,19 +47,21 @@ interface PanelProps { title: string toolbarContent?: React.ReactNode children?: ReactNode - // Add any other props you want to accept } const Panel: React.FC = ({ icon, title, children, toolbarContent, ...rest }) => { return ( - - +
+
{icon && } {title} {toolbarContent} - - {children} - +
+
{children}
+
) } diff --git a/packages/ui/src/components/editor/panels/Properties/material/index.tsx b/packages/ui/src/components/editor/panels/Properties/material/index.tsx index 040af9bd76..d96d280e61 100644 --- a/packages/ui/src/components/editor/panels/Properties/material/index.tsx +++ b/packages/ui/src/components/editor/panels/Properties/material/index.tsx @@ -23,7 +23,6 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20 Ethereal Engine. All Rights Reserved. */ -import MaterialLibraryIcon from '@mui/icons-material/Yard' import React, { useCallback, useEffect } from 'react' import { useTranslation } from 'react-i18next' import { Texture, Uniform } from 'three' @@ -58,7 +57,7 @@ import Button from '../../../../../primitives/tailwind/Button' import InputGroup from '../../../input/Group' import SelectInput from '../../../input/Select' import StringInput from '../../../input/String' -import { PanelDragContainer, PanelIcon, PanelTitle } from '../../../layout/Panel' +import { PanelDragContainer, PanelTitle } from '../../../layout/Panel' import { InfoTooltip } from '../../../layout/Tooltip' import ParameterInput from '../../../properties/parameter' @@ -304,7 +303,6 @@ export const MaterialPropertyTitle = () => { return (
- {t('editor:properties.mesh.materialProperties.title')}