Use classNames function for appTileBodyClass on AppTile.tsx (#10939)
parent
60e1349eaa
commit
e652177706
|
@ -590,7 +590,11 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||||
const iframeFeatures =
|
const iframeFeatures =
|
||||||
"microphone; camera; encrypted-media; autoplay; display-capture; clipboard-write; " + "clipboard-read;";
|
"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 = {};
|
const appTileBodyStyles: CSSProperties = {};
|
||||||
if (this.props.pointerEvents) {
|
if (this.props.pointerEvents) {
|
||||||
appTileBodyStyles.pointerEvents = this.props.pointerEvents;
|
appTileBodyStyles.pointerEvents = this.props.pointerEvents;
|
||||||
|
@ -626,10 +630,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||||
);
|
);
|
||||||
} else if (this.state.initialising || !this.state.isUserProfileReady) {
|
} else if (this.state.initialising || !this.state.isUserProfileReady) {
|
||||||
appTileBody = (
|
appTileBody = (
|
||||||
<div
|
<div className={appTileBodyClass} style={appTileBodyStyles}>
|
||||||
className={appTileBodyClass + (this.state.loading ? "mx_AppTile_loading" : "")}
|
|
||||||
style={appTileBodyStyles}
|
|
||||||
>
|
|
||||||
{loadingElement}
|
{loadingElement}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -642,10 +643,7 @@ export default class AppTile extends React.Component<IProps, IState> {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
appTileBody = (
|
appTileBody = (
|
||||||
<div
|
<div className={appTileBodyClass} style={appTileBodyStyles}>
|
||||||
className={appTileBodyClass + (this.state.loading ? "mx_AppTile_loading" : "")}
|
|
||||||
style={appTileBodyStyles}
|
|
||||||
>
|
|
||||||
{this.state.loading && loadingElement}
|
{this.state.loading && loadingElement}
|
||||||
<iframe
|
<iframe
|
||||||
title={widgetTitle}
|
title={widgetTitle}
|
||||||
|
|
Loading…
Reference in New Issue