Ejemplo n.º 1
0
MosaicPage.propTypes = {
  actions: PropTypes.object.isRequired,
  tracks: ImmutablePropTypes.map.isRequired,
  isFetching: PropTypes.bool.isRequired,
  error: PropTypes.object,
};

MosaicPage.defaultProps = {
  error: null,
};

MosaicPage.componentDidMount = ({ actions, idToken }) => actions.mosaicRequest(idToken);

const mapStateToProps = state => (
  {
    idToken: authSelectors.getIdToken(state),
    tracks: getTracks(state),
    isFetching: getIsFetching(state),
    error: getError(state),
  }
);

const mapDispatchToProps = dispatch => (
  {
    actions: bindActionCreators({ mosaicRequest, ...appActions }, dispatch),
  }
);

export default connect(mapStateToProps, mapDispatchToProps)(functional(MosaicPage));
Ejemplo n.º 2
0
        onKeypress={nav(cmp)}
        onCheck={toggleTooltips}
        onUncheck={toggleTooltips}
        top={7}
        height={1}
        width={22}
        left={4}
        checked={tooltips}
        text='Tooltips'
        class={{...bg}}
      />
    </form>
    <box tags top={8} height={18} class={{...bg}}>
      {help}
    </box>
  </box>)
}

export default functional(Settings, {
  componentDidMount: ({focusedInput = 'normal'}, refs) => {
    const {children: layout} = refs.form.children[1]
    const tooltips = refs.form.children[3]

    const selected = layout.find(c => c.text.toLowerCase() === focusedInput) ||
      tooltips.options.text.toLowerCase() === focusedInput && tooltips

    if (!selected) { return }
    setTimeout(() => selected.focus())
  }
})
Ejemplo n.º 3
0
          }

          if (independent) {
            if (key.name === 'escape') {
              // hack :( - avoids intermittent crashing
              setTimeout(() => {
                actions.focusTab('sources')
                actions.focusPanel('console')
              })
            }
            return
          }
        }}
      />
      {independent && (
        <box
          width={15}
          right={0}
          bottom={0}
          height={1}
        >
          Exit: ESC, TAB
        </box>
      )}

    </box>
  )
}

export default functional(Console)