From 4292381202b27bca89c121e4d9d0dd166089225d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Feb 2022 10:33:36 +0000 Subject: [PATCH] Fix layout inconsistencies with the room search minimized button (#7824) --- res/css/structures/_RoomSearch.scss | 11 +++++--- src/components/structures/RoomSearch.tsx | 34 +++++++++++------------- src/i18n/strings/en_EN.json | 2 +- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/res/css/structures/_RoomSearch.scss b/res/css/structures/_RoomSearch.scss index e1902dca17..b3679ca05b 100644 --- a/res/css/structures/_RoomSearch.scss +++ b/res/css/structures/_RoomSearch.scss @@ -97,12 +97,15 @@ limitations under the License. } &.mx_RoomSearch_minimized { - height: auto; - width: auto; - padding: 5px; + height: 32px; + min-height: 32px; + width: 32px; + box-sizing: border-box; .mx_RoomSearch_icon { - margin-left: 0; + margin: 0 auto; + padding: 1px; + align-self: center; } &:hover { diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 80b50245dd..c7854c7453 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -188,7 +188,7 @@ export default class RoomSearch extends React.PureComponent { 'mx_RoomSearch_inputExpanded': this.state.query || this.state.focused, }); - let icon = ( + const icon = (
); @@ -207,29 +207,12 @@ export default class RoomSearch extends React.PureComponent { /> ); - let clearButton = ( - - ); - let shortcutPrompt =
{ isMac ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K" }
; if (this.props.isMinimized) { - icon = ( - - ); input = null; - clearButton = null; shortcutPrompt = null; } @@ -241,6 +224,14 @@ export default class RoomSearch extends React.PureComponent {
} { shortcutPrompt } ; + } else if (this.props.isMinimized) { + return + { icon } + ; } return ( @@ -248,7 +239,12 @@ export default class RoomSearch extends React.PureComponent { { icon } { input } { shortcutPrompt } - { clearButton } + ); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 68ebbf3649..357982a09c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -3100,8 +3100,8 @@ "If you can't find the room you're looking for, ask for an invite or Create a new room.": "If you can't find the room you're looking for, ask for an invite or Create a new room.", "Explore rooms in %(communityName)s": "Explore rooms in %(communityName)s", "Filter": "Filter", - "Clear filter": "Clear filter", "Filter rooms and people": "Filter rooms and people", + "Clear filter": "Clear filter", "You can't send any messages until you review and agree to our terms and conditions.": "You can't send any messages until you review and agree to our terms and conditions.", "Your message wasn't sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.": "Your message wasn't sent because this homeserver has hit its Monthly Active User Limit. Please contact your service administrator to continue using the service.", "Your message wasn't sent because this homeserver has been blocked by it's administrator. Please contact your service administrator to continue using the service.": "Your message wasn't sent because this homeserver has been blocked by it's administrator. Please contact your service administrator to continue using the service.",