mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-18 17:34:09 +02:00
[enhancement]: add codec column for tracks
This commit is contained in:
@@ -115,6 +115,7 @@ export const SwiperGridCarousel = ({
|
|||||||
isLoading,
|
isLoading,
|
||||||
uniqueId,
|
uniqueId,
|
||||||
}: SwiperGridCarouselProps) => {
|
}: SwiperGridCarouselProps) => {
|
||||||
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const swiperRef = useRef<SwiperCore | any>(null);
|
const swiperRef = useRef<SwiperCore | any>(null);
|
||||||
const playButtonBehavior = usePlayButtonBehavior();
|
const playButtonBehavior = usePlayButtonBehavior();
|
||||||
const handlePlayQueueAdd = usePlayQueueAdd();
|
const handlePlayQueueAdd = usePlayQueueAdd();
|
||||||
@@ -247,7 +248,9 @@ export const SwiperGridCarousel = ({
|
|||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const handleResize = () => {
|
const handleResize = () => {
|
||||||
const { activeIndex, params, slides, width } =
|
// Use the container div ref and not swiper width, as this value is more accurate
|
||||||
|
const width = containerRef.current?.clientWidth;
|
||||||
|
const { activeIndex, params, slides } =
|
||||||
(swiperRef.current as SwiperCore | undefined) ?? {};
|
(swiperRef.current as SwiperCore | undefined) ?? {};
|
||||||
|
|
||||||
if (width) {
|
if (width) {
|
||||||
@@ -279,6 +282,7 @@ export const SwiperGridCarousel = ({
|
|||||||
className="grid-carousel"
|
className="grid-carousel"
|
||||||
spacing="md"
|
spacing="md"
|
||||||
>
|
>
|
||||||
|
<div ref={containerRef}>
|
||||||
{title ? (
|
{title ? (
|
||||||
<Title
|
<Title
|
||||||
{...title}
|
{...title}
|
||||||
@@ -314,6 +318,7 @@ export const SwiperGridCarousel = ({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
|
</div>
|
||||||
</CarouselContainer>
|
</CarouselContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user