Add fallback warning

This commit is contained in:
Michael Telatynski 2021-09-17 16:02:12 +01:00
parent 1858c63c4a
commit d615952337
3 changed files with 22 additions and 0 deletions

View file

@ -27,6 +27,7 @@ interface IProps extends Omit<BaseProps, "groupMember" | "matrixClient" | "child
allLabel: string;
specificLabel: string;
noneLabel?: string;
warningMessage?: string;
onFinished(success: boolean, reason?: string, rooms?: Room[]): void;
spaceChildFilter?(child: Room): boolean;
}
@ -37,6 +38,7 @@ const ConfirmSpaceUserActionDialog: React.FC<IProps> = ({
allLabel,
specificLabel,
noneLabel,
warningMessage,
onFinished,
...props
}) => {
@ -59,6 +61,10 @@ const ConfirmSpaceUserActionDialog: React.FC<IProps> = ({
SpaceName: () => <b>{ space.name }</b>,
}) }
</div>;
} else if (warningMessage) {
warning = <div className="mx_ConfirmSpaceUserActionDialog_warning">
{ warningMessage }
</div>;
}
return (

View file

@ -561,6 +561,10 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBas
},
allLabel: _t("Kick them from everything I'm able to"),
specificLabel: _t("Kick them from specific things I'm able to"),
warningMessage: _t("If you're not an admin of a room or space in <SpaceName/>, " +
"they'll still be able to access it after you kick them.", {}, {
SpaceName: () => <b>{ room.name }</b>,
}),
},
room.isSpaceRoom() ? "mx_ConfirmSpaceUserActionDialog_wrapper" : undefined,
);
@ -710,6 +714,15 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
specificLabel: isBanned
? _t("Unban them from specific things I'm able to")
: _t("Ban them from specific things I'm able to"),
warningMessage: isBanned
? _t("If youre not an admin of a room or space in <SpaceName/>, " +
"they wont be unbanned from it.", {}, {
SpaceName: () => <b>{ room.name }</b>,
})
: _t("If you're not an admin of a room or space in <SpaceName/>, " +
"they'll still be able to access it after you ban them.", {}, {
SpaceName: () => <b>{ room.name }</b>,
}),
},
room.isSpaceRoom() ? "mx_ConfirmSpaceUserActionDialog_wrapper" : undefined,
);

View file

@ -1851,6 +1851,7 @@
"Kick this user?": "Kick this user?",
"Kick them from everything I'm able to": "Kick them from everything I'm able to",
"Kick them from specific things I'm able to": "Kick them from specific things I'm able to",
"If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you kick them.": "If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you kick them.",
"Failed to kick": "Failed to kick",
"No recent messages by %(user)s found": "No recent messages by %(user)s found",
"Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.",
@ -1868,6 +1869,8 @@
"Ban them from everything I'm able to": "Ban them from everything I'm able to",
"Unban them from specific things I'm able to": "Unban them from specific things I'm able to",
"Ban them from specific things I'm able to": "Ban them from specific things I'm able to",
"If youre not an admin of a room or space in <SpaceName/>, they wont be unbanned from it.": "If youre not an admin of a room or space in <SpaceName/>, they wont be unbanned from it.",
"If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you ban them.": "If you're not an admin of a room or space in <SpaceName/>, they'll still be able to access it after you ban them.",
"Failed to ban user": "Failed to ban user",
"Failed to mute user": "Failed to mute user",
"Unmute": "Unmute",