videos
This commit is contained in:
parent
4ba4490a97
commit
623e85dc1e
|
|
@ -1,29 +1,29 @@
|
||||||
// Modules
|
// Modules
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from 'react';
|
||||||
import { LazyLoadComponent } from "react-lazy-load-image-component";
|
import { LazyLoadComponent } from 'react-lazy-load-image-component';
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from 'react-redux';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import ContentItem from "./ContentItem";
|
import ContentItem from './ContentItem';
|
||||||
import SectionTitle from "../global/SectionTitle";
|
import SectionTitle from '../global/SectionTitle';
|
||||||
import ContentSlider from "./ContentSlider";
|
import ContentSlider from './ContentSlider';
|
||||||
import Loader from "../global/Loader";
|
import Loader from '../global/Loader';
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { RootState } from "../../types/store.types";
|
import { RootState } from '../../types/store.types';
|
||||||
|
|
||||||
// Api
|
// Api
|
||||||
import { url } from "../../url";
|
import { url } from '../../url';
|
||||||
import { Api } from "../../api/Api";
|
import { Api } from '../../api/Api';
|
||||||
import { featuredParams } from "../../api/params";
|
import { featuredParams } from '../../api/params';
|
||||||
import { setFeatured } from "../../actions/setData";
|
import { setFeatured } from '../../actions/setData';
|
||||||
|
|
||||||
const MainContent = () => {
|
const MainContent = () => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const data = useSelector<RootState, RootState["featured"]["data"]>(
|
const data = useSelector<RootState, RootState['featured']['data']>(
|
||||||
(state) => state.featured.data
|
(state) => state.featured.data,
|
||||||
);
|
);
|
||||||
const api = new Api(url + "/posts", featuredParams);
|
const api = new Api(url + '/posts', featuredParams);
|
||||||
const language = api.language;
|
const language = api.language;
|
||||||
const [lastLanguage, setLastLanguage] = useState<typeof language>(language);
|
const [lastLanguage, setLastLanguage] = useState<typeof language>(language);
|
||||||
|
|
||||||
|
|
@ -52,49 +52,29 @@ const MainContent = () => {
|
||||||
<ContentItem
|
<ContentItem
|
||||||
id={data[0].id}
|
id={data[0].id}
|
||||||
type="big"
|
type="big"
|
||||||
img={
|
img={data[0].featured_images[0] ? data[0].featured_images[0].path : ''}
|
||||||
data[0].featured_images
|
|
||||||
? data[0].featured_images[0].path
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
title={data[0].title}
|
title={data[0].title}
|
||||||
/>
|
/>
|
||||||
<ContentItem
|
<ContentItem
|
||||||
id={data[1].id}
|
id={data[1].id}
|
||||||
img={
|
img={data[1].featured_images[0] ? data[1].featured_images[0].path : ''}
|
||||||
data[1].featured_images
|
|
||||||
? data[1].featured_images[0].path
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
title={data[1].title}
|
title={data[1].title}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="main-content-bottom">
|
<div className="main-content-bottom">
|
||||||
<ContentItem
|
<ContentItem
|
||||||
id={data[2].id}
|
id={data[2].id}
|
||||||
img={
|
img={data[2].featured_images[0] ? data[2].featured_images[0].path : ''}
|
||||||
data[2].featured_images
|
|
||||||
? data[2].featured_images[0].path
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
title={data[2].title}
|
title={data[2].title}
|
||||||
/>
|
/>
|
||||||
<ContentItem
|
<ContentItem
|
||||||
id={data[3].id}
|
id={data[3].id}
|
||||||
img={
|
img={data[3].featured_images[0] ? data[3].featured_images[0].path : ''}
|
||||||
data[3].featured_images
|
|
||||||
? data[3].featured_images[0].path
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
title={data[3].title}
|
title={data[3].title}
|
||||||
/>
|
/>
|
||||||
<ContentItem
|
<ContentItem
|
||||||
id={data[4].id}
|
id={data[4].id}
|
||||||
img={
|
img={data[4].featured_images[0] ? data[4].featured_images[0].path : ''}
|
||||||
data[4].featured_images
|
|
||||||
? data[4].featured_images[0].path
|
|
||||||
: ""
|
|
||||||
}
|
|
||||||
title={data[4].title}
|
title={data[4].title}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ const Videos = () => {
|
||||||
setLastLanguage(language);
|
setLastLanguage(language);
|
||||||
}
|
}
|
||||||
}, [lastLanguage, language]);
|
}, [lastLanguage, language]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="videos">
|
<section className="videos">
|
||||||
<div className="videos-inner">
|
<div className="videos-inner">
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,8 @@
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 50%;
|
left: 0%;
|
||||||
height: 100%;
|
@include wh100;
|
||||||
width: 98%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue