Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Hide empty MessageActionBar on message edit history dialog #10447

Merged
merged 6 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions res/css/views/dialogs/_MessageEditHistoryDialog.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,20 @@ limitations under the License.
}
}

.mx_MessageActionBar .mx_AccessibleButton {
display: flex;
align-items: center;
.mx_MessageActionBar {
&.mx_MessageActionBar--noButton {
/* Hide if neither redact nor view source button is rendered inside it */
display: none;
}

.mx_AccessibleButton {
display: flex;
align-items: center;

padding-inline-start: $spacing-8;
padding-inline-end: $spacing-8;
padding-inline-start: $spacing-8;
padding-inline-end: $spacing-8;

font-size: $font-15px;
font-size: $font-15px;
}
}
}
6 changes: 5 additions & 1 deletion src/components/views/messages/EditHistoryMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
);
}

const classes = classNames("mx_MessageActionBar", {
"mx_MessageActionBar--noButton": !SettingsStore.getValue("developerMode") && !redactButton,
});

robintown marked this conversation as resolved.
Show resolved Hide resolved
// disabled remove button when not allowed
return (
<div className="mx_MessageActionBar">
<div className={classes}>
{redactButton}
{viewSourceButton}
</div>
Expand Down