From acf2fb64b49fea49774d31ab78b755fed43ae27f Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 16 Sep 2015 14:53:16 -0400 Subject: Cleaned up logic for the unread indicators --- web/react/components/unread_channel_indicator.jsx | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 web/react/components/unread_channel_indicator.jsx (limited to 'web/react/components/unread_channel_indicator.jsx') diff --git a/web/react/components/unread_channel_indicator.jsx b/web/react/components/unread_channel_indicator.jsx new file mode 100644 index 000000000..12a67633e --- /dev/null +++ b/web/react/components/unread_channel_indicator.jsx @@ -0,0 +1,35 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +// Indicator for the left sidebar which indicate if there's unread posts in a channel that is not shown +// because it is either above or below the screen +export default class UnreadChannelIndicator extends React.Component { + constructor(props) { + super(props); + } + render() { + let displayValue = 'none'; + if (this.props.show) { + displayValue = 'initial'; + } + return ( +
+ {this.props.text} +
+ ); + } +} + +UnreadChannelIndicator.defaultProps = { + show: false, + extraClass: '', + text: '' +}; +UnreadChannelIndicator.propTypes = { + show: React.PropTypes.bool, + extraClass: React.PropTypes.string, + text: React.PropTypes.string +}; -- cgit v1.2.3-1-g7c22