PromucFlow_constructor/app/client/src/pages/Applications/loader.tsx

38 lines
982 B
TypeScript
Raw Normal View History

import React from "react";
import PageLoadingBar from "pages/common/PageLoadingBar";
import { retryPromise } from "utils/AppsmithUtils";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
2020-10-07 11:19:56 +00:00
import AnalyticsUtil from "utils/AnalyticsUtil";
class ApplicationListLoader extends React.PureComponent<any, { Page: any }> {
constructor(props: any) {
super(props);
this.state = {
Page: null,
};
}
componentDidMount() {
PerformanceTracker.stopTracking(PerformanceTransactionName.LOGIN_CLICK);
2020-10-07 11:19:56 +00:00
AnalyticsUtil.logEvent("APPLICATIONS_PAGE_LOAD");
retryPromise(() =>
import(
/* webpackChunkName: "applications" */ "@appsmith/pages/Applications/index"
),
2020-12-24 04:32:25 +00:00
).then((module) => {
this.setState({ Page: module.default });
});
}
render() {
const { Page } = this.state;
return Page ? <Page {...this.props} /> : <PageLoadingBar />;
}
}
export default ApplicationListLoader;