pull/679/head
Ryan Tharp 5 years ago
parent b100205730
commit 37f4b8e8ed

@ -89,23 +89,24 @@ export class UpdateGroupDialog extends React.Component<Props, State> {
public render() {
const checkMarkedCount = this.getMemberCount(this.state.friendList);
let titleText = `${this.props.titleText} (Members: ${checkMarkedCount})`;
const okText = this.props.okText;
const cancelText = this.props.cancelText;
let noFriendsClasses =
this.state.friendList.length === 0
? 'no-friends'
: classNames('no-friends', 'hidden');
let titleText;
let noFriendsClasses;
// alternatively, we can go back to const and use more trinary operators
// but this looks cleaner/more organized to me
if (this.props.isPublic) {
// remove member count from title
// no member count in title
titleText = `${this.props.titleText}`;
// hide the no-friend message
noFriendsClasses = classNames('no-friends', 'hidden');
} else {
// private group
titleText = `${this.props.titleText} (Members: ${checkMarkedCount})`;
noFriendsClasses =
this.state.friendList.length === 0
? 'no-friends'
: classNames('no-friends', 'hidden');
}
const errorMsg = this.state.errorMessage;

Loading…
Cancel
Save