summaryrefslogtreecommitdiff
path: root/examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx')
-rw-r--r--examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx b/examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx
index a3f31288d..b9682aa00 100644
--- a/examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx
+++ b/examples/docs/src/components/RightSidebar/ThemeToggleButton.tsx
@@ -1,5 +1,4 @@
import type { FunctionalComponent } from 'preact';
-import { h, Fragment } from 'preact';
import { useState, useEffect } from 'preact/hooks';
import './ThemeToggleButton.css';
@@ -35,7 +34,7 @@ const ThemeToggle: FunctionalComponent = () => {
if (import.meta.env.SSR) {
return undefined;
}
- if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
+ if (typeof localStorage !== undefined && localStorage.getItem('theme')) {
return localStorage.getItem('theme');
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
@@ -54,7 +53,7 @@ const ThemeToggle: FunctionalComponent = () => {
}, [theme]);
return (
- <div class="theme-toggle">
+ <div className="theme-toggle">
{themes.map((t, i) => {
const icon = icons[i];
const checked = t === theme;