Skip to content

Commit

Permalink
fix: rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Sep 14, 2024
1 parent f4a974b commit f381881
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/library-authoring/EmptyStates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import { useContentLibrary } from './data/apiHooks';
export const NoComponents = ({
infoText = messages.noComponents,
addBtnText = messages.addComponent,
searchType = "component",
}: {
infoText: MessageDescriptor;
addBtnText: MessageDescriptor;
infoText?: MessageDescriptor;
addBtnText?: MessageDescriptor;
searchType?: "collection" | "component";
}) => {
const { openAddContentSidebar, openCreateCollectionModal } = useContext(LibraryContext);
const { libraryId } = useParams();
Expand Down Expand Up @@ -46,7 +48,7 @@ export const NoComponents = ({
export const NoSearchResults = ({
infoText = messages.noSearchResults,
}: {
infoText: MessageDescriptor;
infoText?: MessageDescriptor;
}) => (
<Stack direction="horizontal" gap={3} className="my-6 justify-content-center">
<FormattedMessage {...infoText} />
Expand Down
1 change: 0 additions & 1 deletion src/library-authoring/LibraryLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import LibraryAuthoringPage from './LibraryAuthoringPage';
import { LibraryProvider } from './common/context';
import { CreateCollectionModal } from './create-collection';
import { invalidateComponentData } from './data/apiHooks';
import LibraryCollectionPageWrapper from './LibraryCollectionPage';
import LibraryCollectionPageWrapper from './collections/LibraryCollectionPage';

const LibraryLayout = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const LibraryCollectionComponents = ({ libraryId }: { libraryId: string }) => {
if (componentCount === 0) {
return isFiltered ?
<NoSearchResults infoText={messages.noSearchResultsInCollection} />
: <NoComponents infoText={messages.noComponentsInCollection} addBtnText={messages.addComponentsInCollection} />;
: <NoComponents
infoText={messages.noComponentsInCollection}
addBtnText={messages.addComponentsInCollection}
/>;
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/library-authoring/collections/LibraryCollectionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const LibraryCollectionPage = ({
];

return (
<div className="d-flex overflow-auto">
<div className="flex-grow-1 align-content-center">
<div className="d-flex">
<div className="flex-grow-1">
<Header
number={libraryData.slug}
title={libraryData.title}
Expand Down
6 changes: 5 additions & 1 deletion src/library-authoring/collections/LibraryCollections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ const LibraryCollections = ({ variant }: LibraryCollectionsProps) => {
if (totalCollectionHits === 0) {
return isFiltered ?
<NoSearchResults infoText={messages.noSearchResultsCollections} />
: <NoComponents infoText={messages.noCollections} addBtnText={messages.addCollection} />;
: <NoComponents
infoText={messages.noCollections}
addBtnText={messages.addCollection}
searchType="collection"
/>;
}

return (
Expand Down
6 changes: 3 additions & 3 deletions src/library-authoring/library-sidebar/LibrarySidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const LibrarySidebar = ({ library, collection }: LibrarySidebarProps) => {
const {
sidebarBodyComponent,
closeLibrarySidebar,
currentComponentKey,
currentComponentUsageKey,
} = useContext(LibraryContext);

const bodyComponentMap = {
[SidebarBodyComponentId.AddContent]: <AddContentContainer />,
[SidebarBodyComponentId.Info]: <LibraryInfo library={library} />,
[SidebarBodyComponentId.ComponentInfo]: (
currentComponentKey && <ComponentInfo usageKey={currentComponentKey} />
currentComponentUsageKey && <ComponentInfo usageKey={currentComponentUsageKey} />
),
[SidebarBodyComponentId.CollectionInfo]: <CollectionInfo />,
unknown: null,
Expand All @@ -50,7 +50,7 @@ const LibrarySidebar = ({ library, collection }: LibrarySidebarProps) => {
[SidebarBodyComponentId.AddContent]: <AddContentHeader />,
[SidebarBodyComponentId.Info]: <LibraryInfoHeader library={library} />,
[SidebarBodyComponentId.ComponentInfo]: (
currentComponentKey && <ComponentInfoHeader library={library} usageKey={currentComponentKey} />
currentComponentUsageKey && <ComponentInfoHeader library={library} usageKey={currentComponentUsageKey} />
),
[SidebarBodyComponentId.CollectionInfo]: <CollectionInfoHeader collection={collection} />,
unknown: null,
Expand Down

0 comments on commit f381881

Please sign in to comment.