From bcf44ee7ea14670e346c90934475003d1b014f39 Mon Sep 17 00:00:00 2001 From: VividTruthKeeper Date: Mon, 13 Mar 2023 16:45:01 +0500 Subject: [PATCH] excerpt -> title --- src/components/videos/Videos.tsx | 50 +++++++++++++++++----------- src/components/videos/VideosItem.tsx | 18 ++++++---- src/types/videos.types.ts | 2 +- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/src/components/videos/Videos.tsx b/src/components/videos/Videos.tsx index cd8a3e2..d7904e3 100644 --- a/src/components/videos/Videos.tsx +++ b/src/components/videos/Videos.tsx @@ -1,27 +1,29 @@ // Modules -import { useEffect, useState } from 'react'; -import { v4 as uuiv4 } from 'uuid'; -import { useSelector, useDispatch } from 'react-redux'; +import { useEffect, useState } from "react"; +import { v4 as uuiv4 } from "uuid"; +import { useSelector, useDispatch } from "react-redux"; // Components -import SectionTitle from '../global/SectionTitle'; -import VideosItem from './VideosItem'; +import SectionTitle from "../global/SectionTitle"; +import VideosItem from "./VideosItem"; // Types -import { RootState } from '../../types/store.types'; +import { RootState } from "../../types/store.types"; // Api -import { Api } from '../../api/Api'; -import { url } from '../../url'; -import { videoParams } from '../../api/params'; +import { Api } from "../../api/Api"; +import { url } from "../../url"; +import { videoParams } from "../../api/params"; // Actions -import { setVideo } from '../../actions/setData'; -import Loader from '../global/Loader'; +import { setVideo } from "../../actions/setData"; +import Loader from "../global/Loader"; const Videos = () => { - const data = useSelector((state) => state.video.data); - const api = new Api(url + '/pagination/posts', videoParams); + const data = useSelector( + (state) => state.video.data + ); + const api = new Api(url + "/pagination/posts", videoParams); const language = api.language; const dispatch = useDispatch(); const [lastLanguage, setLastLanguage] = useState(language); @@ -37,11 +39,21 @@ const Videos = () => {
@@ -52,14 +64,14 @@ const Videos = () => { return ( ); } diff --git a/src/components/videos/VideosItem.tsx b/src/components/videos/VideosItem.tsx index db57308..65f40e6 100644 --- a/src/components/videos/VideosItem.tsx +++ b/src/components/videos/VideosItem.tsx @@ -1,20 +1,26 @@ // Modules -import ReactPlayer from 'react-player'; -import { LazyLoadComponent } from 'react-lazy-load-image-component'; +import ReactPlayer from "react-player"; +import { LazyLoadComponent } from "react-lazy-load-image-component"; // Types -import { videosDataType } from '../../types/videos.types'; +import { videosDataType } from "../../types/videos.types"; -const VideosItem = ({ url, placeholder, date, excerpt }: videosDataType) => { +const VideosItem = ({ url, placeholder, date, title }: videosDataType) => { return (
- +
{date} -

{excerpt}

+

{title}

diff --git a/src/types/videos.types.ts b/src/types/videos.types.ts index 106e81f..03555ce 100644 --- a/src/types/videos.types.ts +++ b/src/types/videos.types.ts @@ -2,5 +2,5 @@ export interface videosDataType { url: string; placeholder: string; date: string; - excerpt: string; + title: string; }