Skip to content

Commit

Permalink
chore: Fix TypeScript type errors in Card and ScriptIndex compone…
Browse files Browse the repository at this point in the history
…nts.
  • Loading branch information
CarLeonDev committed May 18, 2024
1 parent 98ced2a commit 774d24e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions website/src/components/Card.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
import { Icon } from "@astrojs/starlight/components";
import type { Icons } from "@astrojs/starlight/components/Icons";
interface Props {
icon?: keyof typeof Icons;
icon?: string;
title: string;
}
Expand All @@ -17,7 +16,7 @@ const { icon, title } = Astro.props;
class="card-inner flex flex-col relative w-full h-full overflow-hidden rounded-2xl transition duration-300"
>
<p class="title sl-flex">
{icon && <Icon name={icon} class="icon" size="1.333em" />}
{icon && <Icon name={icon as any} class="icon" size="1.333em" />}
<span set:html={title} />
</p>
<div class="body"><slot /></div>
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/ScriptIndex.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

for (const card of document.querySelectorAll(".card")) {
//@ts-ignore
card.onmousemove = (e) => handleOnMouseMove(e);
card.onmousemove = (e: any) => handleOnMouseMove(e);
}

const header = document.querySelector(".header");
Expand Down
3 changes: 1 addition & 2 deletions website/src/components/Search.astro
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ const pagefindTranslations = {
const onIdle =
window.requestIdleCallback || ((cb) => setTimeout(cb, 1));
onIdle(async () => {
// @ts-expect-error — Missing types for @pagefind/default-ui package.
const { PagefindUI } = await import("@pagefind/default-ui");
const { PagefindUI } = await import("@pagefind/default-ui" as any);
new PagefindUI({
element: "#starlight__search",
baseUrl: import.meta.env.BASE_URL,
Expand Down

0 comments on commit 774d24e

Please sign in to comment.