Skip to content

Commit

Permalink
fix: make provider import dynamic (#2492)
Browse files Browse the repository at this point in the history
  • Loading branch information
flagrede authored Oct 1, 2024
1 parent 61ba690 commit d016f29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web-marketplace/src/clients/Clients.constants.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ReactNode } from 'react';
import { lazy, ReactNode } from 'react';

import { CLIENT_CONFIG, MARKETPLACE_CLIENT_TYPE } from './Clients.types';
import { RegenProvider } from './regen/Regen.Providers';
import { TerrasosProvider } from './terrasos/Terrasos.Providers';

const RegenProvider = lazy(() => import('./regen/Regen.Providers'));
const TerrasosProvider = lazy(() => import('./terrasos/Terrasos.Providers'));

export const PROVIDERS_MAPPING: Record<MARKETPLACE_CLIENT_TYPE, ReactNode> = {
regen: <RegenProvider />,
Expand Down
2 changes: 2 additions & 0 deletions web-marketplace/src/clients/regen/Regen.Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ export const RegenProvider = () => {
</SharedProviders>
);
};

export default RegenProvider;
2 changes: 2 additions & 0 deletions web-marketplace/src/clients/terrasos/Terrasos.Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ export const TerrasosProvider = () => {
</SharedProviders>
);
};

export default TerrasosProvider;

0 comments on commit d016f29

Please sign in to comment.