From 23bd96cddec5c088ebf5aa4a5e39759146de8c12 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 21 Mar 2024 11:54:02 +0000 Subject: [PATCH] Copy from PR feedback + use strong tags --- src/components/structures/MatrixChat.tsx | 11 ++++++++--- src/i18n/strings/en_EN.json | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index eedf6ccbe9..4ce1b3e7d6 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1214,11 +1214,15 @@ export default class MatrixChat extends React.PureComponent { maxUserLevel === currentUserLevel && userLevelValues.lastIndexOf(maxUserLevel) == userLevelValues.indexOf(maxUserLevel) ) { + const warning = + maxUserLevel >= 100 + ? _t("leave_room_dialog|room_leave_admin_warning") + : _t("leave_room_dialog|room_leave_mod_warning"); warnings.push( - + {" " /* Whitespace, otherwise the sentences get smashed together */} - {_t("leave_room_dialog|room_leave_admin_warning")} - , + {warning} + , ); } } @@ -1248,6 +1252,7 @@ export default class MatrixChat extends React.PureComponent { ), button: _t("action|leave"), + danger: warnings.length > 0, onFinished: async (shouldLeave) => { if (shouldLeave) { await leaveRoomBehaviour(cli, roomId); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index be9c4279a9..7ee1e351bc 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1524,7 +1524,8 @@ "leave_room_question": "Are you sure you want to leave the room '%(roomName)s'?", "leave_space_question": "Are you sure you want to leave the space '%(spaceName)s'?", "room_rejoin_warning": "This room is not public. You will not be able to rejoin without an invite.", - "room_leave_admin_warning": "You are the sole person with the highest role in this room. If you leave, the room could become unmoderable. Consider giving another user your role.", + "room_leave_admin_warning": "You're the only administrator in this room. If you leave, nobody will be able to change room settings or take other important actions.", + "room_leave_mod_warning": "You're the only moderator in this room. If you leave, nobody will be able to change room settings or take other important actions.", "space_rejoin_warning": "This space is not public. You will not be able to rejoin without an invite." }, "left_panel": {