From 7ea2f7f40fa9de83b0699ab99b66cacebbc27af7 Mon Sep 17 00:00:00 2001 From: Katsuyuki Karasawa <4ranci0ne@gmail.com> Date: Tue, 8 Apr 2025 22:44:52 +0900 Subject: [PATCH] refactor: remove unused props from components and improve error handling in about page (#385) --- src/components/ArchivePanel.astro | 2 +- src/components/control/ButtonTag.astro | 2 +- src/components/misc/License.astro | 2 +- src/components/widget/SideBar.astro | 2 -- src/components/widget/WidgetLayout.astro | 1 - src/layouts/Layout.astro | 6 ++---- src/pages/about.astro | 7 ++++++- src/pages/posts/[...slug].astro | 1 - 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index 6204bf21..102a53a3 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -10,7 +10,7 @@ interface Props { tags?: string[] categories?: string[] } -const { keyword, tags, categories } = Astro.props +const { tags, categories } = Astro.props let posts = await getSortedPosts() diff --git a/src/components/control/ButtonTag.astro b/src/components/control/ButtonTag.astro index bcafe657..50ac4b8a 100644 --- a/src/components/control/ButtonTag.astro +++ b/src/components/control/ButtonTag.astro @@ -5,7 +5,7 @@ interface Props { href?: string label?: string } -const { size, dot, href, label }: Props = Astro.props +const { dot, href, label }: Props = Astro.props --- {dot &&
} diff --git a/src/components/misc/License.astro b/src/components/misc/License.astro index 750e659f..ebabd1b7 100644 --- a/src/components/misc/License.astro +++ b/src/components/misc/License.astro @@ -12,7 +12,7 @@ interface Props { class: string } -const { title, slug, pubDate } = Astro.props +const { title, pubDate } = Astro.props const className = Astro.props.class const profileConf = profileConfig const licenseConf = licenseConfig diff --git a/src/components/widget/SideBar.astro b/src/components/widget/SideBar.astro index 7c3242c1..4d0e0daf 100644 --- a/src/components/widget/SideBar.astro +++ b/src/components/widget/SideBar.astro @@ -3,7 +3,6 @@ import Profile from './Profile.astro' import Tag from './Tags.astro' import Categories from './Categories.astro' import type { MarkdownHeading } from 'astro' -import TOC from './TOC.astro' interface Props { class? : string @@ -11,7 +10,6 @@ interface Props { } const className = Astro.props.class -const headings = Astro.props.headings ---