mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
"Leave {Closed|Open} Group" button depending on group opened
This commit is contained in:
parent
aeaa3b9e5d
commit
d13efafad2
|
@ -2110,6 +2110,14 @@
|
|||
"message": "Leave Group",
|
||||
"description": "Button action that the user can click to leave the group"
|
||||
},
|
||||
"leaveOpenGroup": {
|
||||
"message": "Leave Open Group",
|
||||
"description": "Button action that the user can click to leave the group"
|
||||
},
|
||||
"leaveClosedGroup": {
|
||||
"message": "Leave Closed Group",
|
||||
"description": "Button action that the user can click to leave the group"
|
||||
},
|
||||
"leaveGroupDialogTitle": {
|
||||
"message": "Are you sure you want to leave this group?",
|
||||
"description":
|
||||
|
@ -2226,7 +2234,7 @@
|
|||
"message": "Server URL",
|
||||
"description": "Placeholder for server URL input"
|
||||
},
|
||||
"noServerUrl": {
|
||||
"noServerURL": {
|
||||
"message": "Please enter a server URL",
|
||||
"description": "Error message when no server url entered"
|
||||
},
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
},
|
||||
showCreateGroup() {
|
||||
// TODO: make it impossible to open 2 dialogs as once
|
||||
// Curretnly, if the button is in focus, it is possible to
|
||||
// Currently, if the button is in focus, it is possible to
|
||||
// create a new dialog by pressing 'Enter'
|
||||
const dialog = new Whisper.CreateGroupDialogView();
|
||||
this.el.append(dialog.el);
|
||||
|
|
|
@ -17,6 +17,7 @@ interface Props {
|
|||
description: string;
|
||||
avatarPath: string;
|
||||
timerOptions: Array<TimerOption>;
|
||||
isPublic: boolean;
|
||||
|
||||
onGoBack: () => void;
|
||||
onInviteFriends: () => void;
|
||||
|
@ -183,9 +184,10 @@ export class SessionChannelSettings extends React.Component<Props, any> {
|
|||
}
|
||||
|
||||
public render() {
|
||||
const { memberCount, name, onLeaveGroup } = this.props;
|
||||
const { memberCount, name, onLeaveGroup, isPublic } = this.props;
|
||||
const { documents, media, onItemClick } = this.state;
|
||||
const showMemberCount = !!(memberCount && memberCount > 0);
|
||||
const leaveGroupString = isPublic ? window.i18n('leaveOpenGroup') : window.i18n('leaveClosedGroup');
|
||||
|
||||
return (
|
||||
<div className="group-settings">
|
||||
|
@ -213,7 +215,7 @@ export class SessionChannelSettings extends React.Component<Props, any> {
|
|||
onItemClick={onItemClick}
|
||||
/>
|
||||
<SessionButton
|
||||
text={window.i18n('leaveGroup')}
|
||||
text={leaveGroupString}
|
||||
buttonColor={SessionButtonColor.Danger}
|
||||
buttonType={SessionButtonType.SquareOutline}
|
||||
onClick={onLeaveGroup}
|
||||
|
|
Loading…
Reference in a new issue