fix(#ott2590): added match description panel autoscroll after playerloaded fixed video tab scroll

keep-around/613c224ecaa7e53247eddeed555f1bf5ae7a3e05
Farber Denis 3 years ago
parent a98d73e67a
commit fc47a9955f
  1. 2
      src/features/GlobalStyles/index.tsx
  2. 12
      src/features/MatchPage/components/FinishedMatch/index.tsx
  3. 2
      src/features/MatchSidePlaylists/components/TabVideo/components/VideoDate/styled.tsx
  4. 8
      src/features/MatchSidePlaylists/components/TabVideo/styled.tsx
  5. 2
      src/features/MatchSidePlaylists/index.tsx
  6. 8
      src/features/MatchSidePlaylists/styled.tsx
  7. 9
      src/features/MultiSourcePlayer/hooks/index.tsx
  8. 6
      src/features/StreamPlayer/styled.tsx

@ -9,7 +9,7 @@ export const GlobalStyles = createGlobalStyle`
font-size: calc(2px + 1vw); font-size: calc(2px + 1vw);
overflow-y: hidden; overflow-y: hidden;
} }
body { body {
min-height: 100vh; min-height: 100vh;
margin: 0; margin: 0;

@ -14,6 +14,7 @@ import { useFinishedMatch } from './hooks'
import { Container } from '../../styled' import { Container } from '../../styled'
import { Modal } from './styled' import { Modal } from './styled'
import { TournamentData } from '../../types' import { TournamentData } from '../../types'
import { MatchDescription } from '../MatchDescription'
type Props = { type Props = {
events: Events, events: Events,
@ -54,10 +55,13 @@ export const FinishedMatch = ({
<Container> <Container>
{!isEmpty(chapters) && ( {!isEmpty(chapters) && (
<MultiSourcePlayer <Fragment>
chapters={chapters} <MultiSourcePlayer
onPlayingChange={onPlayingChange} chapters={chapters}
/> onPlayingChange={onPlayingChange}
/>
<MatchDescription profile={profile} />
</Fragment>
)} )}
</Container> </Container>

@ -1,4 +1,4 @@
import styled, { css } from 'styled-components' import styled, { css } from 'styled-components/macro'
export const Wrapper = styled.div` export const Wrapper = styled.div`
color: #FFFFFF; color: #FFFFFF;

@ -1,7 +1,13 @@
import styled from 'styled-components' import styled from 'styled-components/macro'
import { customScrollbar } from 'features/Common'
export const MatchesWrapper = styled.div` export const MatchesWrapper = styled.div`
overflow-y: scroll;
max-height: calc(100vh - 170px);
> :not(:last-child) { > :not(:last-child) {
margin-bottom: 15px; margin-bottom: 15px;
} }
${customScrollbar}
` `

@ -86,7 +86,7 @@ export const MatchSidePlaylists = ({
) : null} ) : null}
</TabsGroup> </TabsGroup>
</TabsWrapper> </TabsWrapper>
<Container> <Container forVideoTab={selectedTab === Tabs.VIDEO}>
<TabPane <TabPane
tournamentData={tournamentData} tournamentData={tournamentData}
events={events} events={events}

@ -23,12 +23,16 @@ export const TabsWrapper = styled.div`
padding-right: 18px; padding-right: 18px;
` `
export const Container = styled.div` type TContainer = {
forVideoTab?: boolean,
}
export const Container = styled.div<TContainer>`
width: 320px; width: 320px;
margin-top: 14px; margin-top: 14px;
padding: 0 10px 0 14px; padding: 0 10px 0 14px;
max-height: calc(100vh - 170px); max-height: calc(100vh - 170px);
overflow-y: scroll; overflow-y: ${({ forVideoTab }) => (forVideoTab ? 'none' : 'scroll')};
${customScrollbar} ${customScrollbar}

@ -225,6 +225,15 @@ export const useMultiSourcePlayer = ({
stopPlaying, stopPlaying,
]) ])
useEffect(() => {
if (ready && videoRef) {
videoRef.current?.scrollIntoView({
behavior: 'smooth',
block: 'end',
})
}
}, [ready, videoRef])
return { return {
activeChapterIndex, activeChapterIndex,
activePlayer, activePlayer,

@ -1,6 +1,7 @@
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { devices } from 'config'
export const ControlsGradient = styled.div` export const ControlsGradient = styled.div`
background-image: url(/images/player-controls-gradient.png); background-image: url(/images/player-controls-gradient.png);
@ -100,6 +101,7 @@ export const PlayerWrapper = styled.div<PlayStopProps>`
position: relative; position: relative;
background-color: #000; background-color: #000;
margin-bottom: 5px; margin-bottom: 5px;
min-height: 100%;
:fullscreen { :fullscreen {
padding-top: 0; padding-top: 0;
@ -111,6 +113,10 @@ export const PlayerWrapper = styled.div<PlayStopProps>`
height: 0px; height: 0px;
padding-top: 56.25%; padding-top: 56.25%;
`} `}
${devices.laptop} {
min-height: auto;
}
` `
export const LoaderWrapper = styled.div` export const LoaderWrapper = styled.div`

Loading…
Cancel
Save