Use classNames function for appTileBodyClass on AppTile.tsx (#10939)

pull/28217/head
Suguru Hirahara 2023-05-19 15:18:18 +00:00 committed by GitHub
parent 60e1349eaa
commit e652177706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

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