@wf-financing/ui 4.7.1 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wf-financing/ui",
3
- "version": "4.7.1",
3
+ "version": "4.7.2",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.es.js",
package/src/CtaWidget.tsx CHANGED
@@ -1,11 +1,11 @@
1
- import { useState, lazy, Suspense, ComponentProps } from 'react';
1
+ import { useState } from 'react';
2
2
  import type { CtaResponseType, ContinueHostedApplicationResponseType } from '@wf-financing/embedded-types';
3
3
  import type { Copy } from '@wf-financing/ui-assets';
4
4
 
5
5
  import { CtaBanner } from './components/banner/CtaBanner';
6
6
  import { buildCtaUiProps } from './utils';
7
- import { useContinueHostedApplication, useNotificationOnRender, usePartnerContext } from './hooks';
8
- import { IS_EMBEDDED_JOURNEY } from './config';
7
+ import { useContinueHostedApplication, useNotificationOnRender } from './hooks';
8
+ import ConsentModal from './components/modal/ConsentModal.tsx';
9
9
 
10
10
  type CtaWidgetProps = {
11
11
  cta: Exclude<CtaResponseType, null>;
@@ -13,14 +13,10 @@ type CtaWidgetProps = {
13
13
  skipAnimation: boolean;
14
14
  };
15
15
 
16
- const EmbeddedJourneyPanel = lazy(() => import('@wf-financing/embedded-journey/embedded-journey-panel'));
17
- const ConsentModal = lazy(() => import('./components/modal/ConsentModal'));
18
-
19
16
  export const CtaWidget = ({ cta, copy, skipAnimation }: CtaWidgetProps) => {
20
17
  const [isWidgetOpen, setIsWidgetOpen] = useState(false);
21
18
  const { mutate: continueHostedApplicationMutation } = useContinueHostedApplication();
22
19
  const sendNotification = useNotificationOnRender();
23
- const { portalContainer } = usePartnerContext();
24
20
 
25
21
  const toggleIsWidgetOpen = () => setIsWidgetOpen((isOpen) => !isOpen);
26
22
  const handleContinueHostedApplication = () => {
@@ -44,24 +40,12 @@ export const CtaWidget = ({ cta, copy, skipAnimation }: CtaWidgetProps) => {
44
40
 
45
41
  sendNotification(cta, bannerProps);
46
42
 
47
- const embeddedJourneyPanelProps: ComponentProps<typeof EmbeddedJourneyPanel> = {
48
- portalContainer,
49
- isOpen: isWidgetOpen,
50
- closePanel: () => toggleIsWidgetOpen(),
51
- };
52
-
53
43
  return (
54
44
  <>
55
45
  <CtaBanner skipAnimation={skipAnimation} {...bannerProps} />
56
- <Suspense fallback={null}>
57
- {IS_EMBEDDED_JOURNEY ? (
58
- <EmbeddedJourneyPanel {...embeddedJourneyPanelProps} />
59
- ) : (
60
- consentModalProps && (
61
- <ConsentModal {...consentModalProps} {...partnerTemplateProps} isModalOpen={isWidgetOpen} />
62
- )
63
- )}
64
- </Suspense>
46
+ {consentModalProps && (
47
+ <ConsentModal {...consentModalProps} {...partnerTemplateProps} isModalOpen={isWidgetOpen} />
48
+ )}
65
49
  </>
66
50
  );
67
51
  };