From adb7247f17b6a5702f55f5f2772d731c16bccf4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Thu, 3 Oct 2024 19:22:16 -0300 Subject: [PATCH] feat: move library props to context (WIP) --- src/content-tags-drawer/ContentTagsDrawer.tsx | 12 +- .../LibraryAuthoringPage.test.tsx | 2 +- .../LibraryAuthoringPage.tsx | 30 +-- .../collections/CollectionDetails.test.tsx | 25 +- .../collections/CollectionDetails.tsx | 34 +-- .../collections/CollectionInfo.tsx | 23 +- .../collections/CollectionInfoHeader.test.tsx | 49 ++-- .../collections/CollectionInfoHeader.tsx | 26 +- .../collections/LibraryCollectionPage.tsx | 2 +- src/library-authoring/common/context.tsx | 30 ++- .../component-info/ComponentDetails.test.tsx | 38 +-- .../component-info/ComponentDetails.tsx | 15 +- .../component-info/ComponentInfo.tsx | 49 ++-- .../ComponentInfoHeader.test.tsx | 120 +++------ .../component-info/ComponentInfoHeader.tsx | 20 +- .../ComponentManagement.test.tsx | 46 ++-- .../component-info/ComponentManagement.tsx | 13 +- .../component-info/ComponentPreview.tsx | 15 +- .../component-picker/ComponentPicker.tsx | 23 +- .../component-picker/SelectLibrary.tsx | 5 +- .../component-picker/messages.ts | 10 + .../components/BaseComponentCard.tsx | 4 +- src/library-authoring/data/api.mocks.ts | 70 +++++- src/library-authoring/data/api.ts | 3 +- .../library-info/LibraryInfo.test.tsx | 236 ++++++++---------- .../library-info/LibraryInfo.tsx | 19 +- .../library-info/LibraryInfoHeader.test.tsx | 139 ++++------- .../library-info/LibraryInfoHeader.tsx | 22 +- .../library-info/LibraryPublishStatus.tsx | 56 +++-- .../library-sidebar/LibrarySidebar.tsx | 29 +-- 30 files changed, 599 insertions(+), 566 deletions(-) diff --git a/src/content-tags-drawer/ContentTagsDrawer.tsx b/src/content-tags-drawer/ContentTagsDrawer.tsx index 28ab128d94..8dac497dcc 100644 --- a/src/content-tags-drawer/ContentTagsDrawer.tsx +++ b/src/content-tags-drawer/ContentTagsDrawer.tsx @@ -154,7 +154,11 @@ const ContentTagsDrawerVariantFooter = ({ onClose }: ContentTagsDrawerVariantFoo ); }; -const ContentTagsComponentVariantFooter = () => { +interface ContentTagsComponentVariantFooterProps { + readOnly?: boolean; +} + +const ContentTagsComponentVariantFooter = ({ readOnly = false }: ContentTagsComponentVariantFooterProps) => { const intl = useIntl(); const { commitGlobalStagedTagsStatus, @@ -195,7 +199,7 @@ const ContentTagsComponentVariantFooter = () => { )} - ) : ( + ) : !readOnly && (