|
|
|
@ -26,6 +26,7 @@ import { |
|
|
|
TeamLogo, |
|
|
|
TeamLogo, |
|
|
|
BuyMatchButton, |
|
|
|
BuyMatchButton, |
|
|
|
} from '../styled' |
|
|
|
} from '../styled' |
|
|
|
|
|
|
|
import { MatchStatuses, useHeaderFiltersStore } from '../../HeaderFilters' |
|
|
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
type Props = { |
|
|
|
match: Match, |
|
|
|
match: Match, |
|
|
|
@ -55,7 +56,10 @@ export const CardFrontside = ({ |
|
|
|
}: Props) => { |
|
|
|
}: Props) => { |
|
|
|
const tournamentName = useName(tournament) |
|
|
|
const tournamentName = useName(tournament) |
|
|
|
const { isScoreHidden } = useMatchSwitchesStore() |
|
|
|
const { isScoreHidden } = useMatchSwitchesStore() |
|
|
|
|
|
|
|
const { selectedMatchStatus } = useHeaderFiltersStore() |
|
|
|
const unixTimeOfMatch = getUnixTime(date) |
|
|
|
const unixTimeOfMatch = getUnixTime(date) |
|
|
|
|
|
|
|
const isInFuture = unixTimeOfMatch > getUnixTime(new Date()) |
|
|
|
|
|
|
|
const isFutureMatch = isInFuture || selectedMatchStatus === MatchStatuses.Soon |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<CardWrapper |
|
|
|
<CardWrapper |
|
|
|
@ -95,12 +99,8 @@ export const CardFrontside = ({ |
|
|
|
{(accessibleBySubscription && !accessibleInUsersCountry) && <NoAccessMessage />} |
|
|
|
{(accessibleBySubscription && !accessibleInUsersCountry) && <NoAccessMessage />} |
|
|
|
<MatchDate> |
|
|
|
<MatchDate> |
|
|
|
{formattedDate} |
|
|
|
{formattedDate} |
|
|
|
{unixTimeOfMatch > getUnixTime(new Date()) && (!hasVideo || !storage) |
|
|
|
{(isInFuture && (!hasVideo || !storage)) |
|
|
|
? ( |
|
|
|
? <Time>{time}</Time> |
|
|
|
<Time> |
|
|
|
|
|
|
|
{time} |
|
|
|
|
|
|
|
</Time> |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
: null} |
|
|
|
: null} |
|
|
|
</MatchDate> |
|
|
|
</MatchDate> |
|
|
|
</PreviewWrapper> |
|
|
|
</PreviewWrapper> |
|
|
|
@ -114,11 +114,11 @@ export const CardFrontside = ({ |
|
|
|
<Teams> |
|
|
|
<Teams> |
|
|
|
<Team> |
|
|
|
<Team> |
|
|
|
<TeamName nameObj={team1} /> |
|
|
|
<TeamName nameObj={team1} /> |
|
|
|
{!isScoreHidden && <Score>{team1.score}</Score>} |
|
|
|
{isFutureMatch ? null : !isScoreHidden && <Score>{team1.score}</Score>} |
|
|
|
</Team> |
|
|
|
</Team> |
|
|
|
<Team> |
|
|
|
<Team> |
|
|
|
<TeamName nameObj={team2} /> |
|
|
|
<TeamName nameObj={team2} /> |
|
|
|
{!isScoreHidden && <Score>{team2.score}</Score>} |
|
|
|
{isFutureMatch ? null : !isScoreHidden && <Score>{team2.score}</Score>} |
|
|
|
</Team> |
|
|
|
</Team> |
|
|
|
</Teams> |
|
|
|
</Teams> |
|
|
|
</Info> |
|
|
|
</Info> |
|
|
|
|