Fix some React warnings

main
Thibaut Girka 2019-06-29 10:43:45 +02:00 committed by ThibG
parent 687680f241
commit 82cd138c89
3 changed files with 8 additions and 8 deletions

View File

@ -119,7 +119,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
data-id={id}
tabIndex='0'
style={style}>
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || cachedHeight) })}
{children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })}
</article>
);
}

View File

@ -284,11 +284,11 @@ export default class StatusActionBar extends ImmutablePureComponent {
<div className='status__action-bar'>
{replyButton}
{!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 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='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 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,
<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} />,
<div className='status__action-bar-dropdown'>
<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 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)} />
</div>,
]}

View File

@ -8,7 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
export default class LocalSettingsPageItem extends React.PureComponent {
static propTypes = {
children: PropTypes.element.isRequired,
children: PropTypes.node.isRequired,
dependsOn: PropTypes.array,
dependsOnNot: PropTypes.array,
id: PropTypes.string.isRequired,
@ -63,12 +63,12 @@ export default class LocalSettingsPageItem extends React.PureComponent {
disabled={!enabled}
/>
{opt.message}
{opt.hint && <span class='hint'>{opt.hint}</span>}
{opt.hint && <span className='hint'>{opt.hint}</span>}
</label>
);
});
return (
<div class='glitch local-settings__page__item radio_buttons'>
<div className='glitch local-settings__page__item radio_buttons'>
<fieldset>
<legend>{children}</legend>
{optionElems}