From f023bcfd63e4f00a493397729950d3014f121b7b Mon Sep 17 00:00:00 2001 From: rtestard Date: Tue, 4 Feb 2020 15:05:26 +0100 Subject: [PATCH 1/4] I have modified padlocks styling when the left panel is collapsed --- res/css/views/rooms/_InviteOnlyIcon.scss | 44 ++++++++++++++------ src/components/views/rooms/InviteOnlyIcon.js | 4 +- src/components/views/rooms/RoomTile.js | 2 +- 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/res/css/views/rooms/_InviteOnlyIcon.scss b/res/css/views/rooms/_InviteOnlyIcon.scss index 6943d1797b..21ab431973 100644 --- a/res/css/views/rooms/_InviteOnlyIcon.scss +++ b/res/css/views/rooms/_InviteOnlyIcon.scss @@ -14,27 +14,45 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_InviteOnlyIcon { +@define-mixin mx_InviteOnlyIcon { width: 12px; height: 12px; position: relative; display: block !important; - // Align the padlock with unencrypted room names +} + +@define-mixin mx_InviteOnlyIcon_padlock { + background-color: $roomtile-name-color; + mask-image: url("$(res)/img/feather-customised/lock-solid.svg"); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +.mx_InviteOnlyIcon_large { + @mixin mx_InviteOnlyIcon; margin: 0 4px; &::before { - background-color: $roomtile-name-color; - mask-image: url('$(res)/img/feather-customised/lock-solid.svg'); - mask-position: center; - mask-repeat: no-repeat; - mask-size: contain; - content: ''; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; + @mixin mx_InviteOnlyIcon_padlock; width: 12px; height: 12px; } } + +.mx_InviteOnlyIcon_small { + @mixin mx_InviteOnlyIcon; + left: -2px; + + &::before { + @mixin mx_InviteOnlyIcon_padlock; + width: 10px; + height: 10px; + } +} \ No newline at end of file diff --git a/src/components/views/rooms/InviteOnlyIcon.js b/src/components/views/rooms/InviteOnlyIcon.js index 07156b2973..7ca63c8898 100644 --- a/src/components/views/rooms/InviteOnlyIcon.js +++ b/src/components/views/rooms/InviteOnlyIcon.js @@ -37,6 +37,8 @@ export default class InviteOnlyIcon extends React.Component { }; render() { + const style = this.props.collapsedPanel ? "mx_InviteOnlyIcon_small": "mx_InviteOnlyIcon_large"; + if (!SettingsStore.isFeatureEnabled("feature_invite_only_padlocks")) { return null; } @@ -46,7 +48,7 @@ export default class InviteOnlyIcon extends React.Component { if (this.state.hover) { tooltip = ; } - return (
diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 41d43476ea..bc781788c0 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -526,7 +526,7 @@ export default createReactClass({ let privateIcon = null; if (SettingsStore.isFeatureEnabled("feature_cross_signing")) { if (this.state.joinRule == "invite" && !dmUserId) { - privateIcon = ; + privateIcon = ; } } From 153703426a96568874f7fc169459c6cfc3b098a3 Mon Sep 17 00:00:00 2001 From: rtestard Date: Tue, 4 Feb 2020 16:02:49 +0100 Subject: [PATCH 2/4] I have removed the newline at the end of file to pass tests --- res/css/views/rooms/_InviteOnlyIcon.scss | 58 ++++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/res/css/views/rooms/_InviteOnlyIcon.scss b/res/css/views/rooms/_InviteOnlyIcon.scss index 21ab431973..0bc3f30c48 100644 --- a/res/css/views/rooms/_InviteOnlyIcon.scss +++ b/res/css/views/rooms/_InviteOnlyIcon.scss @@ -15,44 +15,44 @@ limitations under the License. */ @define-mixin mx_InviteOnlyIcon { - width: 12px; - height: 12px; - position: relative; - display: block !important; + width: 12px; + height: 12px; + position: relative; + display: block !important; } @define-mixin mx_InviteOnlyIcon_padlock { - background-color: $roomtile-name-color; - mask-image: url("$(res)/img/feather-customised/lock-solid.svg"); - mask-position: center; - mask-repeat: no-repeat; - mask-size: contain; - content: ""; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; + background-color: $roomtile-name-color; + mask-image: url("$(res)/img/feather-customised/lock-solid.svg"); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; } .mx_InviteOnlyIcon_large { - @mixin mx_InviteOnlyIcon; - margin: 0 4px; + @mixin mx_InviteOnlyIcon; + margin: 0 4px; - &::before { - @mixin mx_InviteOnlyIcon_padlock; - width: 12px; - height: 12px; - } + &::before { + @mixin mx_InviteOnlyIcon_padlock; + width: 12px; + height: 12px; + } } .mx_InviteOnlyIcon_small { - @mixin mx_InviteOnlyIcon; - left: -2px; + @mixin mx_InviteOnlyIcon; + left: -2px; - &::before { - @mixin mx_InviteOnlyIcon_padlock; - width: 10px; - height: 10px; - } + &::before { + @mixin mx_InviteOnlyIcon_padlock; + width: 10px; + height: 10px; + } } \ No newline at end of file From 06ba55e1a10c299b9564c66a6bb94b0784756957 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Feb 2020 15:05:08 +0100 Subject: [PATCH 3/4] I have made changes according to turt2live recommandations, mainly css indentation and variable definition --- res/css/views/rooms/_InviteOnlyIcon.scss | 58 ++++++++++---------- src/components/views/rooms/InviteOnlyIcon.js | 4 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/res/css/views/rooms/_InviteOnlyIcon.scss b/res/css/views/rooms/_InviteOnlyIcon.scss index 0bc3f30c48..21ab431973 100644 --- a/res/css/views/rooms/_InviteOnlyIcon.scss +++ b/res/css/views/rooms/_InviteOnlyIcon.scss @@ -15,44 +15,44 @@ limitations under the License. */ @define-mixin mx_InviteOnlyIcon { - width: 12px; - height: 12px; - position: relative; - display: block !important; + width: 12px; + height: 12px; + position: relative; + display: block !important; } @define-mixin mx_InviteOnlyIcon_padlock { - background-color: $roomtile-name-color; - mask-image: url("$(res)/img/feather-customised/lock-solid.svg"); - mask-position: center; - mask-repeat: no-repeat; - mask-size: contain; - content: ""; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; + background-color: $roomtile-name-color; + mask-image: url("$(res)/img/feather-customised/lock-solid.svg"); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; } .mx_InviteOnlyIcon_large { - @mixin mx_InviteOnlyIcon; - margin: 0 4px; + @mixin mx_InviteOnlyIcon; + margin: 0 4px; - &::before { - @mixin mx_InviteOnlyIcon_padlock; - width: 12px; - height: 12px; - } + &::before { + @mixin mx_InviteOnlyIcon_padlock; + width: 12px; + height: 12px; + } } .mx_InviteOnlyIcon_small { - @mixin mx_InviteOnlyIcon; - left: -2px; + @mixin mx_InviteOnlyIcon; + left: -2px; - &::before { - @mixin mx_InviteOnlyIcon_padlock; - width: 10px; - height: 10px; - } + &::before { + @mixin mx_InviteOnlyIcon_padlock; + width: 10px; + height: 10px; + } } \ No newline at end of file diff --git a/src/components/views/rooms/InviteOnlyIcon.js b/src/components/views/rooms/InviteOnlyIcon.js index 7ca63c8898..acaa12303b 100644 --- a/src/components/views/rooms/InviteOnlyIcon.js +++ b/src/components/views/rooms/InviteOnlyIcon.js @@ -37,7 +37,7 @@ export default class InviteOnlyIcon extends React.Component { }; render() { - const style = this.props.collapsedPanel ? "mx_InviteOnlyIcon_small": "mx_InviteOnlyIcon_large"; + const classes = this.props.collapsedPanel ? "mx_InviteOnlyIcon_small": "mx_InviteOnlyIcon_large"; if (!SettingsStore.isFeatureEnabled("feature_invite_only_padlocks")) { return null; @@ -48,7 +48,7 @@ export default class InviteOnlyIcon extends React.Component { if (this.state.hover) { tooltip = ; } - return (
From 650f412acb1d6097596118ee578f5053acb0d235 Mon Sep 17 00:00:00 2001 From: rtestard Date: Wed, 19 Feb 2020 10:15:58 +0100 Subject: [PATCH 4/4] I have added a new line at the end of the scss file --- res/css/views/rooms/_InviteOnlyIcon.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/rooms/_InviteOnlyIcon.scss b/res/css/views/rooms/_InviteOnlyIcon.scss index 21ab431973..b71fd6348d 100644 --- a/res/css/views/rooms/_InviteOnlyIcon.scss +++ b/res/css/views/rooms/_InviteOnlyIcon.scss @@ -55,4 +55,4 @@ limitations under the License. width: 10px; height: 10px; } -} \ No newline at end of file +}