Fix unnecessary whitespace in status without emoji reactions

This commit is contained in:
noellabo 2021-06-05 18:42:24 +09:00
parent e9bd2b1020
commit 60c13a4cb0

View file

@ -1,4 +1,4 @@
import React from 'react'; import React, { Fragment } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component'; import ImmutablePureComponent from 'react-immutable-pure-component';
@ -86,10 +86,14 @@ export default class EmojiReactionsBar extends ImmutablePureComponent {
style: { scale: reduceMotion ? 1 : spring(1, { stiffness: 150, damping: 13 }) }, style: { scale: reduceMotion ? 1 : spring(1, { stiffness: 150, damping: 13 }) },
})).toArray(); })).toArray();
if (visibleReactions.isEmpty() ) {
return <Fragment></Fragment>;
}
return ( return (
<TransitionMotion styles={styles} willEnter={this.willEnter} willLeave={this.willLeave}> <TransitionMotion styles={styles} willEnter={this.willEnter} willLeave={this.willLeave}>
{items => ( {items => (
<div className={classNames('reactions-bar', { 'reactions-bar--empty': visibleReactions.isEmpty() })}> <div className='reactions-bar'>
{items.map(({ key, data, style }) => ( {items.map(({ key, data, style }) => (
<EmojiReaction <EmojiReaction
key={key} key={key}