Use JSX syntax for Fragments (#25093)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { PureComponent, Fragment } from 'react';
|
||||
import { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { connect } from 'react-redux';
|
||||
@ -65,10 +65,10 @@ class CompareHistoryModal extends PureComponent {
|
||||
<div className='compare-history-modal__container'>
|
||||
<div className='status__content'>
|
||||
{currentVersion.get('spoiler_text').length > 0 && (
|
||||
<Fragment>
|
||||
<>
|
||||
<div className='translate' dangerouslySetInnerHTML={spoilerContent} lang={language} />
|
||||
<hr />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className='status__content__text status__content__text--visible translate' dangerouslySetInnerHTML={content} lang={language} />
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PureComponent, Fragment } from 'react';
|
||||
import { PureComponent } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import PropTypes from 'prop-types';
|
||||
import SearchContainer from 'mastodon/features/compose/containers/search_container';
|
||||
@ -46,17 +46,17 @@ class ComposePanel extends PureComponent {
|
||||
<SearchContainer openInRoute />
|
||||
|
||||
{!signedIn && (
|
||||
<Fragment>
|
||||
<>
|
||||
<ServerBanner />
|
||||
<div className='flex-spacer' />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
{signedIn && (
|
||||
<Fragment>
|
||||
<>
|
||||
<NavigationContainer onClose={this.onBlur} />
|
||||
<ComposeFormContainer singleColumn />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
<LinkFooter />
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PureComponent, Fragment } from 'react';
|
||||
import { PureComponent } from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
@ -315,7 +315,7 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
{focals && <p><FormattedMessage id='upload_modal.hint' defaultMessage='Click or drag the circle on the preview to choose the focal point which will always be in view on all thumbnails.' /></p>}
|
||||
|
||||
{thumbnailable && (
|
||||
<Fragment>
|
||||
<>
|
||||
<label className='setting-text-label' htmlFor='upload-modal__thumbnail'><FormattedMessage id='upload_form.thumbnail' defaultMessage='Change thumbnail' /></label>
|
||||
|
||||
<Button disabled={isUploadingThumbnail || !media.get('unattached')} text={intl.formatMessage(messages.chooseImage)} onClick={this.handleFileInputClick} />
|
||||
@ -335,7 +335,7 @@ class FocalPointModal extends ImmutablePureComponent {
|
||||
</label>
|
||||
|
||||
<hr className='setting-divider' />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
<label className='setting-text-label' htmlFor='upload-modal__description'>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component, Fragment } from 'react';
|
||||
import { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
@ -51,11 +51,11 @@ class NavigationPanel extends Component {
|
||||
</div>
|
||||
|
||||
{signedIn && (
|
||||
<Fragment>
|
||||
<>
|
||||
<ColumnLink transparent to='/home' icon='home' text={intl.formatMessage(messages.home)} />
|
||||
<ColumnLink transparent to='/notifications' icon={<NotificationsCounterIcon className='column-link__icon' />} text={intl.formatMessage(messages.notifications)} />
|
||||
<FollowRequestsColumnLink />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
{showTrends ? (
|
||||
@ -79,7 +79,7 @@ class NavigationPanel extends Component {
|
||||
)}
|
||||
|
||||
{signedIn && (
|
||||
<Fragment>
|
||||
<>
|
||||
<ColumnLink transparent to='/conversations' icon='at' text={intl.formatMessage(messages.direct)} />
|
||||
<ColumnLink transparent to='/bookmarks' icon='bookmark' text={intl.formatMessage(messages.bookmarks)} />
|
||||
<ColumnLink transparent to='/favourites' icon='star' text={intl.formatMessage(messages.favourites)} />
|
||||
@ -90,7 +90,7 @@ class NavigationPanel extends Component {
|
||||
<hr />
|
||||
|
||||
<ColumnLink transparent href='/settings/preferences' icon='cog' text={intl.formatMessage(messages.preferences)} />
|
||||
</Fragment>
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className='navigation-panel__legal'>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PureComponent, Fragment } from 'react';
|
||||
import { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
@ -411,7 +411,7 @@ class ZoomableImage extends PureComponent {
|
||||
const zoomButtonTitle = this.state.zoomState === 'compress' ? intl.formatMessage(messages.compress) : intl.formatMessage(messages.expand);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<>
|
||||
<IconButton
|
||||
className={`media-modal__zoom-button ${zoomButtonShouldHide}`}
|
||||
title={zoomButtonTitle}
|
||||
@ -445,7 +445,7 @@ class ZoomableImage extends PureComponent {
|
||||
onMouseDown={this.handleMouseDown}
|
||||
/>
|
||||
</div>
|
||||
</Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user