Skip to content

Commit c9df9f4

Browse files
committed
fix: toggle theme switch appearing on the website pages
1 parent d7b98ae commit c9df9f4

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

website/src/css/customTheme.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,6 @@ a:hover {
415415
}
416416

417417
@media only screen and (min-width: 768px) {
418-
.react-toggle {
419-
display: none;
420-
}
421-
422418
.arch-card-caption > p {
423419
width: 50%;
424420
}

website/src/pages/index.tsx

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { FC } from 'react';
2-
import React, { useEffect } from 'react';
3-
import useThemeContext from '@theme/hooks/useThemeContext';
2+
import React from 'react';
43
import Layout from '@theme/Layout';
54
import Head from '@docusaurus/Head';
6-
import useWindowType from '@theme/hooks/useWindowSize';
75

86
import HeroSection from '../components/sections/HeroSection';
97
import Architecture from '../components/sections/Architecture';
@@ -13,38 +11,8 @@ import Comparison from '../components/sections/Comparison';
1311
import OpensourcePromo from '../components/sections/OpensourcePromo';
1412
import 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-
4514
const Index: FC = () => (
4615
<Layout>
47-
<ThemeResetComponent />
4816
<Head>
4917
<meta
5018
name="twitter:title"

0 commit comments

Comments
 (0)