@wf-financing/ui 3.4.2 → 3.5.1

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": "3.4.2",
3
+ "version": "3.5.1",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.es.js",
@@ -10,6 +10,13 @@ export type PartnerId = keyof typeof WHITELISTED_PARTNER_IDS;
10
10
  export const WHITELISTED_PARTNER_IDS = {
11
11
  '2416e2af-c9f7-40ac-a2f0-f37dcfe59674': 'whiteLabel',
12
12
  '1f309265-5324-4f8b-88d7-9b0d5c77a27c': 'wayflyer',
13
+
13
14
  '970df87a-e7d5-4942-9450-a77cf771dca3': 'athena',
14
15
  '01756129-a8a8-4314-8813-97057195dcfa': 'athena',
16
+
17
+ '15bc3b16-632d-4de8-9a7e-3ab26f457ebd': 'conjura',
18
+ '1e1d4824-ce39-40d4-9e51-816d953a4b41': 'conjura',
19
+
20
+ 'c7fcea8c-ae5b-433a-bf79-ae3214627cf2': 'rocketFuel',
21
+ '8124d71d-1de6-4a39-8cff-dd2ce96c8363': 'rocketFuel',
15
22
  } as const satisfies Record<string, PartnerTheme>;
@@ -2,13 +2,19 @@ import { useEffect } from 'react';
2
2
 
3
3
  export function usePreloadImage(src: string) {
4
4
  useEffect(() => {
5
+ const head = document.head;
6
+
5
7
  if (!src) return;
6
8
 
7
- const img = new Image();
8
- img.decoding = 'async';
9
- img.fetchPriority = 'high';
10
- img.src = src;
9
+ const imageLink = document.createElement('link');
10
+ imageLink.rel = 'preload';
11
+ imageLink.as = 'image';
12
+ imageLink.href = src;
13
+
14
+ head.appendChild(imageLink);
11
15
 
12
- img.decode();
16
+ return () => {
17
+ head.removeChild(imageLink);
18
+ };
13
19
  }, [src]);
14
20
  }