mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Update card style layout and add secHeading prop
This commit is contained in:
+16
-9
@@ -4,18 +4,25 @@ import type { Frontmatter } from "@utils/types";
|
|||||||
export interface Props {
|
export interface Props {
|
||||||
href?: string;
|
href?: string;
|
||||||
post: Frontmatter;
|
post: Frontmatter;
|
||||||
|
secHeading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Card({ href, post }: Props) {
|
const styles = {
|
||||||
|
cardContainer: "my-6",
|
||||||
|
titleLink:
|
||||||
|
"text-skin-accent font-medium text-lg underline-offset-4 decoration-dashed focus-visible:underline",
|
||||||
|
titleHeading: "font-medium text-lg decoration-dashed hover:underline",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Card({ href, post, secHeading = true }: Props) {
|
||||||
return (
|
return (
|
||||||
<li className="my-6">
|
<li className={styles.cardContainer}>
|
||||||
<a
|
<a href={href} className={styles.titleLink}>
|
||||||
href={href}
|
{secHeading ? (
|
||||||
className="text-skin-accent font-medium text-lg underline-offset-4 decoration-dashed focus-visible:underline"
|
<h2 className={styles.titleHeading}>{post.title}</h2>
|
||||||
>
|
) : (
|
||||||
<h2 className="font-medium text-lg decoration-dashed hover:underline">
|
<h3 className={styles.titleHeading}>{post.title}</h3>
|
||||||
{post.title}
|
)}
|
||||||
</h2>
|
|
||||||
</a>
|
</a>
|
||||||
<Datetime datetime={post.datetime} />
|
<Datetime datetime={post.datetime} />
|
||||||
<p>{post.description}</p>
|
<p>{post.description}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user