Delete ColumnBackButtonSlim, fix runtime warnings
This commit is contained in:
parent
a8dfe1262b
commit
ef809a8d59
25 changed files with 23 additions and 53 deletions
|
@ -1,11 +0,0 @@
|
|||
import React from 'react';
|
||||
import ColumnBackButtonSlim from '../column_back_button_slim';
|
||||
import { createComponent } from 'soapbox/test_helpers';
|
||||
|
||||
describe('<ColumnBackButtonSlim />', () => {
|
||||
it('renders correctly', () => {
|
||||
const component = createComponent(<ColumnBackButtonSlim />);
|
||||
const tree = component.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
});
|
|
@ -1,19 +0,0 @@
|
|||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import ColumnBackButton from './column_back_button';
|
||||
import Icon from 'soapbox/components/icon';
|
||||
|
||||
export default class ColumnBackButtonSlim extends ColumnBackButton {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className='column-back-button--slim'>
|
||||
<div role='button' tabIndex='0' onClick={this.handleClick} onKeyUp={this.handleKeyUp} className='column-back-button column-back-button--slim-button'>
|
||||
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
||||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -79,7 +79,7 @@ export default class SubNavigation extends React.PureComponent {
|
|||
onKeyUp={this.handleBackKeyUp}
|
||||
>
|
||||
<Icon src={require('@tabler/icons/icons/arrow-back.svg')} />
|
||||
<FormattedMessage id='sub_navigation.back' defaultMessage='Back' />
|
||||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
||||
</button>
|
||||
{message && (
|
||||
<div className='sub-navigation__message'>
|
||||
|
|
|
@ -44,7 +44,7 @@ class AwaitingApproval extends ImmutablePureComponent {
|
|||
const showLoading = isLoading && accountIds.count() === 0;
|
||||
|
||||
return (
|
||||
<Column icon='user' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='user' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
isLoading={isLoading}
|
||||
showLoading={showLoading}
|
||||
|
|
|
@ -80,7 +80,7 @@ class Dashboard extends ImmutablePureComponent {
|
|||
if (!account) return null;
|
||||
|
||||
return (
|
||||
<Column icon='tachometer-alt' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='tachometer-alt' heading={intl.formatMessage(messages.heading)}>
|
||||
<div className='dashcounters'>
|
||||
{mau && <div className='dashcounter'>
|
||||
<div>
|
||||
|
|
|
@ -60,7 +60,7 @@ class ModerationLog extends ImmutablePureComponent {
|
|||
const showLoading = isLoading && items.count() === 0;
|
||||
|
||||
return (
|
||||
<Column icon='balance-scale' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='balance-scale' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
isLoading={isLoading}
|
||||
showLoading={showLoading}
|
||||
|
|
|
@ -52,7 +52,7 @@ class Aliases extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.aliases' defaultMessage="You haven't created any account alias yet." />;
|
||||
|
||||
return (
|
||||
<Column className='aliases-settings-panel' icon='suitcase' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column className='aliases-settings-panel' icon='suitcase' heading={intl.formatMessage(messages.heading)}>
|
||||
<ColumnSubheading text={intl.formatMessage(messages.subheading_add_new)} />
|
||||
<Search />
|
||||
{
|
||||
|
|
|
@ -54,7 +54,7 @@ class Blocks extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.blocks' defaultMessage="You haven't blocked any users yet." />;
|
||||
|
||||
return (
|
||||
<Column icon='ban' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='ban' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
scrollKey='blocks'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
|
|
|
@ -36,7 +36,7 @@ class CryptoDonate extends ImmutablePureComponent {
|
|||
const { explanationBoxExpanded } = this.state;
|
||||
|
||||
return (
|
||||
<Column icon='bitcoin' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='bitcoin' heading={intl.formatMessage(messages.heading)}>
|
||||
<div className='crypto-donate'>
|
||||
<div className='explanation-box'>
|
||||
<Accordion
|
||||
|
|
|
@ -55,7 +55,7 @@ class Blocks extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.domain_blocks' defaultMessage='There are no hidden domains yet.' />;
|
||||
|
||||
return (
|
||||
<Column icon='minus-circle' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='minus-circle' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
scrollKey='domain_blocks'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
|
|
|
@ -230,7 +230,7 @@ class EditProfile extends ImmutablePureComponent {
|
|||
const canEditName = verifiedCanEditName || !verified;
|
||||
|
||||
return (
|
||||
<Column icon='user' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='user' heading={intl.formatMessage(messages.heading)}>
|
||||
<SimpleForm onSubmit={this.handleSubmit}>
|
||||
<fieldset disabled={this.state.isLoading}>
|
||||
<FieldsGroup>
|
||||
|
|
|
@ -52,7 +52,7 @@ class ExportData extends ImmutablePureComponent {
|
|||
const { intl } = this.props;
|
||||
|
||||
return (
|
||||
<Column icon='cloud-download-alt' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='cloud-download-alt' heading={intl.formatMessage(messages.heading)}>
|
||||
<CSVExporter action={exportFollows} messages={followMessages} />
|
||||
<CSVExporter action={exportBlocks} messages={blockMessages} />
|
||||
<CSVExporter action={exportMutes} messages={muteMessages} />
|
||||
|
|
|
@ -50,7 +50,7 @@ class FederationRestrictions extends ImmutablePureComponent {
|
|||
const emptyMessage = disclosed ? messages.emptyMessage : messages.notDisclosed;
|
||||
|
||||
return (
|
||||
<Column icon='gavel' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='gavel' heading={intl.formatMessage(messages.heading)}>
|
||||
<div className='explanation-box'>
|
||||
<Accordion
|
||||
headline={intl.formatMessage(messages.boxTitle)}
|
||||
|
|
|
@ -133,7 +133,7 @@ class Filters extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.filters' defaultMessage="You haven't created any muted words yet." />;
|
||||
|
||||
return (
|
||||
<Column className='filter-settings-panel' icon='filter' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column className='filter-settings-panel' icon='filter' heading={intl.formatMessage(messages.heading)}>
|
||||
<ColumnSubheading text={intl.formatMessage(messages.subheading_add_new)} />
|
||||
<SimpleForm>
|
||||
<div className='filter-settings-panel'>
|
||||
|
|
|
@ -54,7 +54,7 @@ class FollowRequests extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.follow_requests' defaultMessage="You don't have any follow requests yet. When you receive one, it will show up here." />;
|
||||
|
||||
return (
|
||||
<Column icon='user-plus' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='user-plus' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
scrollKey='follow_requests'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
|
|
|
@ -52,7 +52,7 @@ class ImportData extends ImmutablePureComponent {
|
|||
const { intl, features } = this.props;
|
||||
|
||||
return (
|
||||
<Column icon='cloud-upload-alt' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='cloud-upload-alt' heading={intl.formatMessage(messages.heading)}>
|
||||
<CSVImporter action={importFollows} messages={followMessages} />
|
||||
<CSVImporter action={importBlocks} messages={blockMessages} />
|
||||
{features.importMutes && <CSVImporter action={importMutes} messages={muteMessages} />}
|
||||
|
|
|
@ -60,7 +60,7 @@ class Lists extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.lists' defaultMessage="You don't have any lists yet. When you create one, it will show up here." />;
|
||||
|
||||
return (
|
||||
<Column icon='list-ul' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='list-ul' heading={intl.formatMessage(messages.heading)}>
|
||||
<br />
|
||||
<ColumnSubheading text={intl.formatMessage(messages.add)} />
|
||||
<NewListForm />
|
||||
|
|
|
@ -54,7 +54,7 @@ class Mutes extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.mutes' defaultMessage="You haven't muted any users yet." />;
|
||||
|
||||
return (
|
||||
<Column icon='volume-off' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='volume-off' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
scrollKey='mutes'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
|
|
|
@ -131,7 +131,7 @@ class Preferences extends ImmutablePureComponent {
|
|||
};
|
||||
|
||||
return (
|
||||
<Column icon='cog' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='cog' heading={intl.formatMessage(messages.heading)}>
|
||||
<SimpleForm>
|
||||
<FieldsGroup>
|
||||
<SelectDropdown
|
||||
|
|
|
@ -51,7 +51,7 @@ class ScheduledStatuses extends ImmutablePureComponent {
|
|||
const emptyMessage = <FormattedMessage id='empty_column.scheduled_statuses' defaultMessage="You don't have any scheduled statuses yet. When you add one, it will show up here." />;
|
||||
|
||||
return (
|
||||
<Column icon='calendar' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='calendar' heading={intl.formatMessage(messages.heading)}>
|
||||
<ScrollableList
|
||||
scrollKey='scheduled_statuses'
|
||||
emptyMessage={emptyMessage}
|
||||
|
|
|
@ -79,7 +79,7 @@ class SecurityForm extends ImmutablePureComponent {
|
|||
const { intl } = this.props;
|
||||
|
||||
return (
|
||||
<Column icon='lock' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='lock' heading={intl.formatMessage(messages.heading)}>
|
||||
<ChangeEmailForm />
|
||||
<ChangePasswordForm />
|
||||
<SetUpMfa />
|
||||
|
|
|
@ -88,7 +88,7 @@ class MfaForm extends ImmutablePureComponent {
|
|||
const { displayOtpForm } = this.state;
|
||||
|
||||
return (
|
||||
<Column icon='lock' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='lock' heading={intl.formatMessage(messages.heading)}>
|
||||
<ColumnSubheading text={intl.formatMessage(messages.subheading)} />
|
||||
{ settings.get('otpEnabled') === true && <DisableOtpForm />}
|
||||
{ settings.get('otpEnabled') === false && <EnableOtpForm handleSetupProceedClick={this.handleSetupProceedClick} />}
|
||||
|
|
|
@ -27,7 +27,7 @@ class ServerInfo extends ImmutablePureComponent {
|
|||
const { intl, instance } = this.props;
|
||||
|
||||
return (
|
||||
<Column icon='info' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='info' heading={intl.formatMessage(messages.heading)}>
|
||||
<div className='info_column_area'>
|
||||
<div className='info__brand'>
|
||||
<div className='brand'>
|
||||
|
|
|
@ -219,7 +219,7 @@ class SoapboxConfig extends ImmutablePureComponent {
|
|||
const soapbox = this.getSoapboxConfig();
|
||||
|
||||
return (
|
||||
<Column icon='cog' heading={intl.formatMessage(messages.heading)} backBtnSlim>
|
||||
<Column icon='cog' heading={intl.formatMessage(messages.heading)}>
|
||||
<SimpleForm onSubmit={this.handleSubmit}>
|
||||
<fieldset disabled={this.state.isLoading}>
|
||||
<SitePreview soapbox={soapbox} />
|
||||
|
|
|
@ -170,7 +170,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
|||
|
||||
{fields.map((pair, i) =>
|
||||
isTicker(pair.get('name', '')) ? (
|
||||
<BundleContainer fetchComponent={CryptoAddress}>
|
||||
<BundleContainer fetchComponent={CryptoAddress} key={i}>
|
||||
{Component => (
|
||||
<Component
|
||||
key={i}
|
||||
|
|
Loading…
Reference in a new issue