static contextTypes = {
router: PropTypes.object,
+ identity: PropTypes.object,
};
static propTypes = {
collapsedContent.push(moveButtons);
}
- if (children || (multiColumn && this.props.onPin)) {
+ if (this.context.identity.signedIn && (children || (multiColumn && this.props.onPin))) {
collapseButton = (
<button
className={collapsibleButtonClassName}
export default @injectIntl
class Poll extends ImmutablePureComponent {
+ static contextTypes = {
+ identity: PropTypes.object,
+ };
+
static propTypes = {
poll: ImmutablePropTypes.map,
intl: PropTypes.object.isRequired,
</ul>
<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 || !this.context.identity.signedIn} 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>}
{votesCount}
{poll.get('expires_at') && <span> · {timeRemaining}</span>}
};
static propTypes = {
+ withHotkeys: PropTypes.bool,
onLogout: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
}
render () {
+ const { withHotkeys } = this.props;
const { signedIn, permissions } = this.context.identity;
const items = [];
items.push(<a key='invites' href='/invites' target='_blank'><FormattedMessage id='getting_started.invite' defaultMessage='Invite people' /></a>);
}
+ if (signedIn && withHotkeys) {
+ items.push(<Link key='hotkeys' to='/keyboard-shortcuts'><FormattedMessage id='navigation_bar.keyboard_shortcuts' defaultMessage='Hotkeys' /></Link>);
+ }
+
if (signedIn && securityLink) {
items.push(<a key='security' href='/auth/edit'><FormattedMessage id='getting_started.security' defaultMessage='Security' /></a>);
}
&:focus {
text-shadow: 0 0 4px darken($ui-highlight-color, 5%);
}
+
+ &:disabled {
+ color: $dark-text-color;
+ cursor: default;
+ }
}
.column-header__notif-cleaning-buttons {