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.

47 lines
1.0 KiB

  1. import { FormattedMessage } from 'react-intl';
  2. import PropTypes from 'prop-types';
  3. const outerStyle = {
  4. position: 'absolute',
  5. right: '0',
  6. top: '-48px',
  7. padding: '15px',
  8. fontSize: '16px',
  9. flex: '0 0 auto',
  10. cursor: 'pointer'
  11. };
  12. const iconStyle = {
  13. display: 'inline-block',
  14. marginRight: '5px'
  15. };
  16. class ColumnBackButtonSlim extends React.PureComponent {
  17. constructor (props, context) {
  18. super(props, context);
  19. this.handleClick = this.handleClick.bind(this);
  20. }
  21. handleClick () {
  22. this.context.router.push('/');
  23. }
  24. render () {
  25. return (
  26. <div style={{ position: 'relative' }}>
  27. <div role='button' tabIndex='0' style={outerStyle} onClick={this.handleClick} className='column-back-button'>
  28. <i className='fa fa-fw fa-chevron-left' style={iconStyle} />
  29. <FormattedMessage id='column_back_button.label' defaultMessage='Back' />
  30. </div>
  31. </div>
  32. );
  33. }
  34. }
  35. ColumnBackButtonSlim.contextTypes = {
  36. router: PropTypes.object
  37. };
  38. export default ColumnBackButtonSlim;