File tree 2 files changed +24
-18
lines changed
2 files changed +24
-18
lines changed Original file line number Diff line number Diff line change @@ -97,13 +97,21 @@ async function Siblings({ slug }: { slug: string }) {
97
97
height = { article . image . height }
98
98
src = { article . image . src }
99
99
alt = { article . imageAlt }
100
+ data-visual-test = "blackout"
100
101
/>
101
102
< PostCardBody >
102
103
{ article . category && (
103
- < PostCardTag > { article . category } </ PostCardTag >
104
+ < PostCardTag data-visual-test = "blackout" >
105
+ { article . category }
106
+ </ PostCardTag >
104
107
) }
105
- < PostCardTitle > { article . title } </ PostCardTitle >
106
- < PostCardFooter >
108
+ < PostCardTitle
109
+ classname = "line-clamp-2"
110
+ data-visual-test = "blackout"
111
+ >
112
+ { article . title }
113
+ </ PostCardTitle >
114
+ < PostCardFooter data-visual-test = "blackout" >
107
115
< PostCardAuthor > { article . author } </ PostCardAuthor >
108
116
< div className = "text-xs text-mauve-10" > |</ div >
109
117
< PostCardDate date = { article . date } />
Original file line number Diff line number Diff line change 1
- import { clsx } from "clsx" ;
2
1
import Image , { ImageProps } from "next/image" ;
3
- import type { ComponentProps , ReactNode } from "react" ;
4
- import { twc } from "react-twc" ;
2
+ import type { ComponentProps } from "react" ;
3
+ import { TwcComponentProps , twc } from "react-twc" ;
5
4
6
- export const PostCard = twc . div `rounded-lg border bg-subtle text-left transition duration-300 hover:-translate-y-2 hover:scale-[101%]" ` ;
5
+ export const PostCard = twc . div `rounded-lg border bg-subtle text-left transition duration-300 hover:-translate-y-2 hover:scale-[101%]` ;
7
6
8
7
export interface PostCardImageProps extends ImageProps {
9
8
extended ?: Boolean ;
@@ -52,17 +51,16 @@ export const PostCardTag: React.FC<{ children: React.ReactNode }> = (props) => (
52
51
< p className = "mb-2 text-xs text-low" { ...props } />
53
52
) ;
54
53
55
- export const PostCardTitle = ( {
56
- extended,
57
- children,
58
- } : {
59
- extended ?: Boolean ;
60
- children : ReactNode ;
61
- } ) => (
62
- < h2 className = { `mb-2 ${ extended ? "text-4xl" : "text-2xl" } font-accent text` } >
63
- { children }
64
- </ h2 >
65
- ) ;
54
+ type PostCardTitleProps = TwcComponentProps < "h2" > & {
55
+ extended ?: boolean ;
56
+ classname ?: string ;
57
+ } ;
58
+
59
+ export const PostCardTitle = twc . h2 < PostCardTitleProps > ( ( props ) => [
60
+ "mb-2 font-accent" ,
61
+ props . extended ? "text-4xl" : "text-2xl" ,
62
+ props . classname ,
63
+ ] ) ;
66
64
67
65
export const PostCardDescription = ( props : ComponentProps < "div" > ) => (
68
66
< div className = "mb-8 leading-normal text-low" { ...props } />
You can’t perform that action at this time.
0 commit comments