Filter out duplicated genres in manga page
This commit is contained in:
@@ -23,6 +23,7 @@ import type {
|
|||||||
MangaSourceIdInfo,
|
MangaSourceIdInfo,
|
||||||
} from '@/features/manga/Manga.types.ts';
|
} from '@/features/manga/Manga.types.ts';
|
||||||
import { SearchLink } from '@/features/manga/components/details/SearchLink.tsx';
|
import { SearchLink } from '@/features/manga/components/details/SearchLink.tsx';
|
||||||
|
import uniq from 'lodash/fp/uniq';
|
||||||
|
|
||||||
const OPEN_CLOSE_BUTTON_HEIGHT = '35px';
|
const OPEN_CLOSE_BUTTON_HEIGHT = '35px';
|
||||||
const DESCRIPTION_COLLAPSED_SIZE = 75;
|
const DESCRIPTION_COLLAPSED_SIZE = 75;
|
||||||
@@ -46,7 +47,7 @@ export const DescriptionGenre = ({
|
|||||||
const collapsedSize = description
|
const collapsedSize = description
|
||||||
? Math.min(DESCRIPTION_COLLAPSED_SIZE, descriptionHeight ?? DESCRIPTION_COLLAPSED_SIZE)
|
? Math.min(DESCRIPTION_COLLAPSED_SIZE, descriptionHeight ?? DESCRIPTION_COLLAPSED_SIZE)
|
||||||
: 0;
|
: 0;
|
||||||
const genres = useMemo(() => mangaGenres.filter(Boolean), [mangaGenres]);
|
const genres = useMemo(() => uniq(mangaGenres.filter(Boolean)), [mangaGenres]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in New Issue
Block a user