Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -16,14 +16,14 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
import classnames from 'classnames';
|
||||
import React from "react";
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
import classnames from "classnames";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { _t } from '../../languageHandler';
|
||||
import dis from '../../dispatcher/dispatcher';
|
||||
import { MatrixClientPeg } from '../../MatrixClientPeg';
|
||||
import { _t } from "../../languageHandler";
|
||||
import dis from "../../dispatcher/dispatcher";
|
||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
||||
import MatrixClientContext from "../../contexts/MatrixClientContext";
|
||||
import AutoHideScrollbar from "./AutoHideScrollbar";
|
||||
import { ActionPayload } from "../../dispatcher/payloads";
|
||||
|
@ -52,7 +52,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
|||
super(props, context);
|
||||
|
||||
this.state = {
|
||||
page: '',
|
||||
page: "",
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -80,10 +80,10 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
|||
return;
|
||||
}
|
||||
|
||||
let body = (await res.text()).replace(/_t\(['"]([\s\S]*?)['"]\)/mg, (match, g1) => this.translate(g1));
|
||||
let body = (await res.text()).replace(/_t\(['"]([\s\S]*?)['"]\)/gm, (match, g1) => this.translate(g1));
|
||||
|
||||
if (this.props.replaceMap) {
|
||||
Object.keys(this.props.replaceMap).forEach(key => {
|
||||
Object.keys(this.props.replaceMap).forEach((key) => {
|
||||
body = body.split(key).join(this.props.replaceMap[key]);
|
||||
});
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
|||
|
||||
private onAction = (payload: ActionPayload): void => {
|
||||
// HACK: Workaround for the context's MatrixClient not being set up at render time.
|
||||
if (payload.action === 'client_started') {
|
||||
if (payload.action === "client_started") {
|
||||
this.forceUpdate();
|
||||
}
|
||||
};
|
||||
|
@ -129,18 +129,12 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
|
|||
[`${className}_loggedIn`]: !!client,
|
||||
});
|
||||
|
||||
const content = <div className={`${className}_body`}
|
||||
dangerouslySetInnerHTML={{ __html: this.state.page }}
|
||||
/>;
|
||||
const content = <div className={`${className}_body`} dangerouslySetInnerHTML={{ __html: this.state.page }} />;
|
||||
|
||||
if (this.props.scrollbar) {
|
||||
return <AutoHideScrollbar className={classes}>
|
||||
{ content }
|
||||
</AutoHideScrollbar>;
|
||||
return <AutoHideScrollbar className={classes}>{content}</AutoHideScrollbar>;
|
||||
} else {
|
||||
return <div className={classes}>
|
||||
{ content }
|
||||
</div>;
|
||||
return <div className={classes}>{content}</div>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue