feat: application and dashboard async booting.

This commit is contained in:
a.bouhuolia
2021-11-26 22:27:27 +02:00
parent ca3ff3fd8f
commit 1be30fd142
3 changed files with 35 additions and 28 deletions

View File

@@ -1,29 +1,15 @@
import React from 'react';
import * as R from 'ramda';
import { DashboardBoot } from '../../components';
import withDashboard from '../../containers/Dashboard/withDashboard';
import { useApplicationBoot } from '../../components';
/**
* Private pages provider.
*/
function PrivatePagesProviderComponent({
splashScreenCompleted,
export function PrivatePagesProvider({
// #ownProps
children,
}) {
return (
<React.Fragment>
<DashboardBoot />
{splashScreenCompleted ? children : null}
</React.Fragment>
);
}
const { isLoading } = useApplicationBoot();
export const PrivatePagesProvider = R.compose(
withDashboard(({ splashScreenCompleted }) => ({
splashScreenCompleted,
})),
)(PrivatePagesProviderComponent);
return <React.Fragment>{!isLoading ? children : null}</React.Fragment>;
}