This commit is contained in:
Kakabay 2023-03-23 18:50:25 +05:00
parent 5e45d00d68
commit 267b06418e
3 changed files with 11 additions and 11 deletions

View File

@ -21,7 +21,7 @@ const NewsArticleImg = ({ img, video }: IProps) => {
return ( return (
<div className={'news-article-image'}> <div className={'news-article-image'}>
{video && video.length > 53 ? ( {video && video.length > 53 ? (
<ReactPlayer url={videoParse} controls width="100%" height="100%" /> <ReactPlayer url={videoParse} controls width="100%" height="100%" light={placeholder} />
) : ( ) : (
<LazyLoadImage <LazyLoadImage
src={img} src={img}

View File

@ -1,16 +1,16 @@
// Modules // Modules
import { Swiper, SwiperSlide, useSwiper } from "swiper/react"; import { Swiper, SwiperSlide, useSwiper } from 'swiper/react';
import { Navigation, Pagination, Autoplay } from "swiper"; import { Navigation, Pagination, Autoplay } from 'swiper';
import { v4 as uuidv4 } from "uuid"; import { v4 as uuidv4 } from 'uuid';
// Components // Components
import NewsArticleImg from "./NewsArticleImg"; import NewsArticleImg from './NewsArticleImg';
import { IPostData } from "../../types/store.types"; import { IPostData } from '../../types/store.types';
interface IProps { interface IProps {
images: IPostData["data"]["data"]["featured_images"]; images: IPostData['data']['data']['featured_images'];
video: IPostData["data"]["data"]["video"]; video: IPostData['data']['data']['video'];
} }
const NewsArticleSlider = ({ images, video }: IProps) => { const NewsArticleSlider = ({ images, video }: IProps) => {
@ -27,10 +27,9 @@ const NewsArticleSlider = ({ images, video }: IProps) => {
}} }}
modules={[Navigation, Pagination, Autoplay]} modules={[Navigation, Pagination, Autoplay]}
pagination={{ pagination={{
type: "bullets", type: 'bullets',
clickable: true, clickable: true,
}} }}>
>
{images.map((img) => ( {images.map((img) => (
<SwiperSlide key={uuidv4()}> <SwiperSlide key={uuidv4()}>
<NewsArticleImg img={img.path} video={video} /> <NewsArticleImg img={img.path} video={video} />

View File

@ -37,6 +37,7 @@ export interface IPostsData {
title: string; title: string;
slug: string; slug: string;
awtor: string; awtor: string;
placeholder: string;
views: number; views: number;
excerpt: string; excerpt: string;
published_at: string; published_at: string;