From 9bf368080cad6291bd0b4ac1a35141a2305cd51c Mon Sep 17 00:00:00 2001 From: Mirlan Date: Wed, 24 Feb 2021 14:21:50 +0600 Subject: [PATCH] Ott 717 match popup changes (#310) * fix(717): popup player settings (#308) * Ott 717 part 2 (#309) * fix(717): component changes * fix(717): empty episodes * fix(717): style fix * refactor(717): renamed playlistData to episodes --- src/config/lexics/indexLexics.tsx | 1 + src/features/Common/Button/styled.tsx | 5 +- .../MatchPage/helpers/buildChapters.tsx | 25 ++++++--- .../MatchPage/helpers/buildPlaylists.tsx | 6 ++- src/features/MatchPage/hooks/useChapters.tsx | 27 ++++++++-- .../{usePlaylistData.tsx => useEpisodes.tsx} | 20 +++---- src/features/MatchPage/hooks/useMatchPage.tsx | 12 +++-- src/features/MatchPage/hooks/usePlaylists.tsx | 20 +++---- .../MatchPage/hooks/useRouteState.tsx | 6 +-- src/features/MatchPage/types.tsx | 4 +- .../components/FinishedMatchPopup/index.tsx | 24 +++++---- .../components/FinishedMatchPopup/styled.tsx | 1 - .../components/FinishedPlaylistPage/index.tsx | 2 +- .../components/MatchSettingsPage/index.tsx | 38 +++++++++++++ .../components/PlayerActions/styled.tsx | 2 +- .../index.tsx | 39 +++++++------- .../components/PlayerSettingsPage/styled.tsx | 13 +++++ .../components/PlayersList/index.tsx | 2 +- .../components/SettingsButton/index.tsx | 6 +-- .../components/SettingsDesktop/index.tsx | 22 ++++++++ src/features/MatchPopup/index.tsx | 1 + src/features/MatchPopup/store/hooks/index.tsx | 36 ++++++------- .../store/hooks/usePlayerClickHandler.tsx | 42 +++++++++++---- .../store/hooks/usePopupNavigation.tsx | 54 ++++++++++--------- src/features/MatchPopup/types.tsx | 5 +- .../components/PlayersPlaylists/index.tsx | 2 +- src/features/PopupComponents/Header/index.tsx | 4 +- src/requests/getMatchPlaylists.tsx | 4 +- src/requests/getPlayerPlaylists.tsx | 4 +- 29 files changed, 283 insertions(+), 144 deletions(-) rename src/features/MatchPage/hooks/{usePlaylistData.tsx => useEpisodes.tsx} (56%) create mode 100644 src/features/MatchPopup/components/MatchSettingsPage/index.tsx rename src/features/MatchPopup/components/{SettingsPage => PlayerSettingsPage}/index.tsx (63%) create mode 100644 src/features/MatchPopup/components/PlayerSettingsPage/styled.tsx diff --git a/src/config/lexics/indexLexics.tsx b/src/config/lexics/indexLexics.tsx index e6f62c6a..059418c6 100644 --- a/src/config/lexics/indexLexics.tsx +++ b/src/config/lexics/indexLexics.tsx @@ -17,6 +17,7 @@ const matchPopupLexics = { team_players: 13398, watch_from: 13022, watch_live_stream: 13020, + watch_players_episodes: 14052, } const buyMatchPopupLexics = { diff --git a/src/features/Common/Button/styled.tsx b/src/features/Common/Button/styled.tsx index fd00b4d6..a676317f 100644 --- a/src/features/Common/Button/styled.tsx +++ b/src/features/Common/Button/styled.tsx @@ -4,7 +4,7 @@ import { devices } from 'config/devices' const baseButtonStyles = css` width: 272px; - height: 48px; + height: 50px; border-width: 0.7px; border-style: solid; border-radius: 2px; @@ -37,7 +37,8 @@ export const solidButtonStyles = css` color: #fff; font-weight: bold; border-color: transparent; - background: ${({ theme: { colors } }) => colors.primary}; + background-color: #294FC4; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); /* TODO: удалить медиа запросы из стайледа, добавить специфичные юз кейсу правила diff --git a/src/features/MatchPage/helpers/buildChapters.tsx b/src/features/MatchPage/helpers/buildChapters.tsx index 5c71354f..c74bcfac 100644 --- a/src/features/MatchPage/helpers/buildChapters.tsx +++ b/src/features/MatchPage/helpers/buildChapters.tsx @@ -10,12 +10,15 @@ import groupBy from 'lodash/groupBy' import type { Videos, - PlaylistData, + Episodes, Episode, } from 'requests' import type { Chapters, Urls } from 'features/MultiSourcePlayer/types' +import type { PlaylistOption } from '../types' +import { FULL_GAME_KEY } from './buildPlaylists' + const getUniquePeriods = (videos: Videos) => uniq(map(videos, ({ period }) => period)) type Video = { @@ -88,10 +91,10 @@ const getEpisodeUrls = (urls: Urls, episode: Episode) => reduce( {}, ) -const getPlaylistChapters = (videos: Array