The code powering m.abunchtell.com https://m.abunchtell.com
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

28 строки
799 B

  1. import React from 'react';
  2. import { FormattedMessage } from 'react-intl';
  3. import PropTypes from 'prop-types';
  4. export default class ColumnBackButton extends React.PureComponent {
  5. static contextTypes = {
  6. router: PropTypes.object,
  7. };
  8. handleClick = (e) => {
  9. if (!e.key || e.key === 'Enter') {
  10. if (window.history && window.history.length === 1) this.context.router.history.push('/');
  11. else this.context.router.history.goBack();
  12. }
  13. }
  14. render () {
  15. return (
  16. <div role='button' tabIndex='0' onClick={this.handleClick} onKeyDown={this.handleClick} className='column-back-button'>
  17. <i className='fa fa-fw fa-chevron-left column-back-button__icon' />
  18. <FormattedMessage id='column_back_button.label' defaultMessage='Back' />
  19. </div>
  20. );
  21. }
  22. }