mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 01:24:02 -05:00
8ee2eb5d2e
* Allow mounting arbitrary columns * Refactor column headers, allow pinning/unpinning and moving columns around * Collapse animation * Re-introduce scroll to top * Save column settings properly, do not display pin options in single-column view, do not display collapse icon if there is nothing to collapse * Fix one instance of public timeline being closed closing the stream Fix back buttons inconsistently sending you back to / even if history exists * Getting started displays links to columns that are not mounted
28 lines
722 B
JavaScript
28 lines
722 B
JavaScript
import React from 'react';
|
|
import { FormattedMessage } from 'react-intl';
|
|
import PropTypes from 'prop-types';
|
|
|
|
class ColumnBackButton extends React.PureComponent {
|
|
|
|
static contextTypes = {
|
|
router: PropTypes.object,
|
|
};
|
|
|
|
handleClick = () => {
|
|
if (window.history && window.history.length === 1) this.context.router.push('/');
|
|
else this.context.router.goBack();
|
|
}
|
|
|
|
render () {
|
|
return (
|
|
<div role='button' tabIndex='0' onClick={this.handleClick} className='column-back-button'>
|
|
<i className='fa fa-fw fa-chevron-left column-back-button__icon'/>
|
|
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
export default ColumnBackButton;
|