fix gosuslugi
This commit is contained in:
1 parent
69b1e5a9f7
commit
ac3bbb825d
4 files changed
+31
-4
No files matched your search
@@ -1,14 +1,23 @@
|
||||
import { useEffect } from "react"
|
||||
import { getCode } from "./lib"
|
||||
import InnerHTML from "dangerously-set-html-content"
|
||||
|
||||
export type GosuslugiProps = {}
|
||||
|
||||
export const Gosuslugi: React.FC<GosuslugiProps> = () => {
|
||||
useEffect(() => {
|
||||
window.dispatchEvent(new Event("resize"))
|
||||
})
|
||||
const id = setTimeout(() => {
|
||||
// This call taken from getCode <script>Widget("https://pos.gosuslugi.ru/form", 312519)</script>
|
||||
(window as any).Widget("https://pos.gosuslugi.ru/form", 312519)
|
||||
}, 100)
|
||||
|
||||
return () => {
|
||||
clearTimeout(id)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div dangerouslySetInnerHTML={{ __html: getCode() }} />
|
||||
<InnerHTML html={getCode()} />
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user