Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Conform class names of mx_AppTileBody for a widget and PiP widget to our naming policy #11002

Merged
merged 19 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 48 additions & 44 deletions res/css/views/rooms/_AppsDrawer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,10 @@ limitations under the License.
}
}

.mx_AppTileBody,
.mx_AppTileBody_mini {
width: 100%;
overflow: hidden;
/* appTileBody is embedded to PersistedElement outside of mx_AppTile,
so the style rules for appTileBody should not be included in mx_AppTile. */
.mx_AppTileBody {
border-radius: 8px;
height: var(--AppTileBody-height);

iframe {
border: none;
width: 100%;
height: 100%;
}

/* const loadingElement */
.mx_AppTileBody_fadeInSpinner {
Expand All @@ -279,28 +271,58 @@ limitations under the License.
animation-delay: 500ms;
animation-name: mx_AppTileBody_fadeInSpinnerAnimation;
}
}

.mx_AppTileBody {
--AppTileBody-height: 100%;
&.mx_AppTileBody--normal,
&.mx_AppTileBody--mini {
robintown marked this conversation as resolved.
Show resolved Hide resolved
width: 100%;
overflow: hidden;
height: var(--AppTileBody-height);

background-color: $widget-body-bg-color;
iframe {
border: none;
width: 100%;
height: 100%;
}
}

iframe {
overflow: hidden;
padding: 0;
margin: 0;
display: block;
&.mx_AppTileBody--normal {
--AppTileBody-height: 100%;

background-color: $widget-body-bg-color;

iframe {
overflow: hidden;
padding: 0;
margin: 0;
display: block;
}
}
}

.mx_AppTileBody_mini {
--AppTileBody-height: var(--AppTile_mini-height);
&.mx_AppTileBody--mini {
--AppTileBody-height: var(--AppTile_mini-height);
}

&.mx_AppTileBody--loading {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: bold;
position: relative;
height: 100%;

/* match bg of border so that the cut corners have the right fill */
background-color: $widget-body-bg-color !important;

iframe {
display: none;
}
}
}

.mx_AppTile .mx_AppTileBody,
.mx_AppTileFullWidth .mx_AppTileBody,
.mx_AppTile_mini .mx_AppTileBody_mini {
.mx_AppTile .mx_AppTileBody--normal,
.mx_AppTileFullWidth .mx_AppTileBody--normal,
.mx_AppTile_mini .mx_AppTileBody--mini {
height: inherit;
flex: 1;
}
Expand All @@ -321,24 +343,6 @@ limitations under the License.
}
}

.mx_AppTile_loading {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-weight: bold;
position: relative;
height: 100%;

/* match bg of border so that the cut corners have the right fill */
background-color: $widget-body-bg-color !important;
border-radius: 8px;

iframe {
display: none;
}
}

@keyframes mx_AppTileBody_fadeInSpinnerAnimation {
from {
opacity: 0;
Expand Down
7 changes: 4 additions & 3 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,10 @@ export default class AppTile extends React.Component<IProps, IState> {
"microphone; camera; encrypted-media; autoplay; display-capture; clipboard-write; " + "clipboard-read;";

const appTileBodyClass = classNames({
mx_AppTileBody: !this.props.miniMode,
mx_AppTileBody_mini: this.props.miniMode,
Comment on lines -599 to -600
Copy link
Contributor Author

@luixxiul luixxiul May 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have not really been efficient, as it was impossible to specify common declarations to a single selector.

Also, the class name mx_AppTileBody had been misleading as it did not indicate by itself that the style rules added to the selector were in fact not applied to AppTileBody on mini mode.

mx_AppTile_loading: this.state.loading,
"mx_AppTileBody": true,
"mx_AppTileBody--normal": !this.props.miniMode,
robintown marked this conversation as resolved.
Show resolved Hide resolved
"mx_AppTileBody--mini": this.props.miniMode,
"mx_AppTileBody--loading": this.state.loading,
});
const appTileBodyStyles: CSSProperties = {};
if (this.props.pointerEvents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports[`AppTile destroys non-persisted right panel widget on room change 1`] =
id="1"
>
<div
class="mx_AppTileBody mx_AppTile_loading"
class="mx_AppTileBody mx_AppTileBody--normal mx_AppTileBody--loading"
>
<div
class="mx_AppTileBody_fadeInSpinner"
Expand Down