@ -1,5 +1,7 @@
import type { KeyboardEvent } from 'react'
import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes } from 'config'
import type { Match } from 'features/Matches'
@ -7,7 +9,6 @@ import { SportName } from 'features/Common'
import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { useName } from 'features/Name'
import { getUnixTime } from 'date-fns'
import { NoAccessMessage } from '../NoAccessMessage'
import {
CardWrapper ,
@ -38,6 +39,7 @@ export const CardFrontside = ({
accessibleBySubscription ,
accessibleInUsersCountry ,
date ,
formattedDate ,
hasVideo ,
preview ,
sportType ,
@ -46,7 +48,6 @@ export const CardFrontside = ({
team2 ,
time ,
tournament ,
unformattedDate ,
} ,
onClick ,
onKeyPress ,
@ -54,7 +55,7 @@ export const CardFrontside = ({
} : Props ) = > {
const tournamentName = useName ( tournament )
const { isScoreHidden } = useMatchSwitchesStore ( )
const unixTimeOfMatch = getUnixTime ( new Date ( unformatte dD ate) )
const unixTimeOfMatch = getUnixTime ( date )
return (
< CardWrapper
@ -91,20 +92,17 @@ export const CardFrontside = ({
)
}
{ ! accessibleBySubscription && < BuyMatchButton / > }
{ ( accessibleBySubscription && ! accessibleInUsersCountry )
? < NoAccessMessage / >
: (
< MatchDate >
{ date }
{ unixTimeOfMatch > getUnixTime ( new Date ( ) ) && ( ! hasVideo || ! storage )
? (
< Time >
{ time }
< / Time >
)
: null }
< / MatchDate >
) }
{ ( accessibleBySubscription && ! accessibleInUsersCountry ) && < NoAccessMessage / > }
< MatchDate >
{ formattedDate }
{ unixTimeOfMatch > getUnixTime ( new Date ( ) ) && ( ! hasVideo || ! storage )
? (
< Time >
{ time }
< / Time >
)
: null }
< / MatchDate >
< / PreviewWrapper >
< Info >
{ showSportName && < SportName sport = { sportType } / > }