diff --git a/static/app-strings.json b/static/app-strings.json index e12e8ba5e..06dd56c6c 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2216,5 +2216,8 @@ "Enable Data Hosting": "Enable Data Hosting", "Data over the limit will be deleted within 30 minutes. This will make the Yrbl cry a little bit.": "Data over the limit will be deleted within 30 minutes. This will make the Yrbl cry a little bit.", "Choose %asset%": "Choose %asset%", + "Showing %filtered% results of %total%": "Showing %filtered% results of %total%", + "filtered": "filtered", + "View All Playlists": "View All Playlists", "--end--": "--end--" } diff --git a/ui/component/collectionsListMine/view.jsx b/ui/component/collectionsListMine/view.jsx index 5b8104c49..abad00e0b 100644 --- a/ui/component/collectionsListMine/view.jsx +++ b/ui/component/collectionsListMine/view.jsx @@ -25,6 +25,7 @@ const ALL = 'All'; const PRIVATE = 'Private'; const PUBLIC = 'Public'; const COLLECTION_FILTERS = [ALL, PRIVATE, PUBLIC]; +const COLLECTION_SHOW_COUNT = 12; export default function CollectionsListMine(props: Props) { const { @@ -53,18 +54,24 @@ export default function CollectionsListMine(props: Props) { let filteredCollections; if (searchText && collectionsToShow) { - filteredCollections = collectionsToShow.filter((id) => { - return ( - (unpublishedCollections[id] && - unpublishedCollections[id].name.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || - (publishedCollections[id] && - publishedCollections[id].name.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) - ); - }); + filteredCollections = collectionsToShow + .filter((id) => { + return ( + (unpublishedCollections[id] && + unpublishedCollections[id].name.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || + (publishedCollections[id] && + publishedCollections[id].name.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) + ); + }) + .slice(0, COLLECTION_SHOW_COUNT); } else { - filteredCollections = collectionsToShow || []; + filteredCollections = collectionsToShow.slice(0, COLLECTION_SHOW_COUNT) || []; } + const totalLength = collectionsToShow ? collectionsToShow.length : 0; + const filteredLength = filteredCollections.length; + const isTruncated = totalLength > filteredLength; + const watchLater = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.WATCH_LATER_ID); const favorites = builtinCollectionsList.find((list) => list.id === COLLECTIONS_CONSTS.FAVORITES_ID); const builtin = [watchLater, favorites]; @@ -130,7 +137,19 @@ export default function CollectionsListMine(props: Props) {