-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0aab46
commit f4a974b
Showing
11 changed files
with
130 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/library-authoring/collections/CollectionInfoHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Collection } from '../data/api'; | ||
|
||
interface CollectionInfoHeaderProps { | ||
collection?: Collection; | ||
} | ||
|
||
const CollectionInfoHeader = ({ collection } : CollectionInfoHeaderProps) => { | ||
return ( | ||
<div className="d-flex flex-wrap"> | ||
{collection?.title} | ||
</div> | ||
); | ||
}; | ||
|
||
export default CollectionInfoHeader; |
24 changes: 24 additions & 0 deletions
24
src/library-authoring/collections/LibraryCollectionComponents.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Stack } from '@openedx/paragon'; | ||
import { NoComponents, NoSearchResults } from '../EmptyStates'; | ||
import { useSearchContext } from '../../search-manager'; | ||
import { LibraryComponents } from '../components'; | ||
import messages from './messages'; | ||
|
||
const LibraryCollectionComponents = ({ libraryId }: { libraryId: string }) => { | ||
const { totalHits: componentCount, isFiltered } = useSearchContext(); | ||
|
||
if (componentCount === 0) { | ||
return isFiltered ? | ||
<NoSearchResults infoText={messages.noSearchResultsInCollection} /> | ||
: <NoComponents infoText={messages.noComponentsInCollection} addBtnText={messages.addComponentsInCollection} />; | ||
} | ||
|
||
return ( | ||
<Stack direction="vertical" gap={3}> | ||
<h3 className="text-gray">Content ({componentCount})</h3> | ||
<LibraryComponents libraryId={libraryId} variant="full" /> | ||
</Stack> | ||
); | ||
}; | ||
|
||
export default LibraryCollectionComponents; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { default as CollectionInfo } from './CollectionInfo'; | ||
export { default as CollectionInfoHeader } from './CollectionInfoHeader'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.