Skip to content

Commit

Permalink
Merge pull request #10 from jlsnow301/typed-props
Browse files Browse the repository at this point in the history
Fixes prop types in themeswitch component
  • Loading branch information
surjithctly authored May 8, 2024
2 parents ccfb3dd + e4cfd7c commit db95add
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-color-scheme",
"version": "1.1.3",
"version": "1.1.4",
"description": "Perfect dark mode for Astro in few lines of code. Theme Toggle for Dark, Light & Auto (system)",
"type": "module",
"exports": {
Expand Down
12 changes: 6 additions & 6 deletions src/ThemeSwitch.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
interface Props {
strategy?: "button" | "checkbox" | "select" | "radio";
defaultTheme?: "dark" | "light" | "system";
as?: "div" | "span";
}
type Props = Partial<{
as: "div" | "span";
defaultTheme: "dark" | "light" | "system";
strategy: "button" | "checkbox" | "select" | "radio";
}>;
const { strategy, defaultTheme, as: Element = "span" } = Astro.props;
const { strategy, defaultTheme, as: Element = "span" }: Props = Astro.props;
---

<Element id="astro-color-scheme-switch">
Expand Down

0 comments on commit db95add

Please sign in to comment.