4
4
* This source code is licensed under the MIT license found in the
5
5
* LICENSE file in the root directory of this source tree.
6
6
*/
7
- import React , { useEffect } from "react" ;
7
+ import React from "react" ;
8
8
import clsx from "clsx" ;
9
9
import Head from "@docusaurus/Head" ;
10
10
import useBaseUrl from "@docusaurus/useBaseUrl" ;
@@ -14,60 +14,16 @@ import CookiesConsent from "../../components/CookiesConsent";
14
14
import styles from "./index.module.scss" ;
15
15
import * as icons from "../../components/Icons" ;
16
16
import RedirectComponent from "@site/src/components/RedirectComponent" ;
17
- import useDocusaurusContext from "@docusaurus/useDocusaurusContext" ;
18
- import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment" ;
19
17
// import ProgressBar from "react-scroll-progress-bar";
20
18
21
19
const GLOBAL_SEARCH_ID = "GLOBAL-ID-SEARCH-229" ;
22
20
function Footer ( ) {
23
21
const year = new Date ( ) . getFullYear ( ) ;
24
22
const { footer } = useThemeConfig ( ) ;
25
- const {
26
- siteConfig : {
27
- customFields : { algolia } ,
28
- } ,
29
- } = useDocusaurusContext ( ) ;
30
- useEffect ( ( ) => {
31
- const id = document . getElementById ( GLOBAL_SEARCH_ID ) ;
32
- if ( ! id ) {
33
- const script = document . createElement ( "script" ) ;
34
- script . id = GLOBAL_SEARCH_ID ;
35
- script . src = "https://cdn.jsdelivr.net/npm/@docsearch/js@3" ;
36
- script . async = true ;
37
- script . onload = ( ) => {
38
- setSearch ( ) ;
39
- } ;
40
- document . body . appendChild ( script ) ;
41
- } else {
42
- setSearch ( ) ;
43
- }
44
-
45
- function setSearch ( ) {
46
- if ( ExecutionEnvironment . canUseDOM ) {
47
- const container = document . querySelector (
48
- '[class^="navbarSearchContainer"]'
49
- ) ;
50
- try {
51
- if ( window . docsearch ) {
52
- window . docsearch ( {
53
- ...( algolia as any ) ,
54
- container,
55
- } ) ;
56
- }
57
- } catch ( error ) {
58
- console . log ( error ) ;
59
- }
60
- }
61
- }
62
- } , [ ] ) ;
63
23
return (
64
24
< footer className = { clsx ( "footer" , styles . footer ) } >
65
25
< Head >
66
26
< script async src = { useBaseUrl ( "/Koala/index.js" ) } > </ script >
67
- < link
68
- rel = "stylesheet"
69
- href = "https://cdn.jsdelivr.net/npm/@docsearch/css@3"
70
- />
71
27
</ Head >
72
28
< div className = { clsx ( "footer-items" , styles . footerItems ) } >
73
29
{ ( footer . links [ 0 ] . items as any [ ] ) ?. map ( ( item , index ) => {
0 commit comments