Split `mx_AppPermissionWarning` on `_AppsDrawer.pcss` into two classes (#10824)

* Separate mx_AppWarning and mx_AppPermission

* Remove mx_AppPermission_row for a type selector

* Nest: mx_AppPermission

* Run prettier

* Create a CSS file for AppPermission
pull/28788/head^2
Suguru Hirahara 2023-05-16 10:14:52 +00:00 committed by GitHub
parent ae692f712a
commit 2eedfbf566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 68 deletions

View File

@ -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";

View File

@ -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;
}
}
}

View File

@ -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;

View File

@ -115,9 +115,9 @@ export default class AppPermission extends React.Component<IProps, IState> {
const warningTooltip = (
<TextWithTooltip
tooltip={warningTooltipText}
tooltipClass="mx_AppPermissionWarning_tooltip mx_AppPermissionWarning_tooltip--dark"
tooltipClass="mx_AppPermission_tooltip mx_AppPermission_tooltip--dark"
>
<span className="mx_AppPermissionWarning_helpIcon" />
<span className="mx_AppPermission_helpIcon" />
</TextWithTooltip>
);
@ -137,20 +137,18 @@ export default class AppPermission extends React.Component<IProps, IState> {
const encryptionWarning = this.props.isRoomEncrypted ? _t("Widgets do not use message encryption.") : null;
return (
<div className="mx_AppPermissionWarning">
<div className="mx_AppPermissionWarning_row mx_AppPermissionWarning_bolder mx_AppPermissionWarning_smallText">
{_t("Widget added by")}
</div>
<div className="mx_AppPermissionWarning_row">
<div className="mx_AppPermission">
<div className="mx_AppPermission_bolder mx_AppPermission_smallText">{_t("Widget added by")}</div>
<div>
{avatar}
<h4 className="mx_AppPermissionWarning_bolder">{displayName}</h4>
<div className="mx_AppPermissionWarning_smallText">{userId}</div>
<h4 className="mx_AppPermission_bolder">{displayName}</h4>
<div className="mx_AppPermission_smallText">{userId}</div>
</div>
<div className="mx_AppPermissionWarning_row mx_AppPermissionWarning_smallText">{warning}</div>
<div className="mx_AppPermissionWarning_row mx_AppPermissionWarning_smallText">
<div className="mx_AppPermission_smallText">{warning}</div>
<div className="mx_AppPermission_smallText">
{_t("This widget may use cookies.")}&nbsp;{encryptionWarning}
</div>
<div className="mx_AppPermissionWarning_row">
<div>
<AccessibleButton kind="primary_sm" onClick={this.props.onPermissionGranted}>
{_t("Continue")}
</AccessibleButton>

View File

@ -22,7 +22,7 @@ interface IProps {
const AppWarning: React.FC<IProps> = (props) => {
return (
<div className="mx_AppPermissionWarning">
<div className="mx_AppWarning">
<div>
<img src={require("../../../../res/img/warning.svg").default} alt="" />
</div>