From 82e71d880ae0dd2ad4cd239c04f095a8d4ab5388 Mon Sep 17 00:00:00 2001 From: Mirlan Date: Fri, 28 Aug 2020 14:51:16 +0600 Subject: [PATCH] Ott 336 hide not used player controls (#109) --- src/features/Matches/hooks.tsx | 10 +++++----- src/features/VideoPlayer/index.tsx | 6 ------ src/features/VideoPlayer/styled.tsx | 1 - src/requests/getMatches.tsx | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/features/Matches/hooks.tsx b/src/features/Matches/hooks.tsx index fb6c569d..f391caae 100644 --- a/src/features/Matches/hooks.tsx +++ b/src/features/Matches/hooks.tsx @@ -7,8 +7,8 @@ import fpMap from 'lodash/fp/map' import fpOrderBy from 'lodash/fp/orderBy' import type { Matches, Content } from 'requests' -import { SPORT_NAMES } from 'config' -import { getProfileLogo } from 'helpers' +import { ProfileTypes } from 'config' +import { getProfileLogo, getSportLexic } from 'helpers' import { useLexicsStore } from 'features/LexicsStore' export type Props = { @@ -48,19 +48,19 @@ const prepareMatches = (content: Array, suffix: string) => pipe( date, id, preview: '/images/preview.png', - sportName: SPORT_NAMES[sport], + sportName: getSportLexic(sport), sportType: sport, streamStatus: stream_status, team1Logo: getProfileLogo({ id: team1.id, - profileType: 2, + profileType: ProfileTypes.TEAMS, sportType: sport, }), team1Name: team1[`name_${suffix}` as Name], team1Score: team1.score, team2Logo: getProfileLogo({ id: team2.id, - profileType: 2, + profileType: ProfileTypes.TEAMS, sportType: sport, }), team2Name: team2[`name_${suffix}` as Name], diff --git a/src/features/VideoPlayer/index.tsx b/src/features/VideoPlayer/index.tsx index 7d2cd07a..d35f8636 100644 --- a/src/features/VideoPlayer/index.tsx +++ b/src/features/VideoPlayer/index.tsx @@ -8,11 +8,8 @@ import { PlayerWrapper, ReactPlayer, Controls, - Prev, - Next, PlayStop, Fullscreen, - Settings, } from './styled' type Props = { @@ -64,9 +61,7 @@ export const VideoPlayer = ({ url }: Props) => { onReady={startPlaying} /> - - { loadedProgress={loadedProgress} /> - ) diff --git a/src/features/VideoPlayer/styled.tsx b/src/features/VideoPlayer/styled.tsx index 6d5490e4..6dfaf3b3 100644 --- a/src/features/VideoPlayer/styled.tsx +++ b/src/features/VideoPlayer/styled.tsx @@ -91,7 +91,6 @@ export const Fullscreen = styled(ButtonBase)` width: 22px; height: 20px; margin-left: 31px; - margin-right: 23px; background-image: ${({ isFullscreen }) => ( isFullscreen ? 'url(/images/player-fullscreen-off.svg)' diff --git a/src/requests/getMatches.tsx b/src/requests/getMatches.tsx index 5b6644d4..cf8c76f4 100644 --- a/src/requests/getMatches.tsx +++ b/src/requests/getMatches.tsx @@ -30,7 +30,7 @@ export type Content = { matches: Array, name_eng: string, name_rus: string, - sport: 1 | 2 | 3, + sport: SportTypes, } export type Match = {