Skip to content

Commit

Permalink
Merge pull request #1337 from ParabolInc/epic6.5-menu-sprint1
Browse files Browse the repository at this point in the history
Epic 6.5 Menu Sprint #1
  • Loading branch information
ackernaut committed Sep 15, 2017
2 parents d67a115 + fc606b8 commit e9a8b74
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
Expand Up @@ -93,6 +93,10 @@ const mutationHandlers = {
updateAgendaItem: handleAgendaSort
};

const handleHotkey = (gotoFunc) => () => {
if (document.activeElement === document.body) gotoFunc();
};

const mapStateToProps = (state, props) => {
const {match: {params: {localPhase, localPhaseItem, teamId}}} = props;
const {sub: userId} = state.auth.obj;
Expand Down Expand Up @@ -160,8 +164,8 @@ export default class MeetingContainer extends Component {
componentWillMount() {
const {bindHotkey, teamId} = this.props;
handleRedirects({}, this.props);
bindHotkey(['enter', 'right'], this.gotoNext);
bindHotkey('left', this.gotoPrev);
bindHotkey(['enter', 'right'], handleHotkey(this.gotoNext));
bindHotkey('left', handleHotkey(this.gotoPrev));
bindHotkey('i c a n t h a c k i t', () => cashay.mutate('killMeeting', {variables: {teamId}}));
}

Expand Down
2 changes: 1 addition & 1 deletion src/universal/modules/menu/components/MenuItem/MenuItem.js
Expand Up @@ -57,7 +57,7 @@ const MenuItem = (props) => {
return (
<div title={titleStr}>
{hr === 'before' && <hr className={css(styles.hr)} />}
<div className={rootStyles} onClick={handleClick} >
<div className={rootStyles} onClick={handleClick}>
{avatar && makeAvatar()}
{!avatar && icon && makeIcon()}
{labelEl}
Expand Down
Expand Up @@ -81,28 +81,29 @@ class OutcomeCardFooter extends Component {
const {teamMember: owner, integration, team: {name: teamName}} = outcome;
const {service} = integration || {};
const isArchived = isProjectArchived(outcome.tags);

const buttonBlockStyles = css(
styles.buttonBlock,
cardIsActive && styles.showBlock
);

const avatarStyles = css(
styles.avatar,
cardIsActive && styles.activeAvatar
);

const {error} = this.state;
const ownerAvatarOrTeamName = (
showTeam ?
<div className={css(styles.teamName)}>{teamName}</div> :
(<div className={avatarStyles} tabIndex="0">
(<button
className={avatarStyles}
tabIndex={service && '-1'}
type="button"
>
<img
alt={owner.preferredName}
className={css(styles.avatarImg)}
src={owner.picture}
/>
</div>)
</button>)
);

return (
Expand Down Expand Up @@ -203,8 +204,10 @@ const styleThunk = () => ({
},

avatar: {
appearance: 'none',
borderRadius: '100%',
border: '.0625rem solid transparent',
boxShadow: 'none',
cursor: 'pointer',
height: '1.75rem',
marginLeft: '-.125rem',
Expand Down
Expand Up @@ -25,11 +25,15 @@ const OutcomeCardFooterButton = (props) => {

const handleOnClick = (e) => {
if (onClick) onClick(e);
// e.currentTarget.blur();
};

return (
<button className={buttonStyles} onClick={handleOnClick} onMouseEnter={onMouseEnter}>
<button
className={buttonStyles}
onClick={handleOnClick}
onMouseEnter={onMouseEnter}
type="button"
>
<FontAwesome name={icon} style={faStyle} />
</button>
);
Expand Down

0 comments on commit e9a8b74

Please sign in to comment.