Skip to content

Commit dd51084

Browse files
committed
Tvinger last av ux-signals i klient
1 parent 1cca686 commit dd51084

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/components/_common/uxsignals-widget/UxSignalsWidget.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import Script from 'next/script';
33
import { EditorHelp } from 'components/_editor-only/editor-help/EditorHelp';
44

@@ -9,13 +9,18 @@ type Props = {
99
};
1010

1111
export const UxSignalsWidget = ({ embedCode }: Props) => {
12+
useEffect(() => {
13+
const script = document.createElement('script');
14+
script.src = 'https://uxsignals-frontend.uxsignals.app.iterate.no/embed.js';
15+
script.async = true;
16+
document.body.appendChild(script);
17+
return () => {
18+
document.body.removeChild(script);
19+
};
20+
});
21+
1222
return (
1323
<>
14-
<Script
15-
type={'module'}
16-
src={'https://uxsignals-frontend.uxsignals.app.iterate.no/embed.js'}
17-
async={true}
18-
/>
1924
<div data-uxsignals-embed={embedCode} className={style.uxSignalsWidget} />
2025
<EditorHelp text={'UX Signals rekrutterings-widget'} type={'info'} />
2126
</>

0 commit comments

Comments
 (0)