]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/compose/components/character_counter.js
1 import React
from 'react';
2 import PropTypes
from 'prop-types';
3 import { length
} from 'stringz';
5 class CharacterCounter
extends React
.PureComponent
{
8 text: PropTypes
.string
.isRequired
,
9 max: PropTypes
.number
.isRequired
,
12 checkRemainingText (diff
) {
14 return <span className
='character-counter character-counter--over'>{diff
}</span
>;
16 return <span className
='character-counter'>{diff
}</span
>;
20 const diff
= this.props
.max
- length(this.props
.text
);
22 return this.checkRemainingText(diff
);
27 export default CharacterCounter
;
This page took 0.081945 seconds and 4 git commands to generate.