Skip to content

Commit f381881

Browse files
committed
fix: rebase issues
1 parent f4a974b commit f381881

File tree

6 files changed

+19
-11
lines changed

6 files changed

+19
-11
lines changed

src/library-authoring/EmptyStates.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ import { useContentLibrary } from './data/apiHooks';
1414
export const NoComponents = ({
1515
infoText = messages.noComponents,
1616
addBtnText = messages.addComponent,
17+
searchType = "component",
1718
}: {
18-
infoText: MessageDescriptor;
19-
addBtnText: MessageDescriptor;
19+
infoText?: MessageDescriptor;
20+
addBtnText?: MessageDescriptor;
21+
searchType?: "collection" | "component";
2022
}) => {
2123
const { openAddContentSidebar, openCreateCollectionModal } = useContext(LibraryContext);
2224
const { libraryId } = useParams();
@@ -46,7 +48,7 @@ export const NoComponents = ({
4648
export const NoSearchResults = ({
4749
infoText = messages.noSearchResults,
4850
}: {
49-
infoText: MessageDescriptor;
51+
infoText?: MessageDescriptor;
5052
}) => (
5153
<Stack direction="horizontal" gap={3} className="my-6 justify-content-center">
5254
<FormattedMessage {...infoText} />

src/library-authoring/LibraryLayout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import LibraryAuthoringPage from './LibraryAuthoringPage';
1313
import { LibraryProvider } from './common/context';
1414
import { CreateCollectionModal } from './create-collection';
1515
import { invalidateComponentData } from './data/apiHooks';
16-
import LibraryCollectionPageWrapper from './LibraryCollectionPage';
1716
import LibraryCollectionPageWrapper from './collections/LibraryCollectionPage';
1817

1918
const LibraryLayout = () => {

src/library-authoring/collections/LibraryCollectionComponents.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const LibraryCollectionComponents = ({ libraryId }: { libraryId: string }) => {
1010
if (componentCount === 0) {
1111
return isFiltered ?
1212
<NoSearchResults infoText={messages.noSearchResultsInCollection} />
13-
: <NoComponents infoText={messages.noComponentsInCollection} addBtnText={messages.addComponentsInCollection} />;
13+
: <NoComponents
14+
infoText={messages.noComponentsInCollection}
15+
addBtnText={messages.addComponentsInCollection}
16+
/>;
1417
}
1518

1619
return (

src/library-authoring/collections/LibraryCollectionPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ const LibraryCollectionPage = ({
137137
];
138138

139139
return (
140-
<div className="d-flex overflow-auto">
141-
<div className="flex-grow-1 align-content-center">
140+
<div className="d-flex">
141+
<div className="flex-grow-1">
142142
<Header
143143
number={libraryData.slug}
144144
title={libraryData.title}

src/library-authoring/collections/LibraryCollections.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ const LibraryCollections = ({ variant }: LibraryCollectionsProps) => {
4040
if (totalCollectionHits === 0) {
4141
return isFiltered ?
4242
<NoSearchResults infoText={messages.noSearchResultsCollections} />
43-
: <NoComponents infoText={messages.noCollections} addBtnText={messages.addCollection} />;
43+
: <NoComponents
44+
infoText={messages.noCollections}
45+
addBtnText={messages.addCollection}
46+
searchType="collection"
47+
/>;
4448
}
4549

4650
return (

src/library-authoring/library-sidebar/LibrarySidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ const LibrarySidebar = ({ library, collection }: LibrarySidebarProps) => {
3333
const {
3434
sidebarBodyComponent,
3535
closeLibrarySidebar,
36-
currentComponentKey,
36+
currentComponentUsageKey,
3737
} = useContext(LibraryContext);
3838

3939
const bodyComponentMap = {
4040
[SidebarBodyComponentId.AddContent]: <AddContentContainer />,
4141
[SidebarBodyComponentId.Info]: <LibraryInfo library={library} />,
4242
[SidebarBodyComponentId.ComponentInfo]: (
43-
currentComponentKey && <ComponentInfo usageKey={currentComponentKey} />
43+
currentComponentUsageKey && <ComponentInfo usageKey={currentComponentUsageKey} />
4444
),
4545
[SidebarBodyComponentId.CollectionInfo]: <CollectionInfo />,
4646
unknown: null,
@@ -50,7 +50,7 @@ const LibrarySidebar = ({ library, collection }: LibrarySidebarProps) => {
5050
[SidebarBodyComponentId.AddContent]: <AddContentHeader />,
5151
[SidebarBodyComponentId.Info]: <LibraryInfoHeader library={library} />,
5252
[SidebarBodyComponentId.ComponentInfo]: (
53-
currentComponentKey && <ComponentInfoHeader library={library} usageKey={currentComponentKey} />
53+
currentComponentUsageKey && <ComponentInfoHeader library={library} usageKey={currentComponentUsageKey} />
5454
),
5555
[SidebarBodyComponentId.CollectionInfo]: <CollectionInfoHeader collection={collection} />,
5656
unknown: null,

0 commit comments

Comments
 (0)