mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
BIG-117: fix dashboard redirect all routes to homepage once refresh the page.
This commit is contained in:
@@ -1,9 +1,31 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { AuthenticatedUser } from './AuthenticatedUser';
|
||||
import { DashboardBoot } from '../../components';
|
||||
|
||||
import withDashboard from '../../containers/Dashboard/withDashboard';
|
||||
|
||||
/**
|
||||
* Private pages provider.
|
||||
*/
|
||||
export function PrivatePagesProvider({ children }) {
|
||||
return <AuthenticatedUser>{children}</AuthenticatedUser>;
|
||||
function PrivatePagesProviderComponent({
|
||||
splashScreenCompleted,
|
||||
|
||||
// #ownProps
|
||||
children,
|
||||
}) {
|
||||
return (
|
||||
<AuthenticatedUser>
|
||||
<DashboardBoot />
|
||||
|
||||
{splashScreenCompleted ? children : null}
|
||||
</AuthenticatedUser>
|
||||
);
|
||||
}
|
||||
|
||||
export const PrivatePagesProvider = R.compose(
|
||||
withDashboard(({ splashScreenCompleted }) => ({
|
||||
splashScreenCompleted,
|
||||
})),
|
||||
)(PrivatePagesProviderComponent);
|
||||
|
||||
Reference in New Issue
Block a user