Skip to content

Commit

Permalink
refactor: move to preact
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Jun 21, 2024
1 parent 4b5c1c6 commit 04497e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default defineConfig({
mdx(),
sitemap(),
tailwind(),
preact({ compat: true }),
preact(),
compress({
CSS: true,
HTML: true,
Expand Down
9 changes: 5 additions & 4 deletions src/components/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { useEffect, useState, type ReactElement } from "react";
import { type Component } from "preact";
import { useEffect, useState } from "preact/hooks";

type Props = {
dayIcon?: ReactElement;
nightIcon?: ReactElement;
dayIcon?: Component;
nightIcon?: Component;
};

export default function ThemeSwitcher({ dayIcon, nightIcon }: Props) {
Expand Down Expand Up @@ -75,7 +76,7 @@ export default function ThemeSwitcher({ dayIcon, nightIcon }: Props) {
}

return (
<div onClick={(e) => toggleDark(e.nativeEvent)}>
<div onClick={toggleDark}>
{dayIcon}
{nightIcon}
</div>
Expand Down

0 comments on commit 04497e6

Please sign in to comment.