You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.7 KiB
55 lines
1.7 KiB
import React, { useState, useEffect } from "react"; |
|
import { connect } from "react-redux"; |
|
import { publicApi, book } from "../../redux/actions"; |
|
import Search from "../../components/Search"; |
|
import VerticalGradeFilter from "./components/VerticalGradeFilter"; |
|
import Divider from "../../components/Divider"; |
|
import MostViewedVideo from "./components/MostViewedVideo"; |
|
import NewestVideo from "./components/NewestVideo"; |
|
//assets |
|
import searchLight from "../../assets/icons/search-light.svg"; |
|
|
|
function Videos({ headerOptions, setHeaderOptions, getList, videos, grades }) { |
|
const [search, setSearch] = useState(""); |
|
useEffect(() => { |
|
setHeaderOptions(headerOptions); |
|
getList({ vod: true }); |
|
}, []); |
|
return ( |
|
<div className="flex flex-col pb-24"> |
|
{/* <div className="px-4"> |
|
<Search |
|
backgroundColor="bg-grayF9 dark:bg-gray2077" |
|
borderColor="border-grayDB dark:border-gray45" |
|
textColor="text-blueC0 dark:text-white" |
|
icon={searchLight} |
|
/> |
|
</div> |
|
<div className="pr-4"> |
|
<VerticalGradeFilter /> |
|
</div> |
|
<div className="px-4 flex flex-col"> |
|
<Divider type={"vertical"} /> |
|
</div> */} |
|
<div className="pr-4"> |
|
<MostViewedVideo videos={videos} grades={grades} /> |
|
</div> |
|
<div className="px-4 flex flex-col"> |
|
<Divider type={"vertical"} /> |
|
<NewestVideo videos={videos} grades={grades} /> |
|
</div> |
|
</div> |
|
); |
|
} |
|
|
|
const mapStateToProps = (state) => ({ |
|
videos: state.book.list, |
|
grades: state.publicApi.grades, |
|
}); |
|
|
|
const mapDispatchToProps = { |
|
setHeaderOptions: publicApi.setHeaderOptions, |
|
getList: book.list, |
|
}; |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Videos);
|
|
|