2017-01-03 00:15:42 +00:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2017-04-21 18:05:35 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2017-01-03 00:15:42 +00:00
|
|
|
|
|
|
|
const outerStyle = {
|
|
|
|
position: 'absolute',
|
|
|
|
right: '0',
|
|
|
|
top: '-48px',
|
|
|
|
padding: '15px',
|
|
|
|
fontSize: '16px',
|
|
|
|
flex: '0 0 auto',
|
2017-02-09 00:20:09 +00:00
|
|
|
cursor: 'pointer'
|
2017-01-03 00:15:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const iconStyle = {
|
|
|
|
display: 'inline-block',
|
|
|
|
marginRight: '5px'
|
|
|
|
};
|
|
|
|
|
2017-04-21 18:05:35 +00:00
|
|
|
class ColumnBackButtonSlim extends React.PureComponent {
|
2017-01-03 00:15:42 +00:00
|
|
|
|
2017-04-21 18:05:35 +00:00
|
|
|
constructor (props, context) {
|
|
|
|
super(props, context);
|
|
|
|
this.handleClick = this.handleClick.bind(this);
|
|
|
|
}
|
2017-01-03 00:15:42 +00:00
|
|
|
|
|
|
|
handleClick () {
|
|
|
|
this.context.router.push('/');
|
2017-04-21 18:05:35 +00:00
|
|
|
}
|
2017-01-03 00:15:42 +00:00
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div style={{ position: 'relative' }}>
|
2017-04-15 11:27:27 +00:00
|
|
|
<div role='button' tabIndex='0' style={outerStyle} onClick={this.handleClick} className='column-back-button'>
|
2017-01-03 00:15:42 +00:00
|
|
|
<i className='fa fa-fw fa-chevron-left' style={iconStyle} />
|
|
|
|
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-21 18:05:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ColumnBackButtonSlim.contextTypes = {
|
|
|
|
router: PropTypes.object
|
|
|
|
};
|
2017-01-03 00:15:42 +00:00
|
|
|
|
2017-01-30 14:22:04 +00:00
|
|
|
export default ColumnBackButtonSlim;
|