Skip to content

Commit

Permalink
Merge branch 'develop' into alunturner/plain-text-mentions-as-pills
Browse files Browse the repository at this point in the history
  • Loading branch information
alunturner committed May 16, 2023
2 parents 58d443a + 2eedfbf commit 57924c6
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 82 deletions.
1 change: 1 addition & 0 deletions res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
77 changes: 77 additions & 0 deletions res/css/components/views/elements/_AppPermission.pcss
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
16 changes: 6 additions & 10 deletions res/css/structures/_RightPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions res/css/structures/_RoomView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
57 changes: 2 additions & 55 deletions res/css/views/rooms/_AppsDrawer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ limitations under the License.
flex: 1;
}

.mx_AppPermissionWarning {
.mx_AppWarning,
.mx_AppPermission {
text-align: center;
display: flex;
height: 100%;
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions res/css/views/rooms/_RoomHeader.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 10 additions & 12 deletions src/components/views/elements/AppPermission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);

Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/elements/AppWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 57924c6

Please sign in to comment.