Hide empty MessageActionBar
on message edit history dialog (#10447)
* Hide MessageActionBar on message edit history dialog if neither redact nor view source button is rendered inside it Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com> * Revert "Hide MessageActionBar on message edit history dialog if neither redact nor view source button is rendered inside it" This reverts commit 247e7d2c8f3a5e2979c93f6a8c31d47d540cc186. * Iterate - Hide MessageActionBar on message edit history dialog if neither redact nor view source button is rendered inside it Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com> * Feedback --------- Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This commit is contained in:
parent
d9d53870e3
commit
8779219727
1 changed files with 13 additions and 8 deletions
|
@ -129,7 +129,7 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
|
||||||
this.tooltipifyLinks();
|
this.tooltipifyLinks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderActionBar(): JSX.Element {
|
private renderActionBar(): React.ReactNode {
|
||||||
// hide the button when already redacted
|
// hide the button when already redacted
|
||||||
let redactButton: JSX.Element | undefined;
|
let redactButton: JSX.Element | undefined;
|
||||||
if (!this.props.mxEvent.isRedacted() && !this.props.isBaseEvent && this.state.canRedact) {
|
if (!this.props.mxEvent.isRedacted() && !this.props.isBaseEvent && this.state.canRedact) {
|
||||||
|
@ -143,13 +143,18 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// disabled remove button when not allowed
|
if (!redactButton && !viewSourceButton) {
|
||||||
return (
|
// Hide the empty MessageActionBar
|
||||||
<div className="mx_MessageActionBar">
|
return null;
|
||||||
{redactButton}
|
} else {
|
||||||
{viewSourceButton}
|
// disabled remove button when not allowed
|
||||||
</div>
|
return (
|
||||||
);
|
<div className="mx_MessageActionBar">
|
||||||
|
{redactButton}
|
||||||
|
{viewSourceButton}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue