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

Commit

Permalink
Use classNames function for appTileBodyClass on AppTile.tsx (#10939)
Browse files Browse the repository at this point in the history
  • Loading branch information
luixxiul authored May 19, 2023
1 parent 60e1349 commit e652177
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ export default class AppTile extends React.Component<IProps, IState> {
const iframeFeatures =
"microphone; camera; encrypted-media; autoplay; display-capture; clipboard-write; " + "clipboard-read;";

const appTileBodyClass = "mx_AppTileBody" + (this.props.miniMode ? "_mini " : " ");
const appTileBodyClass = classNames({
mx_AppTileBody: !this.props.miniMode,
mx_AppTileBody_mini: this.props.miniMode,
mx_AppTile_loading: this.state.loading,
});
const appTileBodyStyles: CSSProperties = {};
if (this.props.pointerEvents) {
appTileBodyStyles.pointerEvents = this.props.pointerEvents;
Expand Down Expand Up @@ -626,10 +630,7 @@ export default class AppTile extends React.Component<IProps, IState> {
);
} else if (this.state.initialising || !this.state.isUserProfileReady) {
appTileBody = (
<div
className={appTileBodyClass + (this.state.loading ? "mx_AppTile_loading" : "")}
style={appTileBodyStyles}
>
<div className={appTileBodyClass} style={appTileBodyStyles}>
{loadingElement}
</div>
);
Expand All @@ -642,10 +643,7 @@ export default class AppTile extends React.Component<IProps, IState> {
);
} else {
appTileBody = (
<div
className={appTileBodyClass + (this.state.loading ? "mx_AppTile_loading" : "")}
style={appTileBodyStyles}
>
<div className={appTileBodyClass} style={appTileBodyStyles}>
{this.state.loading && loadingElement}
<iframe
title={widgetTitle}
Expand Down

0 comments on commit e652177

Please sign in to comment.