gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/app/assets/javascripts/components/features/ui/components/character_counter.jsx

25 lines
474 B
JavaScript

import PureRenderMixin from 'react-addons-pure-render-mixin';
const CharacterCounter = React.createClass({
propTypes: {
text: React.PropTypes.string.isRequired,
max: React.PropTypes.number.isRequired
},
mixins: [PureRenderMixin],
render () {
const diff = this.props.max - this.props.text.length;
return (
<span style={{ fontSize: '16px', cursor: 'default' }}>
{diff}
</span>
);
}
});
export default CharacterCounter;