From f64ef65f976829093bbad975dbf4764af728e45d Mon Sep 17 00:00:00 2001 From: Jorik Schellekens Date: Tue, 28 Jul 2020 17:13:58 +0100 Subject: [PATCH] Use StyledRadioGroup --- res/css/views/rooms/_MessageComposer.scss | 8 ++ res/img/icon_copy_message.svg | 86 ------------- .../context_menu/ContextMenuTooltipButton.tsx | 1 - .../views/elements/StyledRadioGroup.tsx | 3 +- src/components/views/rooms/MessageComposer.js | 4 +- src/components/views/rooms/Stickerpicker.js | 2 +- .../tabs/room/SecurityRoomSettingsTab.js | 115 +++++++++--------- 7 files changed, 72 insertions(+), 147 deletions(-) delete mode 100644 res/img/icon_copy_message.svg diff --git a/res/css/views/rooms/_MessageComposer.scss b/res/css/views/rooms/_MessageComposer.scss index 3a94ee02b0..a403a8dc4c 100644 --- a/res/css/views/rooms/_MessageComposer.scss +++ b/res/css/views/rooms/_MessageComposer.scss @@ -179,6 +179,14 @@ limitations under the License. color: $accent-color; } +.mx_MessageComposer_button_highlight { + background: rgba($accent-color, 0.25); + // make the icon the accent color too + &::before { + background-color: $accent-color !important; + } +} + .mx_MessageComposer_button { position: relative; margin-right: 6px; diff --git a/res/img/icon_copy_message.svg b/res/img/icon_copy_message.svg deleted file mode 100644 index 8d8887bb22..0000000000 --- a/res/img/icon_copy_message.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - image/svg+xml - - ED5D3E59-2561-4AC1-9B43-82FBC51767FC - - - - - - ED5D3E59-2561-4AC1-9B43-82FBC51767FC - Created with sketchtool. - - - - - - - - - diff --git a/src/accessibility/context_menu/ContextMenuTooltipButton.tsx b/src/accessibility/context_menu/ContextMenuTooltipButton.tsx index 5dc40714ed..abc5412100 100644 --- a/src/accessibility/context_menu/ContextMenuTooltipButton.tsx +++ b/src/accessibility/context_menu/ContextMenuTooltipButton.tsx @@ -25,7 +25,6 @@ interface IProps extends React.ComponentProps { isExpanded: boolean; } -// TODO: replace this the header buttons and the right panel buttons with a single representation // Semantic component for representing the AccessibleButton which launches a export const ContextMenuTooltipButton: React.FC = ({ isExpanded, diff --git a/src/components/views/elements/StyledRadioGroup.tsx b/src/components/views/elements/StyledRadioGroup.tsx index ea8f65d12b..4db627e83e 100644 --- a/src/components/views/elements/StyledRadioGroup.tsx +++ b/src/components/views/elements/StyledRadioGroup.tsx @@ -25,6 +25,7 @@ interface IDefinition { disabled?: boolean; label: React.ReactChild; description?: React.ReactChild; + checked?: boolean; // If provided it will override the value comparison done in the group } interface IProps { @@ -46,7 +47,7 @@ function StyledRadioGroup({name, definitions, value, className { "mx_MessageComposer_button", "mx_MessageComposer_emoji", { - "mx_RightPanel_headerButton_highlight": menuDisplayed, + "mx_MessageComposer_button_highlight": menuDisplayed, }, ); + // TODO: replace ContextMenuTooltipButton with a unified representation of + // the header buttons and the right panel buttons return {guestWarning} {aliasWarning} - - {_t('Only people who have been invited')} - - - {_t('Anyone who knows the room\'s link, apart from guests')} - - - {_t("Anyone who knows the room's link, including guests")} - + ); } @@ -298,38 +301,36 @@ export default class SecurityRoomSettingsTab extends React.Component { {_t('Changes to who can read history will only apply to future messages in this room. ' + 'The visibility of existing history will be unchanged.')} - - {_t("Anyone")} - - - {_t('Members only (since the point in time of selecting this option)')} - - - {_t('Members only (since they were invited)')} - - - {_t('Members only (since they joined)')} - + ); }