fix(1998): displaying date and time in match grid

keep-around/f3c52414987fe19fbb7ec1c327dc17a8d7be8229
Mirlan 4 years ago
parent 79b4f2f625
commit f3c5241498
  1. 6
      src/features/MatchCard/CardFrontside/index.tsx
  2. 7
      src/features/MatchCard/styled.tsx

@ -54,11 +54,9 @@ export const CardFrontside = ({
access, access,
date, date,
formattedDate, formattedDate,
hasVideo,
live, live,
preview, preview,
sportType, sportType,
storage,
team1, team1,
team2, team2,
time, time,
@ -125,9 +123,7 @@ export const CardFrontside = ({
: ( : (
<MatchDate isHomePage={isHomePage}> <MatchDate isHomePage={isHomePage}>
{isHomePage ? null : formattedDate} {isHomePage ? null : formattedDate}
{(isInFuture && (!hasVideo || !storage)) <Time>{time}</Time>
? <Time>{time}</Time>
: null}
</MatchDate> </MatchDate>
)} )}
</MatchTimeInfo> </MatchTimeInfo>

@ -84,9 +84,10 @@ export const Preview = styled.img`
` `
export const MatchTimeInfo = styled.div` export const MatchTimeInfo = styled.div`
width: 100%;
position: absolute; position: absolute;
top: 0.519rem; top: 0.519rem;
left: 0.519rem; padding: 0 0.519rem;
` `
type MatchDateProps = { type MatchDateProps = {
@ -94,6 +95,7 @@ type MatchDateProps = {
} }
export const MatchDate = styled.div<MatchDateProps>` export const MatchDate = styled.div<MatchDateProps>`
width: fit-content;
height: 0.9rem; height: 0.9rem;
border-radius: 2px; border-radius: 2px;
padding: ${({ isHomePage }) => (!isHomePage ? '0 0.27rem' : '')}; padding: ${({ isHomePage }) => (!isHomePage ? '0 0.27rem' : '')};
@ -122,8 +124,7 @@ export const MatchDate = styled.div<MatchDateProps>`
export const LiveSign = styled(MatchDate)` export const LiveSign = styled(MatchDate)`
background-color: #CC0000; background-color: #CC0000;
position: absolute; margin-left: auto;
top: 0;
` `
export const Time = styled.span` export const Time = styled.span`

Loading…
Cancel
Save