[Glitch] Fix some React warnings
Port 152b10b624
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
main-unfiltered
parent
b6b68b44a1
commit
def58f8ac3
|
@ -110,10 +110,10 @@ class Results extends PureComponent {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='account__section-headline'>
|
<div className='account__section-headline'>
|
||||||
<button onClick={this.handleSelectAll} className={type === 'all' && 'active'}><FormattedMessage id='search_results.all' defaultMessage='All' /></button>
|
<button onClick={this.handleSelectAll} className={type === 'all' ? 'active' : undefined}><FormattedMessage id='search_results.all' defaultMessage='All' /></button>
|
||||||
<button onClick={this.handleSelectAccounts} className={type === 'accounts' && 'active'}><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></button>
|
<button onClick={this.handleSelectAccounts} className={type === 'accounts' ? 'active' : undefined}><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></button>
|
||||||
<button onClick={this.handleSelectHashtags} className={type === 'hashtags' && 'active'}><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></button>
|
<button onClick={this.handleSelectHashtags} className={type === 'hashtags' ? 'active' : undefined}><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></button>
|
||||||
<button onClick={this.handleSelectStatuses} className={type === 'statuses' && 'active'}><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></button>
|
<button onClick={this.handleSelectStatuses} className={type === 'statuses' ? 'active' : undefined}><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='explore__search-results'>
|
<div className='explore__search-results'>
|
||||||
|
|
|
@ -595,7 +595,7 @@ class Status extends ImmutablePureComponent {
|
||||||
onMoveUp={this.handleMoveUp}
|
onMoveUp={this.handleMoveUp}
|
||||||
onMoveDown={this.handleMoveDown}
|
onMoveDown={this.handleMoveDown}
|
||||||
contextType='thread'
|
contextType='thread'
|
||||||
previousId={i > 0 && list.get(i - 1)}
|
previousId={i > 0 ? list.get(i - 1) : undefined}
|
||||||
nextId={list.get(i + 1) || (ancestors && statusId)}
|
nextId={list.get(i + 1) || (ancestors && statusId)}
|
||||||
rootId={statusId}
|
rootId={statusId}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -126,7 +126,10 @@ export default class ModalRoot extends PureComponent {
|
||||||
{visible && (
|
{visible && (
|
||||||
<>
|
<>
|
||||||
<BundleContainer fetchComponent={MODAL_COMPONENTS[type]} loading={this.renderLoading(type)} error={this.renderError} renderDelay={200}>
|
<BundleContainer fetchComponent={MODAL_COMPONENTS[type]} loading={this.renderLoading(type)} error={this.renderError} renderDelay={200}>
|
||||||
{(SpecificComponent) => <SpecificComponent {...props} onChangeBackgroundColor={this.setBackgroundColor} onClose={this.handleClose} ref={this.setModalRef} />}
|
{(SpecificComponent) => {
|
||||||
|
const ref = typeof SpecificComponent !== 'function' ? this.setModalRef : undefined;
|
||||||
|
return <SpecificComponent {...props} onChangeBackgroundColor={this.setBackgroundColor} onClose={this.handleClose} ref={ref} />
|
||||||
|
}}
|
||||||
</BundleContainer>
|
</BundleContainer>
|
||||||
|
|
||||||
<Helmet>
|
<Helmet>
|
||||||
|
|
Loading…
Reference in New Issue