+
+
+
-
- }
- subtitle={intl.formatMessage(messages.headingSubtitle)}
- headerActions={}
+ }
+ subtitle={intl.formatMessage(messages.headingSubtitle)}
+ headerActions={}
+ />
+
+
+
+
+
+
+
+
+
+ )}
/>
-
-
-
-
-
-
-
-
-
- )}
- />
- }
- />
- }
- />
- }
- />
-
-
+ }
+ />
+ }
+ />
+ }
+ />
+
-
-
- { sidebarBodyComponent !== null && (
-
-
-
- )}
-
-
+
+
+
+ { !!sidebarBodyComponent && (
+
+
+
+ )}
+
);
};
diff --git a/src/library-authoring/common/context.tsx b/src/library-authoring/common/context.tsx
index 548b39aa35..bf7f98e982 100644
--- a/src/library-authoring/common/context.tsx
+++ b/src/library-authoring/common/context.tsx
@@ -4,6 +4,7 @@ import React from 'react';
export enum SidebarBodyComponentId {
AddContent = 'add-content',
Info = 'info',
+ ComponentInfo = 'component-info',
}
export interface LibraryContextData {
@@ -11,6 +12,8 @@ export interface LibraryContextData {
closeLibrarySidebar: () => void;
openAddContentSidebar: () => void;
openInfoSidebar: () => void;
+ openComponentInfoSidebar: (usageKey: string) => void;
+ currentComponentUsageKey?: string;
}
export const LibraryContext = React.createContext({
@@ -18,6 +21,7 @@ export const LibraryContext = React.createContext({
closeLibrarySidebar: () => {},
openAddContentSidebar: () => {},
openInfoSidebar: () => {},
+ openComponentInfoSidebar: (_usageKey: string) => {}, // eslint-disable-line @typescript-eslint/no-unused-vars
} as LibraryContextData);
/**
@@ -25,21 +29,42 @@ export const LibraryContext = React.createContext({
*/
export const LibraryProvider = (props: { children?: React.ReactNode }) => {
const [sidebarBodyComponent, setSidebarBodyComponent] = React.useState