Fix some React warnings
This commit is contained in:
parent
687680f241
commit
82cd138c89
|
@ -119,7 +119,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
|
||||||
data-id={id}
|
data-id={id}
|
||||||
tabIndex='0'
|
tabIndex='0'
|
||||||
style={style}>
|
style={style}>
|
||||||
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || cachedHeight) })}
|
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })}
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,11 +284,11 @@ export default class StatusActionBar extends ImmutablePureComponent {
|
||||||
<div className='status__action-bar'>
|
<div className='status__action-bar'>
|
||||||
{replyButton}
|
{replyButton}
|
||||||
{!directMessage && [
|
{!directMessage && [
|
||||||
<IconButton className='status__action-bar-button' disabled={reblogDisabled} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogDisabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(reblogMessage)} icon={reblogIcon} onClick={this.handleReblogClick} />,
|
<IconButton key='reblog-button' className='status__action-bar-button' disabled={reblogDisabled} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogDisabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(reblogMessage)} icon={reblogIcon} onClick={this.handleReblogClick} />,
|
||||||
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />,
|
<IconButton key='favourite-button' className='status__action-bar-button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} />,
|
||||||
shareButton,
|
shareButton,
|
||||||
<IconButton className='status__action-bar-button bookmark-icon' disabled={anonymousAccess} active={status.get('bookmarked')} pressed={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} />,
|
<IconButton key='bookmark-button' className='status__action-bar-button bookmark-icon' disabled={anonymousAccess} active={status.get('bookmarked')} pressed={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} />,
|
||||||
<div className='status__action-bar-dropdown'>
|
<div key='dropdown-button' className='status__action-bar-dropdown'>
|
||||||
<DropdownMenuContainer disabled={anonymousAccess} status={status} items={menu} icon='ellipsis-h' size={18} direction='right' ariaLabel={intl.formatMessage(messages.more)} />
|
<DropdownMenuContainer disabled={anonymousAccess} status={status} items={menu} icon='ellipsis-h' size={18} direction='right' ariaLabel={intl.formatMessage(messages.more)} />
|
||||||
</div>,
|
</div>,
|
||||||
]}
|
]}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
export default class LocalSettingsPageItem extends React.PureComponent {
|
export default class LocalSettingsPageItem extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
children: PropTypes.element.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
dependsOn: PropTypes.array,
|
dependsOn: PropTypes.array,
|
||||||
dependsOnNot: PropTypes.array,
|
dependsOnNot: PropTypes.array,
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
|
@ -63,12 +63,12 @@ export default class LocalSettingsPageItem extends React.PureComponent {
|
||||||
disabled={!enabled}
|
disabled={!enabled}
|
||||||
/>
|
/>
|
||||||
{opt.message}
|
{opt.message}
|
||||||
{opt.hint && <span class='hint'>{opt.hint}</span>}
|
{opt.hint && <span className='hint'>{opt.hint}</span>}
|
||||||
</label>
|
</label>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<div class='glitch local-settings__page__item radio_buttons'>
|
<div className='glitch local-settings__page__item radio_buttons'>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{children}</legend>
|
<legend>{children}</legend>
|
||||||
{optionElems}
|
{optionElems}
|
||||||
|
|
Loading…
Reference in New Issue