File tree 1 file changed +11
-6
lines changed
src/components/_common/uxsignals-widget
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
- import React from 'react' ;
1
+ import React , { useEffect } from 'react' ;
2
2
import Script from 'next/script' ;
3
3
import { EditorHelp } from 'components/_editor-only/editor-help/EditorHelp' ;
4
4
@@ -9,13 +9,18 @@ type Props = {
9
9
} ;
10
10
11
11
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
+
12
22
return (
13
23
< >
14
- < Script
15
- type = { 'module' }
16
- src = { 'https://uxsignals-frontend.uxsignals.app.iterate.no/embed.js' }
17
- async = { true }
18
- />
19
24
< div data-uxsignals-embed = { embedCode } className = { style . uxSignalsWidget } />
20
25
< EditorHelp text = { 'UX Signals rekrutterings-widget' } type = { 'info' } />
21
26
</ >
You can’t perform that action at this time.
0 commit comments