|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
import { useEffect, useRef } from 'react' |
|
|
|
|
import isEmpty from 'lodash/isEmpty' |
|
|
|
|
|
|
|
|
|
import { StreamPlayer } from 'features/StreamPlayer' |
|
|
|
|
@ -6,12 +7,17 @@ import { ProfileHeader } from 'features/ProfileHeader' |
|
|
|
|
import { MainWrapper } from 'features/MainWrapper' |
|
|
|
|
import { UserFavorites } from 'features/UserFavorites' |
|
|
|
|
import { MediaQuery } from 'features/MediaQuery' |
|
|
|
|
|
|
|
|
|
import { useFullscreen } from 'features/StreamPlayer/hooks/useFullscreen' |
|
|
|
|
import { MatchProfileCard } from './MatchProfileCard' |
|
|
|
|
import { usePlayerProgressReporter } from './hooks/usePlayerProgressReporter' |
|
|
|
|
import { useMatchProfile } from './hooks/useMatchProfile' |
|
|
|
|
import { useVideoData } from './hooks/useVideoData' |
|
|
|
|
import { MainWrapper as Wrapper, Container } from './styled' |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
MainWrapper as Wrapper, |
|
|
|
|
Container, |
|
|
|
|
EmptyScrollTarget, |
|
|
|
|
} from './styled' |
|
|
|
|
|
|
|
|
|
export const MatchPage = () => { |
|
|
|
|
const profile = useMatchProfile() |
|
|
|
|
@ -26,6 +32,14 @@ export const MatchPage = () => { |
|
|
|
|
const isLiveMatch = Boolean(url) && !isLastPlayPositionFetching |
|
|
|
|
const isFinishedMatch = !isEmpty(videos) && !isLastPlayPositionFetching |
|
|
|
|
|
|
|
|
|
const { onFullscreenClick } = useFullscreen() |
|
|
|
|
|
|
|
|
|
const playerEndRef = useRef<HTMLDivElement>(null) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
playerEndRef.current?.scrollIntoView({ behavior: 'smooth' }) |
|
|
|
|
}, [onFullscreenClick]) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<MainWrapper> |
|
|
|
|
<MediaQuery minDevice='laptop'> |
|
|
|
|
@ -57,6 +71,7 @@ export const MatchPage = () => { |
|
|
|
|
} |
|
|
|
|
</Container> |
|
|
|
|
</Wrapper> |
|
|
|
|
<EmptyScrollTarget ref={playerEndRef} /> |
|
|
|
|
</MainWrapper> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|