Copy from PR feedback + use strong tags

This commit is contained in:
David Baker 2024-03-21 11:54:02 +00:00
parent 0fdb300858
commit 23bd96cdde
2 changed files with 10 additions and 4 deletions

View file

@ -1214,11 +1214,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
maxUserLevel === currentUserLevel && maxUserLevel === currentUserLevel &&
userLevelValues.lastIndexOf(maxUserLevel) == userLevelValues.indexOf(maxUserLevel) 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( warnings.push(
<span className="warning" key="last_admin_warning"> <strong className="warning" key="last_admin_warning">
{" " /* Whitespace, otherwise the sentences get smashed together */} {" " /* Whitespace, otherwise the sentences get smashed together */}
{_t("leave_room_dialog|room_leave_admin_warning")} {warning}
</span>, </strong>,
); );
} }
} }
@ -1248,6 +1252,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
</span> </span>
), ),
button: _t("action|leave"), button: _t("action|leave"),
danger: warnings.length > 0,
onFinished: async (shouldLeave) => { onFinished: async (shouldLeave) => {
if (shouldLeave) { if (shouldLeave) {
await leaveRoomBehaviour(cli, roomId); await leaveRoomBehaviour(cli, roomId);

View file

@ -1524,7 +1524,8 @@
"leave_room_question": "Are you sure you want to leave the room '%(roomName)s'?", "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'?", "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_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." "space_rejoin_warning": "This space is not public. You will not be able to rejoin without an invite."
}, },
"left_panel": { "left_panel": {