Remove unused ColumnBackButton component
This commit is contained in:
parent
b8bcd53d49
commit
4c5bff2fb5
3 changed files with 0 additions and 54 deletions
|
@ -1,12 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { render, screen } from '../../jest/test-helpers';
|
|
||||||
import ColumnBackButton from '../column_back_button';
|
|
||||||
|
|
||||||
describe('<ColumnBackButton />', () => {
|
|
||||||
it('renders correctly', () => {
|
|
||||||
render(<ColumnBackButton />);
|
|
||||||
|
|
||||||
expect(screen.getByRole('button')).toHaveTextContent('Back');
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,41 +0,0 @@
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import React from 'react';
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
import { withRouter } from 'react-router-dom';
|
|
||||||
|
|
||||||
import Icon from 'soapbox/components/icon';
|
|
||||||
|
|
||||||
export default @withRouter
|
|
||||||
class ColumnBackButton extends React.PureComponent {
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
to: PropTypes.string,
|
|
||||||
history: PropTypes.object,
|
|
||||||
};
|
|
||||||
|
|
||||||
handleClick = () => {
|
|
||||||
const { to } = this.props;
|
|
||||||
|
|
||||||
if (window.history?.length === 1) {
|
|
||||||
this.props.history.push(to ? to : '/');
|
|
||||||
} else {
|
|
||||||
this.props.history.goBack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleKeyUp = (e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
this.handleClick();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<button onClick={this.handleClick} onKeyUp={this.handleKeyUp} className='column-back-button'>
|
|
||||||
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
|
||||||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -77,7 +77,6 @@ class ChatRoom extends ImmutablePureComponent {
|
||||||
return (
|
return (
|
||||||
<Column label={`@${getAcct(account, displayFqn)}`}>
|
<Column label={`@${getAcct(account, displayFqn)}`}>
|
||||||
{/* <div className='chatroom__back'>
|
{/* <div className='chatroom__back'>
|
||||||
<ColumnBackButton />
|
|
||||||
<Link to={`/@${account.get('acct')}`} className='chatroom__header'>
|
<Link to={`/@${account.get('acct')}`} className='chatroom__header'>
|
||||||
<Avatar account={account} size={18} />
|
<Avatar account={account} size={18} />
|
||||||
<div className='chatroom__title'>
|
<div className='chatroom__title'>
|
||||||
|
|
Loading…
Reference in a new issue