diff --git a/app/(pages)/anime/[slug]/components/characters.tsx b/app/(pages)/anime/[slug]/components/characters.tsx index 8fd05560..b6ae4835 100644 --- a/app/(pages)/anime/[slug]/components/characters.tsx +++ b/app/(pages)/anime/[slug]/components/characters.tsx @@ -36,7 +36,7 @@ const Characters = ({ extended }: Props) => { className={clsx( 'grid grid-cols-3 gap-4 md:grid-cols-5 lg:gap-8', extended && 'md:grid-cols-6', - !extended && 'grid-flow-col grid-cols-scroll-5 overflow-x-auto no-scrollbar -mx-4 px-4' + !extended && 'grid-flow-col grid-cols-scroll auto-cols-scroll overflow-x-auto no-scrollbar -mx-4 px-4' )} > {(extended ? main : main.slice(0, 5)).map((ch) => ( diff --git a/app/(pages)/anime/[slug]/components/cover.tsx b/app/(pages)/anime/[slug]/components/cover.tsx index 3fc78d09..62036c85 100644 --- a/app/(pages)/anime/[slug]/components/cover.tsx +++ b/app/(pages)/anime/[slug]/components/cover.tsx @@ -12,7 +12,7 @@ const Cover = ({ anime }: Props) => { return (
Коментар видалено
diff --git a/components/entry-card/entry-card.tsx b/components/entry-card/entry-card.tsx index 16c2a5a6..db67ab07 100644 --- a/components/entry-card/entry-card.tsx +++ b/components/entry-card/entry-card.tsx @@ -10,6 +10,7 @@ import { import { UrlObject } from 'url'; import MaterialSymbolsImageNotSupportedOutlineRounded from '~icons/material-symbols/image-not-supported-outline-rounded'; +import { ImageProps } from 'next/image'; import Link from 'next/link'; import AnimeTooltip from '@/components/entry-card/components/anime-tooltip'; @@ -43,6 +44,9 @@ export interface Props { slug?: string; content_type?: API.ContentType; withContextMenu?: boolean; + posterProps?: { + priority?: boolean; + }; } const Tooltip = ({ @@ -84,6 +88,7 @@ const Content = memo( slug, content_type, withContextMenu, + posterProps, ...props }: Props, ref: ForwardedRef{current.title_ua}
)} diff --git a/components/navbar/sub-nav.tsx b/components/navbar/sub-nav.tsx index cf34c1b2..71567f5a 100644 --- a/components/navbar/sub-nav.tsx +++ b/components/navbar/sub-nav.tsx @@ -1,34 +1,28 @@ 'use client'; -import { PropsWithChildren } from 'react'; +import { PropsWithChildren, useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; import useIsMobile from '@/services/hooks/useIsMobile'; -interface Props extends PropsWithChildren { - mobileOnly?: boolean; -} +interface Props extends PropsWithChildren {} -const Component = ({ children, mobileOnly }: Props) => { +const Component = ({ children }: Props) => { + const [isMounted, setIsMounted] = useState(false); const isMobile = useIsMobile(); - if (isMobile) { + useEffect(() => { + setIsMounted(true); + }, []); + + if (isMounted && isMobile) { return createPortal( <>{children}>, document.getElementById('subbar-mobile')!, ); } - if (mobileOnly) { - return null; - } - - return createPortal( -