@@ -80,27 +80,32 @@ function RelatedPostsForGuest({
80
80
< h4 > 관심 있을 만한 포스트</ h4 >
81
81
{ postsWithAds . map ( ( post , index ) => {
82
82
return post ? (
83
- < Row key = { post . id ?? index } >
84
- < div className = "fourty" >
85
- < div className = "thumbnail-wrapper" >
86
- < img
87
- src = { optimizeImage (
88
- post . thumbnail ??
89
- post . user . profile . thumbnail ??
90
- userThumbnail ,
91
- 640 ,
92
- ) }
93
- alt = { post . title }
94
- />
83
+ < Row >
84
+ < StyledRowLink
85
+ to = { `/@${ post . user . username } /${ post . url_slug } ` }
86
+ key = { post . id ?? index }
87
+ >
88
+ < div className = "fourty" >
89
+ < div className = "thumbnail-wrapper" >
90
+ < img
91
+ src = { optimizeImage (
92
+ post . thumbnail ??
93
+ post . user . profile . thumbnail ??
94
+ userThumbnail ,
95
+ 640 ,
96
+ ) }
97
+ alt = { post . title }
98
+ />
99
+ </ div >
95
100
</ div >
96
- </ div >
97
- < div className = "content" >
98
- < h5 > { post . title } </ h5 >
99
- < p >
100
- { post . short_description . replace ( / & # x 3 A ; / g , ':' ) }
101
- { post . short_description . length === 150 && '...' }
102
- </ p >
103
- </ div >
101
+ < div className = "content" >
102
+ < h5 > { post . title } </ h5 >
103
+ < p >
104
+ { post . short_description . replace ( / & # x 3 A ; / g , ':' ) }
105
+ { post . short_description . length === 150 && '...' }
106
+ </ p >
107
+ </ div >
108
+ </ StyledRowLink >
104
109
</ Row >
105
110
) : (
106
111
< Row >
@@ -170,12 +175,17 @@ const Grid = styled.div`
170
175
margin-top: 1.5rem;
171
176
` ;
172
177
173
- const Row = styled . div `
174
- display: flex;
175
- .fourty {
176
- width: 40%;
177
- margin-right: 0.75rem;
178
+ const Item = styled . div `
179
+ position: relative;
180
+ width: 33.333%;
181
+ padding-left: 0.25rem;
182
+ padding-right: 0.25rem;
183
+ padding-bottom: 2rem;
184
+ ${ media . medium } {
185
+ width: 50%;
186
+ padding-bottom: 1rem;
178
187
}
188
+
179
189
.thumbnail-wrapper {
180
190
width: 100%;
181
191
padding-top: 52.35%;
@@ -191,45 +201,37 @@ const Row = styled.div`
191
201
display: block;
192
202
}
193
203
}
194
- & + & {
195
- margin-top: 0.5rem;
196
- }
197
- .content {
198
- width: 60%;
199
- }
200
204
h5 {
201
- margin-top: 0;
202
- margin-bottom: 0.625rem;
203
- font-size: 0.875rem;
204
- color: ${ palette . gray8 } ;
205
- ${ ellipsis }
206
- }
207
-
208
- p {
209
- margin: 0;
210
- font-size: 0.75rem;
211
- display: -webkit-box;
212
- -webkit-line-clamp: 3;
205
+ font-size: 1rem;
213
206
line-height: 1.5;
214
- height: 3.375rem ;
215
- overflow: hidden ;
216
- word-break: keep-all ;
217
- color: ${ palette . gray6 } ;
207
+ margin-top: 0.5rem ;
208
+ margin-bottom: 0 ;
209
+ display: -webkit-box ;
210
+ -webkit-line-clamp: 2 ;
218
211
-webkit-box-orient: vertical;
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ text-decoration: none;
215
+ color: inherit;
216
+ color: ${ palette . gray8 } ;
219
217
}
220
218
` ;
221
219
222
- const Item = styled . div `
223
- position: relative;
224
- width: 33.333%;
225
- padding-left: 0.25rem;
226
- padding-right: 0.25rem;
227
- padding-bottom: 2rem;
228
- ${ media . medium } {
229
- width: 50%;
230
- padding-bottom: 1rem;
220
+ const Row = styled . div `
221
+ & + & {
222
+ margin-top: 0.5rem;
223
+ }
224
+ ` ;
225
+ const StyledRowLink = styled ( Link ) `
226
+ width: 100%;
227
+ display: flex;
228
+ text-decoration: none;
229
+ color: inherit;
230
+ display: flex;
231
+ .fourty {
232
+ width: 40%;
233
+ margin-right: 0.75rem;
231
234
}
232
-
233
235
.thumbnail-wrapper {
234
236
width: 100%;
235
237
padding-top: 52.35%;
@@ -245,19 +247,30 @@ const Item = styled.div`
245
247
display: block;
246
248
}
247
249
}
250
+
251
+ .content {
252
+ flex: 1;
253
+ min-width: 0;
254
+ }
248
255
h5 {
249
- font-size: 1rem;
250
- line-height: 1.5;
251
- margin-top: 0.5rem;
252
- margin-bottom: 0;
256
+ margin-top: 0;
257
+ margin-bottom: 0.5rem;
258
+ font-size: 0.875rem;
259
+ color: ${ palette . gray8 } ;
260
+ ${ ellipsis }
261
+ }
262
+
263
+ p {
264
+ margin: 0;
265
+ font-size: 0.75rem;
253
266
display: -webkit-box;
254
267
-webkit-line-clamp: 2;
255
- -webkit-box-orient: vertical;
268
+ line-height: 1.5;
269
+ height: 2.25rem;
256
270
overflow: hidden;
257
- text-overflow: ellipsis;
258
- text-decoration: none;
259
- color: inherit;
260
- color: ${ palette . gray8 } ;
271
+ word-break: keep-all;
272
+ color: ${ palette . gray6 } ;
273
+ -webkit-box-orient: vertical;
261
274
}
262
275
` ;
263
276
0 commit comments