mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactoring: setup wizard pages with simple architecture.
This commit is contained in:
25
client/src/containers/Setup/EnsureOrganizationIsNotReady.js
Normal file
25
client/src/containers/Setup/EnsureOrganizationIsNotReady.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
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';
|
||||
|
||||
function EnsureOrganizationIsNotReady({
|
||||
children,
|
||||
|
||||
// #withOrganizationByOrgId
|
||||
organization,
|
||||
}) {
|
||||
return (organization.is_ready) ? (
|
||||
<Redirect to={{ pathname: '/' }} />
|
||||
) : children;
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withAuthentication(),
|
||||
connect((state, props) => ({
|
||||
organizationId: props.currentOrganizationId,
|
||||
})),
|
||||
withOrganizationByOrgId(),
|
||||
)(EnsureOrganizationIsNotReady);
|
||||
Reference in New Issue
Block a user