|
|
@ -40,7 +40,7 @@ function usePagination() {
|
|
|
|
onChange: onPageChange
|
|
|
|
onChange: onPageChange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const PAGE_SIZE = 16
|
|
|
|
const PAGE_SIZE = 3
|
|
|
|
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
|
|
|
|
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
|
|
|
|
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
|
|
|
|
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
|
|
|
|
let videoId = {};
|
|
|
|
let videoId = {};
|
|
|
@ -101,10 +101,14 @@ function InfoVideo (props) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function fetchReviewvideos() {
|
|
|
|
function fetchReviewvideos() {
|
|
|
|
const fetchUrl = `/users/${username}/videos/review.json`
|
|
|
|
const fetchUrl = `/users/${username}/videos/review.json`
|
|
|
|
|
|
|
|
const sorts = sortKey.split('-')
|
|
|
|
setLoading(true)
|
|
|
|
setLoading(true)
|
|
|
|
axios.get(fetchUrl, {
|
|
|
|
axios.get(fetchUrl, {
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
per_page: 100
|
|
|
|
page: pageObj.current,
|
|
|
|
|
|
|
|
per_page: PAGE_SIZE,
|
|
|
|
|
|
|
|
sort_by: sorts[0],
|
|
|
|
|
|
|
|
sort_direction: sorts[1],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
@ -119,8 +123,16 @@ function InfoVideo (props) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
fetchvideos()
|
|
|
|
if (pageObj.current == 1) {
|
|
|
|
}, [pageObj.current, sortKey])
|
|
|
|
if (categoryObj.category == 'all') {
|
|
|
|
|
|
|
|
fetchvideos()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
fetchReviewvideos()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
pageObj.onChange(1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, [categoryObj.category])
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (categoryObj.category == 'all') {
|
|
|
|
if (categoryObj.category == 'all') {
|
|
|
@ -128,7 +140,7 @@ function InfoVideo (props) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
fetchReviewvideos()
|
|
|
|
fetchReviewvideos()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, [categoryObj.category])
|
|
|
|
}, [ pageObj.current, sortKey ])
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (videoModalObj.visible == false) {
|
|
|
|
if (videoModalObj.visible == false) {
|
|
|
@ -327,9 +339,9 @@ function InfoVideo (props) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* categoryObj.category == 'all' && */}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
categoryObj.category == 'all' && count > PAGE_SIZE &&
|
|
|
|
count > PAGE_SIZE &&
|
|
|
|
<div className="mt30 mb50 edu-txt-center">
|
|
|
|
<div className="mt30 mb50 edu-txt-center">
|
|
|
|
<Pagination showQuickJumper total={count} pageSize={PAGE_SIZE}
|
|
|
|
<Pagination showQuickJumper total={count} pageSize={PAGE_SIZE}
|
|
|
|
{...pageObj}
|
|
|
|
{...pageObj}
|
|
|
|