Skip to content

Commit 8835817

Browse files
committed
feat: Add create components workflow in unit page
1 parent 531f3be commit 8835817

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

src/library-authoring/LibraryAuthoringPage.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,6 @@ const HeaderActions = () => {
9696
{intl.formatMessage(messages.newContentButton)}
9797
</Button>
9898
)}
99-
{/* This button is temporal in this commit */}
100-
<Button
101-
className="ml-1"
102-
iconBefore={Add}
103-
variant="primary rounded-0"
104-
onClick={openAddContentSidebar}
105-
disabled={readOnly}
106-
>
107-
Add Content
108-
</Button>
10999
</div>
110100
);
111101
};

src/library-authoring/data/apiHooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ export const useUpdateContainer = (containerId: string) => {
637637
/**
638638
* Get the metadata and children for a container in a library
639639
*/
640-
export const useContainerChildren = (containerId: string) => (
640+
export const useContainerChildren = (containerId?: string) => (
641641
useQuery({
642642
enabled: !!containerId,
643643
queryKey: containerQueryKeys.children(containerId),

src/library-authoring/units/LibraryUnitBlocks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const LibraryUnitBlocks = () => {
4242
isLoading,
4343
isError,
4444
error,
45-
} = useContainerChildren(libraryId, unitId);
45+
} = useContainerChildren(unitId);
4646

4747
useEffect(() => setOrderedBlocks(blocks || []), [blocks]);
4848

src/library-authoring/units/LibraryUnitPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const HeaderActions = () => {
2626

2727
const { unitId, readOnly } = useLibraryContext();
2828
const {
29+
openAddContentSidebar,
2930
closeLibrarySidebar,
3031
openUnitInfoSidebar,
3132
sidebarComponentInfo,
@@ -64,6 +65,7 @@ const HeaderActions = () => {
6465
iconBefore={Add}
6566
variant="primary rounded-0"
6667
disabled={readOnly}
68+
onClick={openAddContentSidebar}
6769
>
6870
{intl.formatMessage(messages.newContentButton)}
6971
</Button>

0 commit comments

Comments
 (0)