diff --git a/src/config/lexics/indexLexics.tsx b/src/config/lexics/indexLexics.tsx index 0240c147..1aef1460 100644 --- a/src/config/lexics/indexLexics.tsx +++ b/src/config/lexics/indexLexics.tsx @@ -6,7 +6,7 @@ const matchPopupLexics = { go_back_to_match: 13405, match_interviews: 13031, match_playlist_ball_in_play: 2489, - match_playlist_full_game: 13028, + match_playlist_full_match: 13028, match_playlist_goals: 3559, match_playlist_highlights: 13033, match_settings: 13490, diff --git a/src/config/procedures.tsx b/src/config/procedures.tsx index df44e040..f52c6f62 100644 --- a/src/config/procedures.tsx +++ b/src/config/procedures.tsx @@ -22,6 +22,7 @@ export const PROCEDURES = { lst_c_country: 'lst_c_country', ott_match_popup: 'ott_match_popup', ott_match_popup_actions: 'ott_match_popup_actions', + ott_match_popup_player_playlist: 'ott_match_popup_player_playlist', param_lexical: 'param_lexical', save_user_custom_subscription: 'save_user_custom_subscription', save_user_favorite: 'save_user_favorite', diff --git a/src/config/profileTypes.tsx b/src/config/profileTypes.tsx index 1c6c1cd9..629038a3 100644 --- a/src/config/profileTypes.tsx +++ b/src/config/profileTypes.tsx @@ -2,10 +2,12 @@ export enum ProfileTypes { TOURNAMENTS = 1, TEAMS = 2, PLAYERS = 3, + MATCHES = 4, } export const PROFILE_NAMES = { [ProfileTypes.TOURNAMENTS]: 'tournaments', [ProfileTypes.TEAMS]: 'teams', [ProfileTypes.PLAYERS]: 'players', + [ProfileTypes.MATCHES]: 'matches', } as const diff --git a/src/features/MatchPage/MatchProfileCard/index.tsx b/src/features/MatchPage/components/MatchProfileCard/index.tsx similarity index 100% rename from src/features/MatchPage/MatchProfileCard/index.tsx rename to src/features/MatchPage/components/MatchProfileCard/index.tsx diff --git a/src/features/MatchPage/MatchProfileCard/styled.tsx b/src/features/MatchPage/components/MatchProfileCard/styled.tsx similarity index 96% rename from src/features/MatchPage/MatchProfileCard/styled.tsx rename to src/features/MatchPage/components/MatchProfileCard/styled.tsx index eae1dd08..887c21f1 100644 --- a/src/features/MatchPage/MatchProfileCard/styled.tsx +++ b/src/features/MatchPage/components/MatchProfileCard/styled.tsx @@ -10,14 +10,15 @@ export const Wrapper = styled.div` line-height: 24px; color: white; min-height: 28px; - max-width: 85%; + width: 100%; + margin-bottom: 14px; @media ${devices.desktop} { font-size: 22px; } + @media ${devices.laptop} { font-size: 18px; - max-width: 80%; } @media ${devices.tablet} { @@ -25,6 +26,7 @@ export const Wrapper = styled.div` font-size: 16px; padding: 15px 20px 0 20px; flex-wrap: wrap; + margin-bottom: 0; } ` diff --git a/src/features/MatchPage/helpers/buildChapters.tsx b/src/features/MatchPage/helpers/buildChapters.tsx new file mode 100644 index 00000000..091d7b0d --- /dev/null +++ b/src/features/MatchPage/helpers/buildChapters.tsx @@ -0,0 +1,121 @@ +import map from 'lodash/map' +import last from 'lodash/last' +import uniq from 'lodash/uniq' +import filter from 'lodash/filter' +import reduce from 'lodash/reduce' +import concat from 'lodash/concat' +import orderBy from 'lodash/orderBy' +import isEmpty from 'lodash/isEmpty' +import groupBy from 'lodash/groupBy' + +import type { + Videos, + PlaylistData, + Episode, +} from 'requests' + +import type { Chapters, Urls } from 'features/MultiSourcePlayer/types' + +const getUniquePeriods = (videos: Videos) => uniq(map(videos, ({ period }) => period)) + +type Video = { + duration: number, + period: number, + urls: Urls, +} + +const getVideoByPeriod = (videos: Videos, period: number) => { + const videosWithSamePeriod = filter(videos, { period }) + if (isEmpty(videosWithSamePeriod)) return null + + const urls = reduce( + videosWithSamePeriod, + (acc: Urls, video) => ({ + ...acc, + [video.quality]: video.url, + }), + {}, + ) + const [video] = videosWithSamePeriod + return { + duration: video.duration, + period: video.period, + urls, + } +} + +const getVideoByPeriods = (videos: Videos, periods: Array) => ( + reduce( + periods, + (acc: Array