Skip to content

Commit

Permalink
Fix create integration by consuming store from parent component (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
karelhala authored Dec 16, 2024
1 parent c516efc commit 594e28f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/pages/Integrations/Create/IntegrationWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import {
updateEndpoint,
} from '../../../api/helpers/integrations/endpoints-helper';
import { useNotification } from '../../../utils/AlertUtils';
import { Provider } from 'react-redux';
import { Store } from 'redux';

export interface IntegrationWizardProps {
category: string;
Expand All @@ -40,6 +42,7 @@ export interface IntegrationWizardProps {
closeModal: () => void;
afterSubmit: () => void;
}

export const IntegrationWizard: React.FunctionComponent<
IntegrationWizardProps
> = ({
Expand Down Expand Up @@ -134,4 +137,16 @@ export const IntegrationWizard: React.FunctionComponent<
);
};

export default IntegrationWizard;
const IntegrationWizardWrapper: React.FC<
{ store?: Store } & IntegrationWizardProps
> = ({ store, ...props }) => {
return store ? (
<Provider store={store}>
<IntegrationWizard {...props} />
</Provider>
) : (
<IntegrationWizard {...props} />
);
};

export default IntegrationWizardWrapper;

0 comments on commit 594e28f

Please sign in to comment.