mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
refactor: update component props and improve types (#600)
- stop exporting component Props - replace interface with type for component Props - enhance dynamic rendering in several components
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
---
|
||||
import type { HTMLAttributes } from "astro/types";
|
||||
import Socials from "./Socials.astro";
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
|
||||
export interface Props {
|
||||
type Props = {
|
||||
noMarginTop?: boolean;
|
||||
}
|
||||
} & HTMLAttributes<"footer">;
|
||||
|
||||
const { noMarginTop = false } = Astro.props;
|
||||
const { noMarginTop = false, class: className, ...attrs } = Astro.props;
|
||||
---
|
||||
|
||||
<footer class:list={["app-layout", { "mt-auto": !noMarginTop }]}>
|
||||
<footer
|
||||
class:list={["app-layout", { "mt-auto": !noMarginTop }, className]}
|
||||
{...attrs}
|
||||
>
|
||||
<div
|
||||
class:list={[
|
||||
"py-6 sm:py-4",
|
||||
|
||||
Reference in New Issue
Block a user