Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
filipKovachev committed Dec 5, 2024
1 parent cb8a27a commit 86d1efa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,20 @@ const Header: React.FC = () => {
);

const [theme, setTheme] = useState<string>(
() =>
typeof window !== "undefined"
? localStorage.getItem("theme") ||
"https://unpkg.com/@progress/[email protected]/dist/default-main.css"
: "https://unpkg.com/@progress/[email protected]/dist/default-main.css"
"https://unpkg.com/@progress/[email protected]/dist/default-main.css"
);

useEffect(() => {
const storedTheme = localStorage.getItem("theme");
if (storedTheme) {
setTheme(storedTheme);
}
}, []);

useEffect(() => {
const themeLink = document.getElementById("theme-link") as HTMLLinkElement;
if (themeLink) {
themeLink.href = theme;
} else {
console.error("Theme <link> tag not found");
}
}, [theme]);

Expand Down
10 changes: 5 additions & 5 deletions examples/kendo-react-e-commerce-astro-app/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
import Layout from '../layouts/Layout.astro';
import Home from '../components/Home';
import Header from '../components/Header';
import Home from '../components/Home';
import Footer from '../components/Footer';
---

<Layout>
<Header client:load />
<Header client:only="react" />
<main>
<Home client:load />
<Home client:only="react" />
</main>
<Footer client:load />
</Layout>
<Footer client:only="react" />
</Layout>

0 comments on commit 86d1efa

Please sign in to comment.