11import type { FC } from 'react' ;
2- import React , { useEffect } from 'react' ;
3- import useThemeContext from '@theme/hooks/useThemeContext' ;
2+ import React from 'react' ;
43import Layout from '@theme/Layout' ;
54import Head from '@docusaurus/Head' ;
6- import useWindowType from '@theme/hooks/useWindowSize' ;
75
86import HeroSection from '../components/sections/HeroSection' ;
97import Architecture from '../components/sections/Architecture' ;
@@ -13,38 +11,8 @@ import Comparison from '../components/sections/Comparison';
1311import OpensourcePromo from '../components/sections/OpensourcePromo' ;
1412import EndCTA from '../components/sections/Endcta' ;
1513
16- const ThemeResetComponent = ( ) => {
17- const { isDarkTheme, setLightTheme } = useThemeContext ( ) ;
18- const windowType = useWindowType ( ) ;
19-
20- useEffect ( ( ) => {
21- if ( windowType === 'mobile' ) {
22- // remove mode switch at navbar-sidebar
23- const sidebarModeSwitch = document . querySelector ( 'div.navbar-sidebar__brand > div' ) as HTMLDivElement ;
24- if ( sidebarModeSwitch ) {
25- sidebarModeSwitch . style . display = 'none' ;
26- }
27- } else {
28- // remove mode switch at navbar
29- const navbarModeSwitch = document . querySelector ( 'div.navbar__items.navbar__items--right > div.react-toggle' ) as HTMLDivElement ;
30- if ( navbarModeSwitch ) {
31- navbarModeSwitch . style . display = 'none' ;
32- }
33- }
34- } , [ windowType ] ) ;
35-
36- useEffect ( ( ) => {
37- if ( isDarkTheme ) {
38- setLightTheme ( ) ;
39- }
40- } , [ isDarkTheme ] ) ;
41-
42- return ( null ) ;
43- } ;
44-
4514const Index : FC = ( ) => (
4615 < Layout >
47- < ThemeResetComponent />
4816 < Head >
4917 < meta
5018 name = "twitter:title"
0 commit comments