Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

Commit

Permalink
Fix #1484 show full title on signle column
Browse files Browse the repository at this point in the history
  • Loading branch information
Bowen Zhang authored and dwalintukan committed Jun 21, 2019
1 parent dde4477 commit 75f26eb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
48 changes: 25 additions & 23 deletions src/components/EventCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,36 @@ export default class EventCard extends Component {
<Card className={classes.eventCard} onClick={onClick}>
<div className={cx(classes.eventCardBg, `bg${index % 8}`)}></div>
<div className={cx(classes.eventCardSection, 'top')}>
{isPending() && status !== WITHDRAWING && <EventWarning id="str.pendingConfirmation" message="Pending Confirmation" />}
{isPending() && status === WITHDRAWING && <EventWarning id="str.withdrawing" message="Withdrawning" type={EventWarningType.INFO} />}
{this.isWithdrawn && <EventWarning id="str.withdrawn" message="Withdrawn" type={EventWarningType.INFO} />}
<div className={classes.stateText}><FormattedMessageFixed id={messages[getEventDesc(event, currentAddress)].id} defaultMessage={messages[getEventDesc(event, currentAddress)].defaultMessage} /></div>
<div className={classes.eventCardNameBundle}>
<div className={classes.eventCardNameFlex}>
<Typography variant="h6" className={classes.eventCardName}>
{name}
</Typography>
</div>
<FavoriteButton eventAddress={address} />
</div>
<div className={classes.eventCardNameBundle}>
<div className={classes.eventCardNameFlex}>
<div className={classes.eventCardInfoItem}>
<FormattedMessage id='str.arbitrationReward' defaultMessage='Arbitration Reward' />{`: ${arbitrationRewardPercentage}%`}
</div>
<div className={classes.eventCardInfoItem}>
<RaisedAmount amount={totalBets} />
<div className={classes.upper}>
{isPending() && status !== WITHDRAWING && <EventWarning id="str.pendingConfirmation" message="Pending Confirmation" />}
{isPending() && status === WITHDRAWING && <EventWarning id="str.withdrawing" message="Withdrawning" type={EventWarningType.INFO} />}
{this.isWithdrawn && <EventWarning id="str.withdrawn" message="Withdrawn" type={EventWarningType.INFO} />}
<div className={classes.stateText}><FormattedMessageFixed id={messages[getEventDesc(event, currentAddress)].id} defaultMessage={messages[getEventDesc(event, currentAddress)].defaultMessage} /></div>
<div className={classes.eventCardNameBundle}>
<div className={classes.eventCardNameFlex}>
<Typography variant="h6" className={classes.eventCardName}>
{name}
</Typography>
</div>
<FavoriteButton eventAddress={address} />
</div>
<div className={classes.eventCardInfo}>
<div className={classes.eventCardInfoItem}>
{getEndTime() && <TimeCorner endTime={getEndTime()} />}
<div className={classes.eventCardNameBundle}>
<div className={classes.eventCardNameFlex}>
<div className={classes.eventCardInfoItem}>
<FormattedMessage id='str.arbitrationReward' defaultMessage='Arbitration Reward' />{`: ${arbitrationRewardPercentage}%`}
</div>
<div className={classes.eventCardInfoItem}>
<RaisedAmount amount={totalBets} />
</div>
</div>
<div className={classes.eventCardInfo}>
<div className={classes.eventCardInfoItem}>
{getEndTime() && <TimeCorner endTime={getEndTime()} />}
</div>
</div>
</div>
</div>
<div className={classes.alignBottom}>
<div>
{this.renderOptions()}
</div>
</div>
Expand Down
17 changes: 17 additions & 0 deletions src/components/EventCard/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const styles = (theme) => ({
padding: theme.padding.space3X.px,
'&.top': {
height: '400px',
[theme.breakpoints.down('xs')]: {
height: 'auto',
},
},
'&.button': {
textAlign: 'center',
Expand All @@ -27,6 +30,9 @@ const styles = (theme) => ({
fontSize: theme.sizes.font.small,
color: theme.palette.text.primary,
},
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
},
dashboardTime: {
color: theme.palette.text.hint,
Expand All @@ -47,6 +53,14 @@ const styles = (theme) => ({
fontSize: '1.05rem',
textAlign: 'left',
whiteSpace: 'nowrap',
[theme.breakpoints.down('xs')]: {
maxHeight: 'none',
overflow: 'visible',
textOverflow: 'clip',
whiteSpace: 'normal',
wordBreak: 'break-word',
textAlign: 'justify',
},
},
eventCardNameBundle: {
display: 'flex',
Expand Down Expand Up @@ -86,6 +100,9 @@ const styles = (theme) => ({
eventCardInfoItem: {
padding: `${theme.padding.spaceX.px} 0px 0px`,
},
upper: {
marginBottom: theme.padding.space12X.px,
},
});

export default styles;

0 comments on commit 75f26eb

Please sign in to comment.