From 07ba41b10005b36be47b750720ca50571cb2cb16 Mon Sep 17 00:00:00 2001 From: Zoia <43918051+zizi62@users.noreply.github.com> Date: Wed, 10 Mar 2021 09:13:24 -0500 Subject: [PATCH] feat(ott-894): add live (#321) --- src/features/MatchCard/hooks.tsx | 2 +- src/features/Matches/helpers/prepareMatches.tsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/features/MatchCard/hooks.tsx b/src/features/MatchCard/hooks.tsx index c8ccfd2c..c7bd4ecf 100644 --- a/src/features/MatchCard/hooks.tsx +++ b/src/features/MatchCard/hooks.tsx @@ -30,7 +30,7 @@ export const useCard = (match: Match) => { match.sportType, ]) const openMatchPopup = useCallback(() => { - if (match.isClickable && match.calc && match.hasVideo) { + if (match.isClickable) { setMatch(match) openPopup() fetchMatchPlaylists(match) diff --git a/src/features/Matches/helpers/prepareMatches.tsx b/src/features/Matches/helpers/prepareMatches.tsx index 5af25217..338d4b9d 100644 --- a/src/features/Matches/helpers/prepareMatches.tsx +++ b/src/features/Matches/helpers/prepareMatches.tsx @@ -21,6 +21,7 @@ const prepareMatch = ({ tournament, }: Match) => { const date = new Date(matchDate) + const accessable = sub && access return { accessibleBySubscription: sub, accessibleInUsersCountry: access, @@ -29,10 +30,12 @@ const prepareMatch = ({ formattedDate: format(date, 'dd.MM.yy'), hasVideo: has_video, id, - isClickable: (sub && access && ( - has_video + isClickable: live + ? accessable + : (accessable && calc && ( + has_video || storage - )), + )), live, preview, sportName: getSportLexic(sport),