Fix pluralization in FollowUsers component (#7928) [deploy]
This commit is contained in:
parent
b1de4cb1cf
commit
3b9fe2658e
1 changed files with 11 additions and 5 deletions
|
|
@ -115,15 +115,21 @@ class FollowUsers extends Component {
|
|||
|
||||
renderFollowToggle() {
|
||||
const { users, selectedUsers } = this.state;
|
||||
if (users.length === 0) {
|
||||
return '';
|
||||
let followText = '';
|
||||
|
||||
if (selectedUsers.length !== users.length) {
|
||||
if (users.length === 1) {
|
||||
followText = `Select ${users.length} person`;
|
||||
} else {
|
||||
followText = `Select all ${users.length} people`;
|
||||
}
|
||||
} else {
|
||||
followText = 'Deselect all';
|
||||
}
|
||||
|
||||
return (
|
||||
<button type="button" onClick={() => this.handleSelectAll()}>
|
||||
{selectedUsers.length !== users.length
|
||||
? `Select all ${users.length} people`
|
||||
: 'Deselect all'}
|
||||
{followText}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue