mirror of https://github.com/vector-im/riot-web
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>t3chguy/dedup-icons-17oct
parent
d9d53870e3
commit
8779219727
|
@ -129,7 +129,7 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
|
|||
this.tooltipifyLinks();
|
||||
}
|
||||
|
||||
private renderActionBar(): JSX.Element {
|
||||
private renderActionBar(): React.ReactNode {
|
||||
// hide the button when already redacted
|
||||
let redactButton: JSX.Element | undefined;
|
||||
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
|
||||
return (
|
||||
<div className="mx_MessageActionBar">
|
||||
{redactButton}
|
||||
{viewSourceButton}
|
||||
</div>
|
||||
);
|
||||
if (!redactButton && !viewSourceButton) {
|
||||
// Hide the empty MessageActionBar
|
||||
return null;
|
||||
} else {
|
||||
// disabled remove button when not allowed
|
||||
return (
|
||||
<div className="mx_MessageActionBar">
|
||||
{redactButton}
|
||||
{viewSourceButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public render(): React.ReactNode {
|
||||
|
|
Loading…
Reference in New Issue