WIP: register setup wizard pages.

This commit is contained in:
Ahmed Bouhuolia
2020-10-12 14:14:19 +02:00
parent a2ecb6c79d
commit 918e174f8a
22 changed files with 265 additions and 96 deletions

View File

@@ -3,23 +3,25 @@ import { connect } from 'react-redux';
import { Redirect } from 'react-router-dom';
import { compose } from 'utils';
import withAuthentication from 'containers/Authentication/withAuthentication';
import withOrganizationByOrgId from 'containers/Organization/withOrganizationByOrgId';
import withOrganization from 'containers/Organization/withOrganization';
function EnsureOrganizationIsNotReady({
children,
// #withOrganizationByOrgId
organization,
// #withOrganization
isOrganizationReady,
}) {
return (organization.is_ready) ? (
return (isOrganizationReady) ? (
<Redirect to={{ pathname: '/' }} />
) : children;
}
export default compose(
withAuthentication(),
withAuthentication(({ currentOrganizationId }) => ({
currentOrganizationId,
})),
connect((state, props) => ({
organizationId: props.currentOrganizationId,
})),
withOrganizationByOrgId(),
withOrganization(({ isOrganizationReady }) => ({ isOrganizationReady })),
)(EnsureOrganizationIsNotReady);