Fix various issues in polls

Port front-end changes from a198add83b to glitch-soc
pull/935/head
Eugen Rochko 2019-03-05 03:51:18 +01:00 committed by Thibaut Girka
parent 7f27ee35a8
commit ba6ca3cd69
2 changed files with 4 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class Poll extends ImmutablePureComponent {
/> />
{!showResults && <span className={classNames('poll__input', { checkbox: poll.get('multiple'), active })} />} {!showResults && <span className={classNames('poll__input', { checkbox: poll.get('multiple'), active })} />}
{showResults && <span className='poll__number'>{Math.floor(percent)}%</span>} {showResults && <span className='poll__number'>{Math.round(percent)}%</span>}
{option.get('title')} {option.get('title')}
</label> </label>
@ -146,7 +146,8 @@ class Poll extends ImmutablePureComponent {
<div className='poll__footer'> <div className='poll__footer'>
{!showResults && <button className='button button-secondary' disabled={disabled} onClick={this.handleVote}><FormattedMessage id='poll.vote' defaultMessage='Vote' /></button>} {!showResults && <button className='button button-secondary' disabled={disabled} onClick={this.handleVote}><FormattedMessage id='poll.vote' defaultMessage='Vote' /></button>}
{showResults && !this.props.disabled && <span><button className='poll__link' onClick={this.handleRefresh}><FormattedMessage id='poll.refresh' defaultMessage='Refresh' /></button> · </span>} {showResults && !this.props.disabled && <span><button className='poll__link' onClick={this.handleRefresh}><FormattedMessage id='poll.refresh' defaultMessage='Refresh' /></button> · </span>}
<FormattedMessage id='poll.total_votes' defaultMessage='{count, plural, one {# vote} other {# votes}}' values={{ count: poll.get('votes_count') }} /> · {timeRemaining} <FormattedMessage id='poll.total_votes' defaultMessage='{count, plural, one {# vote} other {# votes}}' values={{ count: poll.get('votes_count') }} />
{poll.get('expires_at') && <span> · {timeRemaining}</span>}
</div> </div>
</div> </div>
); );

View File

@ -82,6 +82,7 @@
border: 0; border: 0;
color: $dark-text-color; color: $dark-text-color;
text-decoration: underline; text-decoration: underline;
font-size: inherit;
&:hover, &:hover,
&:focus, &:focus,