Add customisation point for mxid display (#7595)
* add wrapping component for hiding UI Signed-off-by: Kerry Archibald <kerrya@element.io> * add Setting Signed-off-by: Kerry Archibald <kerrya@element.io> * apply setting to profile settings, user menu, invite dialog, userinfo Signed-off-by: Kerry Archibald <kerrya@element.io> * hide mxids in user autocomplete * remove mxids from title in memeber list and timeline Signed-off-by: Kerry Archibald <kerrya@element.io> * hide mxid in ConfirmUserActionDialog Signed-off-by: Kerry Archibald <kerrya@element.io> * use name in power level event message when displayMxids is falsy Signed-off-by: Kerry Archibald <kerrya@element.io> * add customisation point for mxid display Signed-off-by: Kerry Archibald <kerrya@element.io> * use userid customisation Signed-off-by: Kerry Archibald <kerrya@element.io> * use customisation in sender profile Signed-off-by: Kerry Archibald <kerrya@element.io> * hide profile settings mxid if falsy Signed-off-by: Kerry Archibald <kerrya@element.io> * rename and move to components Signed-off-by: Kerry Archibald <kerrya@element.io> * remove change to UIFeature.ts Signed-off-by: Kerry Archibald <kerrya@element.io> * improvements from pr Signed-off-by: Kerry Archibald <kerrya@element.io> * lint fix Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
b481fc069e
commit
502b805164
15 changed files with 154 additions and 23 deletions
|
@ -28,6 +28,7 @@ import BaseAvatar from '../avatars/BaseAvatar';
|
|||
import BaseDialog from "./BaseDialog";
|
||||
import DialogButtons from "../elements/DialogButtons";
|
||||
import Field from '../elements/Field';
|
||||
import UserIdentifierCustomisations from '../../../customisations/UserIdentifier';
|
||||
|
||||
interface IProps {
|
||||
// matrix-js-sdk (room) member object. Supply either this or 'groupMember'
|
||||
|
@ -46,6 +47,7 @@ interface IProps {
|
|||
danger?: boolean;
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
roomId?: string;
|
||||
onFinished: (success: boolean, reason?: string) => void;
|
||||
}
|
||||
|
||||
|
@ -126,6 +128,10 @@ export default class ConfirmUserActionDialog extends React.Component<IProps, ISt
|
|||
avatar = <BaseAvatar name={name} url={httpAvatarUrl} width={48} height={48} />;
|
||||
}
|
||||
|
||||
const displayUserIdentifier = UserIdentifierCustomisations.getDisplayUserIdentifier(
|
||||
userId, { roomId: this.props.roomId, withDisplayName: true },
|
||||
);
|
||||
|
||||
return (
|
||||
<BaseDialog
|
||||
className={classNames("mx_ConfirmUserActionDialog", this.props.className)}
|
||||
|
@ -139,7 +145,7 @@ export default class ConfirmUserActionDialog extends React.Component<IProps, ISt
|
|||
{ avatar }
|
||||
</div>
|
||||
<div className="mx_ConfirmUserActionDialog_name">{ name }</div>
|
||||
<div className="mx_ConfirmUserActionDialog_userId">{ userId }</div>
|
||||
<div className="mx_ConfirmUserActionDialog_userId">{ displayUserIdentifier }</div>
|
||||
</div>
|
||||
|
||||
{ reasonBox }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue