You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
804 B

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. import { FormattedMessage } from 'react-intl';
  3. const iconStyle = {
  4. display: 'inline-block',
  5. marginRight: '5px'
  6. };
  7. const ColumnBackButton = React.createClass({
  8. contextTypes: {
  9. router: React.PropTypes.object
  10. },
  11. mixins: [PureRenderMixin],
  12. handleClick () {
  13. if (window.history && window.history.length === 1) this.context.router.push("/");
  14. else this.context.router.goBack();
  15. },
  16. render () {
  17. return (
  18. <div role='button' tabIndex='0' onClick={this.handleClick} className='column-back-button'>
  19. <i className='fa fa-fw fa-chevron-left' style={iconStyle} />
  20. <FormattedMessage id='column_back_button.label' defaultMessage='Back' />
  21. </div>
  22. );
  23. }
  24. });
  25. export default ColumnBackButton;