From 809e8a32bd4610a5af1af003f870d9c3dfb625cb Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 23 May 2024 02:29:08 +0200 Subject: [PATCH] Remove "react-device-detect" dependency --- package.json | 1 - src/components/manga/MangaBadges.tsx | 5 ++++- src/components/manga/MangaGridCard.tsx | 13 ++++++------- src/components/manga/MangaListCard.tsx | 13 ++++++------- src/components/manga/MangaOptionButton.tsx | 14 ++++++++++---- src/components/menu/NestedMenuItem.tsx | 8 +++++--- yarn.lock | 9 +-------- 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 82a86a71..e2f21384 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,6 @@ "p-limit": "5.0.0", "react": "18.3.1", "react-beautiful-dnd": "13.1.1", - "react-device-detect": "2.2.3", "react-dom": "18.3.1", "react-i18next": "14.1.1", "react-lazily": "0.9.2", diff --git a/src/components/manga/MangaBadges.tsx b/src/components/manga/MangaBadges.tsx index 92c0228b..e68b8c69 100644 --- a/src/components/manga/MangaBadges.tsx +++ b/src/components/manga/MangaBadges.tsx @@ -12,6 +12,7 @@ import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import { useLibraryOptionsContext } from '@/components/context/LibraryOptionsContext.tsx'; import { MangaCardMode } from '@/components/manga/MangaCard.types.tsx'; +import { MediaQuery } from '@/lib/ui/MediaQuery.tsx'; const BadgeContainer = styled('div')({ display: 'flex', @@ -43,13 +44,15 @@ export const MangaBadges = ({ }) => { const { t } = useTranslation(); + const isTouchDevice = MediaQuery.useIsTouchDevice(); + const { options: { showUnreadBadge, showDownloadBadge }, } = useLibraryOptionsContext(); return ( - {inLibraryIndicator && mode === 'source' && ( + {!isTouchDevice && inLibraryIndicator && mode === 'source' && (