diff --git a/res/css/_components.pcss b/res/css/_components.pcss index adb30ad1944..f116e45c5e1 100644 --- a/res/css/_components.pcss +++ b/res/css/_components.pcss @@ -20,6 +20,7 @@ @import "./components/views/dialogs/polls/_PollDetailHeader.pcss"; @import "./components/views/dialogs/polls/_PollListItem.pcss"; @import "./components/views/dialogs/polls/_PollListItemEnded.pcss"; +@import "./components/views/elements/_AppPermission.pcss"; @import "./components/views/elements/_FilterDropdown.pcss"; @import "./components/views/elements/_FilterTabGroup.pcss"; @import "./components/views/elements/_LearnMore.pcss"; diff --git a/res/css/components/views/elements/_AppPermission.pcss b/res/css/components/views/elements/_AppPermission.pcss new file mode 100644 index 00000000000..b91ed2b8099 --- /dev/null +++ b/res/css/components/views/elements/_AppPermission.pcss @@ -0,0 +1,77 @@ +/* +Copyright 2015, 2016 OpenMarket Ltd +Copyright 2019 - 2023 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_AppPermission { + > div { + margin-bottom: 12px; + } + + h4 { + margin: 0; + padding: 0; + } + + .mx_AppPermission_smallText { + font-size: $font-12px; + } + + .mx_AppPermission_bolder { + font-weight: var(--font-semi-bold); + } + + .mx_AppPermission_helpIcon { + margin-top: 1px; + margin-right: 2px; + width: 10px; + height: 10px; + display: inline-block; + + &::before { + display: inline-block; + background-color: $accent; + mask-repeat: no-repeat; + mask-size: 12px; + width: 12px; + height: 12px; + mask-position: center; + content: ""; + vertical-align: middle; + mask-image: url("$(res)/img/feather-customised/help-circle.svg"); + } + } + + .mx_AppPermission_tooltip { + box-shadow: none; + background-color: $tooltip-timeline-bg-color; + color: $tooltip-timeline-fg-color; + border: none; + border-radius: 3px; + padding: 6px 8px; + + &.mx_AppPermission_tooltip--dark { + .mx_Tooltip_chevron::after { + border-right-color: $tooltip-timeline-bg-color; + } + } + + ul { + list-style-position: inside; + padding-left: 2px; + margin-left: 0; + } + } +} diff --git a/res/css/structures/_RightPanel.pcss b/res/css/structures/_RightPanel.pcss index f76388296b3..1c34a46e07f 100644 --- a/res/css/structures/_RightPanel.pcss +++ b/res/css/structures/_RightPanel.pcss @@ -82,10 +82,6 @@ limitations under the License. mask-position: center; } -$dot-size: 8px; -$dot-offset: -3px; -$pulse-color: $alert; - .mx_RightPanel_pinnedMessagesButton { &::before { mask-image: url("$(res)/img/element-icons/room/pin.svg"); @@ -95,11 +91,11 @@ $pulse-color: $alert; .mx_RightPanel_headerButton_unreadIndicator_bg { position: absolute; - right: $dot-offset; - top: $dot-offset; + right: var(--RoomHeader-indicator-dot-offset); + top: var(--RoomHeader-indicator-dot-offset); margin: 4px; - width: $dot-size; - height: $dot-size; + width: var(--RoomHeader-indicator-dot-size); + height: var(--RoomHeader-indicator-dot-size); border-radius: 50%; transform: scale(1.6); transform-origin: center center; @@ -108,8 +104,8 @@ $pulse-color: $alert; .mx_RightPanel_headerButton_unreadIndicator { position: absolute; - right: $dot-offset; - top: $dot-offset; + right: var(--RoomHeader-indicator-dot-offset); + top: var(--RoomHeader-indicator-dot-offset); margin: 4px; &.mx_Indicator_red { diff --git a/res/css/structures/_RoomView.pcss b/res/css/structures/_RoomView.pcss index 97f2a505f93..5ddfed21bae 100644 --- a/res/css/structures/_RoomView.pcss +++ b/res/css/structures/_RoomView.pcss @@ -262,12 +262,12 @@ limitations under the License. position: absolute; right: -3px; top: -3px; - width: $dot-size; - height: $dot-size; + width: var(--RoomHeader-indicator-dot-size); + height: var(--RoomHeader-indicator-dot-size); border-radius: 50%; transform: scale(1); - background: rgba($pulse-color, 1); - box-shadow: 0 0 0 0 rgba($pulse-color, 1); + background: rgba(var(--RoomHeader-indicator-pulseColor), 1); + box-shadow: 0 0 0 0 rgba(var(--RoomHeader-indicator-pulseColor), 1); animation: mx_Indicator_pulse 2s infinite; animation-iteration-count: 1; diff --git a/res/css/views/rooms/_AppsDrawer.pcss b/res/css/views/rooms/_AppsDrawer.pcss index 3b9413ef902..6738ed0fa45 100644 --- a/res/css/views/rooms/_AppsDrawer.pcss +++ b/res/css/views/rooms/_AppsDrawer.pcss @@ -318,7 +318,8 @@ limitations under the License. flex: 1; } -.mx_AppPermissionWarning { +.mx_AppWarning, +.mx_AppPermission { text-align: center; display: flex; height: 100%; @@ -333,60 +334,6 @@ limitations under the License. } } -.mx_AppPermissionWarning_row { - margin-bottom: 12px; -} - -.mx_AppPermissionWarning_smallText { - font-size: $font-12px; -} - -.mx_AppPermissionWarning_bolder { - font-weight: var(--font-semi-bold); -} - -.mx_AppPermissionWarning_helpIcon { - margin-top: 1px; - margin-right: 2px; - width: 10px; - height: 10px; - display: inline-block; - - &::before { - display: inline-block; - background-color: $accent; - mask-repeat: no-repeat; - mask-size: 12px; - width: 12px; - height: 12px; - mask-position: center; - content: ""; - vertical-align: middle; - mask-image: url("$(res)/img/feather-customised/help-circle.svg"); - } -} - -.mx_AppPermissionWarning_tooltip { - box-shadow: none; - background-color: $tooltip-timeline-bg-color; - color: $tooltip-timeline-fg-color; - border: none; - border-radius: 3px; - padding: 6px 8px; - - &.mx_AppPermissionWarning_tooltip--dark { - .mx_Tooltip_chevron::after { - border-right-color: $tooltip-timeline-bg-color; - } - } - - ul { - list-style-position: inside; - padding-left: 2px; - margin-left: 0; - } -} - .mx_AppTile_loading { display: flex; flex-direction: column; diff --git a/res/css/views/rooms/_RoomHeader.pcss b/res/css/views/rooms/_RoomHeader.pcss index 4cf1d44e102..c351791fea4 100644 --- a/res/css/views/rooms/_RoomHeader.pcss +++ b/res/css/views/rooms/_RoomHeader.pcss @@ -14,6 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ +:root { + --RoomHeader-indicator-dot-size: 8px; + --RoomHeader-indicator-dot-offset: -3px; + --RoomHeader-indicator-pulseColor: $alert; +} + .mx_RoomHeader { flex: 0 0 50px; border-bottom: 1px solid $primary-hairline-color; diff --git a/src/components/views/elements/AppPermission.tsx b/src/components/views/elements/AppPermission.tsx index 33ca2ba4d4c..2c1015bd1ab 100644 --- a/src/components/views/elements/AppPermission.tsx +++ b/src/components/views/elements/AppPermission.tsx @@ -115,9 +115,9 @@ export default class AppPermission extends React.Component { const warningTooltip = ( - + ); @@ -137,20 +137,18 @@ export default class AppPermission extends React.Component { const encryptionWarning = this.props.isRoomEncrypted ? _t("Widgets do not use message encryption.") : null; return ( -
-
- {_t("Widget added by")} -
-
+
+
{_t("Widget added by")}
+
{avatar} -

{displayName}

-
{userId}
+

{displayName}

+
{userId}
-
{warning}
-
+
{warning}
+
{_t("This widget may use cookies.")} {encryptionWarning}
-
+
{_t("Continue")} diff --git a/src/components/views/elements/AppWarning.tsx b/src/components/views/elements/AppWarning.tsx index cb4802213e1..98b7f1954c7 100644 --- a/src/components/views/elements/AppWarning.tsx +++ b/src/components/views/elements/AppWarning.tsx @@ -22,7 +22,7 @@ interface IProps { const AppWarning: React.FC = (props) => { return ( -
+