@@ -41,20 +41,27 @@ const BlogPage: FC = async () => {
41
41
< article >
42
42
< div >
43
43
< Box
44
- className = "aspect-video overflow-hidden rounded-[var(--card-border-radius)]"
44
+ className = "aspect-video rounded-[var(--card-border-radius)]"
45
+ overflow = "hidden"
45
46
position = "relative"
47
+ style = { { boxShadow : 'var(--base-card-surface-box-shadow)' } }
46
48
>
47
49
{ featuredArticle . coverPhoto ? (
48
50
< Image
49
51
fill
50
52
alt = { featuredArticle . title }
51
53
className = "object-cover"
52
54
src = { featuredArticle . coverPhoto }
55
+ sizes = { [
56
+ `(min-width: 1136px) ${ 1136 / 2 } px` , // container size 4 max width = 1136px
57
+ '(min-width: 768px) 50vw' , // breakpoint sm = 768px
58
+ '100vw' ,
59
+ ] . join ( ',' ) }
53
60
/>
54
61
) : null }
55
62
</ Box >
56
63
</ div >
57
- < Flex direction = "column" gap = "3" >
64
+ < div >
58
65
{ featuredArticle . categories &&
59
66
featuredArticle . categories . length > 0 ? (
60
67
< Flex gap = "3" >
@@ -65,23 +72,74 @@ const BlogPage: FC = async () => {
65
72
) ) }
66
73
</ Flex >
67
74
) : null }
68
- < Heading size = { { initial : '4' , xs : '6' , md : '8' } } >
75
+ < Heading mt = "4" size = { { initial : '4' , xs : '6' , md : '8' } } >
69
76
{ featuredArticle . title }
70
77
</ Heading >
71
78
< Text
72
79
className = "line-clamp-3"
80
+ mt = "2"
73
81
size = { { initial : '3' , md : '4' } }
74
82
>
75
83
{ featuredArticle . description }
76
84
</ Text >
77
- < Text color = "gray" size = { { initial : '2' , md : '3' } } >
85
+ < Text color = "gray" mt = "2" size = { { initial : '2' , md : '3' } } >
78
86
{ dateFormatter . format ( featuredArticle . createdAt ) }
79
87
</ Text >
80
- </ Flex >
88
+ </ div >
81
89
</ article >
82
90
</ Grid >
83
91
</ Link >
84
92
</ Card >
93
+ < Grid columns = { { xs : '2' , md : '3' } } gap = "5" mt = "8" >
94
+ { articles
95
+ . filter ( ( { id } ) => id !== featuredArticle . id )
96
+ . map (
97
+ ( { id, createdAt, coverPhoto, slug, title, categories = [ ] } ) => (
98
+ < Card key = { id } asChild variant = "ghost" >
99
+ < Link href = { `${ routes . blog . pathname } /${ slug } ` } >
100
+ < article >
101
+ < Box
102
+ className = "aspect-video rounded-[var(--card-border-radius)]"
103
+ overflow = "hidden"
104
+ position = "relative"
105
+ style = { {
106
+ boxShadow : 'var(--base-card-surface-box-shadow)' ,
107
+ } }
108
+ >
109
+ { coverPhoto ? (
110
+ < Image
111
+ fill
112
+ alt = { title }
113
+ className = "object-cover"
114
+ src = { coverPhoto }
115
+ sizes = { [
116
+ `(min-width: 1136px) ${ 1136 / 2 } px` , // container size 4 max width = 1136px
117
+ '(min-width: 1024px) 33vw' , // breakpoint md = 1024px
118
+ '(min-width: 768px) 50vw' , // breakpoint sm = 768px
119
+ '100vw' ,
120
+ ] . join ( ',' ) }
121
+ />
122
+ ) : null }
123
+ </ Box >
124
+ { categories . length > 0 ? (
125
+ < Flex gap = "2" mt = "3" wrap = "wrap" >
126
+ { categories . map ( ( category ) => (
127
+ < Badge key = { category } > { category } </ Badge >
128
+ ) ) }
129
+ </ Flex >
130
+ ) : null }
131
+ < Heading mt = "3" size = "3" >
132
+ { title }
133
+ </ Heading >
134
+ < Text color = "gray" mt = "2" size = "2" >
135
+ { dateFormatter . format ( createdAt ) }
136
+ </ Text >
137
+ </ article >
138
+ </ Link >
139
+ </ Card >
140
+ ) ,
141
+ ) }
142
+ </ Grid >
85
143
</ Section >
86
144
</ Container >
87
145
) ;
0 commit comments