From 8239c68cf323e4bb20007d2b456336becead273d Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Thu, 25 Feb 2016 12:32:46 -0500 Subject: Refactor and modularize analytics on the client --- web/react/components/analytics/statistic_count.jsx | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 web/react/components/analytics/statistic_count.jsx (limited to 'web/react/components/analytics/statistic_count.jsx') diff --git a/web/react/components/analytics/statistic_count.jsx b/web/react/components/analytics/statistic_count.jsx new file mode 100644 index 000000000..cf457310f --- /dev/null +++ b/web/react/components/analytics/statistic_count.jsx @@ -0,0 +1,33 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import {FormattedMessage} from 'mm-intl'; + +export default class StatisticCount extends React.Component { + render() { + let loading = ( + + ); + + return ( +
+
+
+ {this.props.title} + +
+
{this.props.count == null ? loading : this.props.count}
+
+
+ ); + } +} + +StatisticCount.propTypes = { + title: React.PropTypes.node.isRequired, + icon: React.PropTypes.string.isRequired, + count: React.PropTypes.number +}; -- cgit v1.2.3-1-g7c22