Ott 336 hide not used player controls (#109)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 5 years ago committed by GitHub
parent 2f5365dceb
commit 82e71d880a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/features/Matches/hooks.tsx
  2. 6
      src/features/VideoPlayer/index.tsx
  3. 1
      src/features/VideoPlayer/styled.tsx
  4. 2
      src/requests/getMatches.tsx

@ -7,8 +7,8 @@ import fpMap from 'lodash/fp/map'
import fpOrderBy from 'lodash/fp/orderBy' import fpOrderBy from 'lodash/fp/orderBy'
import type { Matches, Content } from 'requests' import type { Matches, Content } from 'requests'
import { SPORT_NAMES } from 'config' import { ProfileTypes } from 'config'
import { getProfileLogo } from 'helpers' import { getProfileLogo, getSportLexic } from 'helpers'
import { useLexicsStore } from 'features/LexicsStore' import { useLexicsStore } from 'features/LexicsStore'
export type Props = { export type Props = {
@ -48,19 +48,19 @@ const prepareMatches = (content: Array<Content>, suffix: string) => pipe(
date, date,
id, id,
preview: '/images/preview.png', preview: '/images/preview.png',
sportName: SPORT_NAMES[sport], sportName: getSportLexic(sport),
sportType: sport, sportType: sport,
streamStatus: stream_status, streamStatus: stream_status,
team1Logo: getProfileLogo({ team1Logo: getProfileLogo({
id: team1.id, id: team1.id,
profileType: 2, profileType: ProfileTypes.TEAMS,
sportType: sport, sportType: sport,
}), }),
team1Name: team1[`name_${suffix}` as Name], team1Name: team1[`name_${suffix}` as Name],
team1Score: team1.score, team1Score: team1.score,
team2Logo: getProfileLogo({ team2Logo: getProfileLogo({
id: team2.id, id: team2.id,
profileType: 2, profileType: ProfileTypes.TEAMS,
sportType: sport, sportType: sport,
}), }),
team2Name: team2[`name_${suffix}` as Name], team2Name: team2[`name_${suffix}` as Name],

@ -8,11 +8,8 @@ import {
PlayerWrapper, PlayerWrapper,
ReactPlayer, ReactPlayer,
Controls, Controls,
Prev,
Next,
PlayStop, PlayStop,
Fullscreen, Fullscreen,
Settings,
} from './styled' } from './styled'
type Props = { type Props = {
@ -64,9 +61,7 @@ export const VideoPlayer = ({ url }: Props) => {
onReady={startPlaying} onReady={startPlaying}
/> />
<Controls> <Controls>
<Prev />
<PlayStop onClick={togglePlaying} playing={playing} /> <PlayStop onClick={togglePlaying} playing={playing} />
<Next />
<VolumeBar <VolumeBar
value={volumeInPercent} value={volumeInPercent}
muted={muted} muted={muted}
@ -80,7 +75,6 @@ export const VideoPlayer = ({ url }: Props) => {
loadedProgress={loadedProgress} loadedProgress={loadedProgress}
/> />
<Fullscreen onClick={onFullscreenClick} isFullscreen={isFullscreen} /> <Fullscreen onClick={onFullscreenClick} isFullscreen={isFullscreen} />
<Settings />
</Controls> </Controls>
</PlayerWrapper> </PlayerWrapper>
) )

@ -91,7 +91,6 @@ export const Fullscreen = styled(ButtonBase)<FullscreenProps>`
width: 22px; width: 22px;
height: 20px; height: 20px;
margin-left: 31px; margin-left: 31px;
margin-right: 23px;
background-image: ${({ isFullscreen }) => ( background-image: ${({ isFullscreen }) => (
isFullscreen isFullscreen
? 'url(/images/player-fullscreen-off.svg)' ? 'url(/images/player-fullscreen-off.svg)'

@ -30,7 +30,7 @@ export type Content = {
matches: Array<Match>, matches: Array<Match>,
name_eng: string, name_eng: string,
name_rus: string, name_rus: string,
sport: 1 | 2 | 3, sport: SportTypes,
} }
export type Match = { export type Match = {

Loading…
Cancel
Save