From c64f233765c6202a4f34357b7b18cb6a761eb861 Mon Sep 17 00:00:00 2001 From: robo <30987265+Robonau@users.noreply.github.com> Date: Sun, 6 Mar 2022 21:57:52 +0000 Subject: [PATCH 1/2] add the in library badge to manga in sources --- src/components/MangaCard.tsx | 27 ++++++++++++++++----- src/components/library/LibraryMangaGrid.tsx | 7 +++++- src/screens/SourceMangas.tsx | 1 + src/typings.d.ts | 1 + 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/MangaCard.tsx b/src/components/MangaCard.tsx index 1e75a2df9e..42e4d56d1e 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) { + // eslint-disable-next-line no-param-reassign + ele.inLibrary = undefined; + return ele; + }); const showFilteredOutMessage = (active || query) && filteredManga.length === 0 && mangas.length > 0; return ( Date: Sun, 6 Mar 2022 22:06:51 +0000 Subject: [PATCH 2/2] other layouts done --- src/components/MangaCard.tsx | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/components/MangaCard.tsx b/src/components/MangaCard.tsx index 42e4d56d1e..995055ddb3 100644 --- a/src/components/MangaCard.tsx +++ b/src/components/MangaCard.tsx @@ -204,13 +204,22 @@ const MangaCard = React.forwardRef((props: IProps, ref) > ((props: IProps, ref) + {inLibrary && ( + + In library + + )} { showUnreadBadge && unread! > 0 && (