From d5f6ec0d6c057927488759c3f4f33f458c1cdd82 Mon Sep 17 00:00:00 2001 From: aditya-mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:39:26 +0530 Subject: [PATCH 1/2] do not show empty brackets when no asset resource is selected --- .../editor/src/components/assets/AssetsPreviewPanel.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/editor/src/components/assets/AssetsPreviewPanel.tsx b/packages/editor/src/components/assets/AssetsPreviewPanel.tsx index 245cfd96ca..ccb9733445 100644 --- a/packages/editor/src/components/assets/AssetsPreviewPanel.tsx +++ b/packages/editor/src/components/assets/AssetsPreviewPanel.tsx @@ -160,11 +160,15 @@ export const AssetsPreviewPanel = React.forwardRef(({ hideHeading }: Props, ref) } } + console.log('debug1 the preview panel resource props', previewPanel.resourceProps) + return ( <> {!hideHeading && (
- {`${previewPanel.resourceProps.name} (${previewPanel.resourceProps.size})`}{' '} + {previewPanel.resourceProps.name && + previewPanel.resourceProps.size && + `${previewPanel.resourceProps.name} (${previewPanel.resourceProps.size})`}
)} {previewPanel.PreviewSource && } From 41a7e533fe01978bfbc48aee9d310650f0c9f810 Mon Sep 17 00:00:00 2001 From: aditya-mitra <55396651+aditya-mitra@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:46:05 +0530 Subject: [PATCH 2/2] remove console log --- packages/editor/src/components/assets/AssetsPreviewPanel.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/editor/src/components/assets/AssetsPreviewPanel.tsx b/packages/editor/src/components/assets/AssetsPreviewPanel.tsx index ccb9733445..2224a66035 100644 --- a/packages/editor/src/components/assets/AssetsPreviewPanel.tsx +++ b/packages/editor/src/components/assets/AssetsPreviewPanel.tsx @@ -160,8 +160,6 @@ export const AssetsPreviewPanel = React.forwardRef(({ hideHeading }: Props, ref) } } - console.log('debug1 the preview panel resource props', previewPanel.resourceProps) - return ( <> {!hideHeading && (