From 9096b21fc4847d02d3fc65c6dd2a3eee08d83995 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 9 Jun 2022 22:29:24 +0300 Subject: [PATCH] fix gosuslugi --- src/components/App/index.tsx | 15 +++++++++-- src/components/Footer/index.tsx | 10 +------- src/components/Gosuslugi/index.tsx | 41 ++---------------------------- src/components/Gosuslugi/lib.ts | 32 +++++++++++++++++++++++ 4 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index 929b85fe..b335063a 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -9,8 +9,10 @@ import { Breadcrumbs } from '../Breadcrumbs' import { IBreadcumbsPart, IMenu } from 'src/types' import { useRouter } from 'next/router' import { useMobile } from 'src/hooks/useMobile' +import { Gosuslugi } from '../Gosuslugi' +import { INavigationProps } from '@/components/Navigation' -const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigation), { +const Navigation = dynamic(() => import('../Navigation').then(mod => mod.Navigation), { ssr: false, }) @@ -54,7 +56,16 @@ export const App: React.FC = ({ showAuthor = false, menu, ...props }) footer={(
+ > +
+ +
+
)} > diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 47308e12..2e57d5a6 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -6,7 +6,6 @@ import { Author } from './Author' import { Block } from '../Block' import { Spacer } from '../Spacer' import { Contacts } from '../Contacts' -import { Gosuslugi } from '../Gosuslugi' export interface IFooterProps { showAuthor: boolean @@ -20,14 +19,7 @@ export const Footer: React.FC = props => ( -
- -
+ {props.children} diff --git a/src/components/Gosuslugi/index.tsx b/src/components/Gosuslugi/index.tsx index 26ab1706..d52fbfef 100644 --- a/src/components/Gosuslugi/index.tsx +++ b/src/components/Gosuslugi/index.tsx @@ -1,51 +1,14 @@ -import Head from 'next/head' import { useEffect } from 'react' -import { Html } from '../Html' import { getCode } from './lib' export type GosuslugiProps = {} export const Gosuslugi: React.FC = () => { useEffect(() => { - const code = getCode() - try { - document.head.innerHTML = document.head.innerHTML + code - console.log('Gosuslugi injected') - } catch (error) { - console.log('Failed to inject Gosuslugi') - } + window.dispatchEvent(new Event('resize')) }) return ( -
-
-
-
- Госуслуги -
Решаем вместе
-
-
-
-
- Есть предложения по организации учебного процесса или знаете, как сделать школу лучше? -
- -
-
- {/* */} - -
-
-
-
-
+
) } diff --git a/src/components/Gosuslugi/lib.ts b/src/components/Gosuslugi/lib.ts index 5e7308a6..d6522ba9 100644 --- a/src/components/Gosuslugi/lib.ts +++ b/src/components/Gosuslugi/lib.ts @@ -7,6 +7,38 @@ export const getCode = () => ` +
+
+ +
+
+ +
Решаем вместе
+
+
+
+
+ Есть предложения по организации учебного процесса или знаете, как сделать школу лучше? +
+ +
+
+ + +
+
+
+ +
+