feat(ott-894): add live (#321)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Zoia 5 years ago committed by GitHub
parent 3b10015c9a
commit 07ba41b100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/features/MatchCard/hooks.tsx
  2. 9
      src/features/Matches/helpers/prepareMatches.tsx

@ -30,7 +30,7 @@ export const useCard = (match: Match) => {
match.sportType, match.sportType,
]) ])
const openMatchPopup = useCallback(() => { const openMatchPopup = useCallback(() => {
if (match.isClickable && match.calc && match.hasVideo) { if (match.isClickable) {
setMatch(match) setMatch(match)
openPopup() openPopup()
fetchMatchPlaylists(match) fetchMatchPlaylists(match)

@ -21,6 +21,7 @@ const prepareMatch = ({
tournament, tournament,
}: Match) => { }: Match) => {
const date = new Date(matchDate) const date = new Date(matchDate)
const accessable = sub && access
return { return {
accessibleBySubscription: sub, accessibleBySubscription: sub,
accessibleInUsersCountry: access, accessibleInUsersCountry: access,
@ -29,10 +30,12 @@ const prepareMatch = ({
formattedDate: format(date, 'dd.MM.yy'), formattedDate: format(date, 'dd.MM.yy'),
hasVideo: has_video, hasVideo: has_video,
id, id,
isClickable: (sub && access && ( isClickable: live
has_video ? accessable
: (accessable && calc && (
has_video
|| storage || storage
)), )),
live, live,
preview, preview,
sportName: getSportLexic(sport), sportName: getSportLexic(sport),

Loading…
Cancel
Save