diff --git a/app/components/__snapshots__/fade.test.js.snap b/app/components/__snapshots__/fade.test.js.snap index d576df934..41ef885f1 100644 --- a/app/components/__snapshots__/fade.test.js.snap +++ b/app/components/__snapshots__/fade.test.js.snap @@ -2,6 +2,7 @@ exports[`Fade should render {opacity: 0} 1`] = ` {this.props.children} diff --git a/app/components/sidebars/main/channels_list/list/list.js b/app/components/sidebars/main/channels_list/list/list.js index da9af34b6..39b8238c3 100644 --- a/app/components/sidebars/main/channels_list/list/list.js +++ b/app/components/sidebars/main/channels_list/list/list.js @@ -417,10 +417,10 @@ export default class List extends PureComponent { /> {UnreadIndicator && } diff --git a/app/components/sidebars/main/channels_list/unread_indicator/index.js b/app/components/sidebars/main/channels_list/unread_indicator/index.js index ce095e486..bcbb436da 100644 --- a/app/components/sidebars/main/channels_list/unread_indicator/index.js +++ b/app/components/sidebars/main/channels_list/unread_indicator/index.js @@ -16,7 +16,7 @@ import {makeStyleSheetFromTheme} from 'app/utils/theme'; export default class UnreadIndicator extends PureComponent { static propTypes = { - show: PropTypes.bool, + visible: PropTypes.bool, style: ViewPropTypes.style, onPress: PropTypes.func, theme: PropTypes.object.isRequired, @@ -27,31 +27,52 @@ export default class UnreadIndicator extends PureComponent { onPress: () => true, }; - render() { - const {onPress, show, theme} = this.props; + renderContent = () => { + const {onPress, visible, theme} = this.props; const style = getStyleSheet(theme); + + const content = ( + + + + + ); + + if (visible) { + return ( + + {content} + + ); + } + + return content; + }; + + render() { + const {visible, theme} = this.props; + const style = getStyleSheet(theme); + return ( - - - - - - + {this.renderContent()} ); }