From 841b945ca52e49b9f952653c815792766903b320 Mon Sep 17 00:00:00 2001 From: robo <30987265+Robonau@users.noreply.github.com> Date: Fri, 11 Mar 2022 15:54:45 +0000 Subject: [PATCH] in library badge to manga in sources (#156) * add the in library badge to manga in sources * other layouts done --- src/components/MangaCard.tsx | 57 ++++++++++++++++----- src/components/library/LibraryMangaGrid.tsx | 7 ++- src/screens/SourceMangas.tsx | 1 + src/typings.d.ts | 1 + 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/src/components/MangaCard.tsx b/src/components/MangaCard.tsx index 1e75a2df9e..995055ddb3 100644 --- a/src/components/MangaCard.tsx +++ b/src/components/MangaCard.tsx @@ -75,7 +75,8 @@ interface IProps { const MangaCard = React.forwardRef((props: IProps, ref) => { const { manga: { - id, title, thumbnailUrl, downloadCount, unreadCount: unread, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + id, title, thumbnailUrl, downloadCount, unreadCount: unread, inLibrary, }, gridLayout, } = props; @@ -110,6 +111,13 @@ const MangaCard = React.forwardRef((props: IProps, ref) > + {inLibrary && ( + + In library + + )} { showUnreadBadge && unread! > 0 && ( ((props: IProps, ref) ((props: IProps, ref) > ((props: IProps, ref) + {inLibrary && ( + + In library + + )} { showUnreadBadge && unread! > 0 && ( { + // eslint-disable-next-line no-param-reassign + ele.inLibrary = undefined; + return ele; + }); const showFilteredOutMessage = (active || query) && filteredManga.length === 0 && mangas.length > 0; return (