1
- import {
2
- Player ,
3
- usePlayerAtomSelector ,
4
- } from "@renderer/atoms/player"
1
+ import { Player , usePlayerAtomSelector } from "@renderer/atoms/player"
5
2
import { FeedIcon } from "@renderer/components/feed-icon"
6
3
import { RelativeTime } from "@renderer/components/ui/datetime"
7
4
import { Media } from "@renderer/components/ui/media"
8
5
import { FEED_COLLECTION_LIST } from "@renderer/constants"
9
6
import { useAsRead } from "@renderer/hooks/biz/useAsRead"
10
7
import { useRouteParamsSelector } from "@renderer/hooks/biz/useRouteParams"
11
- import { cn } from "@renderer/lib/utils"
8
+ import { cn , isSafari } from "@renderer/lib/utils"
12
9
import { EntryTranslation } from "@renderer/modules/entry-column/translation"
13
10
import { useEntry } from "@renderer/store/entry/hooks"
14
11
import { useFeedById } from "@renderer/store/feed"
@@ -43,6 +40,7 @@ export function ListItem({
43
40
const displayTime = inInCollection ?
44
41
entry . collections ?. createdAt :
45
42
entry . entries . publishedAt
43
+ const envIsSafari = isSafari ( )
46
44
return (
47
45
< div
48
46
className = { cn (
@@ -52,7 +50,14 @@ export function ListItem({
52
50
) }
53
51
>
54
52
{ ! withAudio && < FeedIcon feed = { feed } fallback entry = { entry . entries } /> }
55
- < div className = "-mt-0.5 line-clamp-4 flex-1 text-sm leading-tight" >
53
+ < div
54
+ className = { cn (
55
+ "-mt-0.5 flex-1 text-sm leading-tight" ,
56
+
57
+ // FIXME: Safari bug, not support line-clamp cross elements
58
+ ! envIsSafari && "line-clamp-4" ,
59
+ ) }
60
+ >
56
61
< div
57
62
className = { cn (
58
63
"flex gap-1 text-[10px] font-bold" ,
@@ -79,6 +84,7 @@ export function ListItem({
79
84
>
80
85
{ entry . entries . title ? (
81
86
< EntryTranslation
87
+ className = { envIsSafari ? "line-clamp-2 break-all" : undefined }
82
88
source = { entry . entries . title }
83
89
target = { translation ?. title }
84
90
/>
@@ -100,6 +106,7 @@ export function ListItem({
100
106
) }
101
107
>
102
108
< EntryTranslation
109
+ className = { envIsSafari ? "line-clamp-2 break-all" : undefined }
103
110
source = { entry . entries . description }
104
111
target = { translation ?. description }
105
112
/>
@@ -115,7 +122,14 @@ export function ListItem({
115
122
String ( entry . entries ?. attachments ?. [ 0 ] . duration_in_seconds ?? 0 ) ,
116
123
10 ,
117
124
) }
118
- feedIcon = { < FeedIcon feed = { feed } entry = { entry . entries } size = { 80 } className = "m-0" /> }
125
+ feedIcon = { (
126
+ < FeedIcon
127
+ feed = { feed }
128
+ entry = { entry . entries }
129
+ size = { 80 }
130
+ className = "m-0"
131
+ />
132
+ ) }
119
133
/>
120
134
) }
121
135
@@ -187,12 +201,10 @@ function AudioCover({
187
201
>
188
202
< i
189
203
className = { cn ( "size-6" , {
190
- "i-mingcute-pause-fill" :
191
- playStatus && playStatus === "playing" ,
204
+ "i-mingcute-pause-fill" : playStatus && playStatus === "playing" ,
192
205
"i-mingcute-loading-fill animate-spin" :
193
206
playStatus && playStatus === "loading" ,
194
- "i-mingcute-play-fill" :
195
- ! playStatus || playStatus === "paused" ,
207
+ "i-mingcute-play-fill" : ! playStatus || playStatus === "paused" ,
196
208
} ) }
197
209
/>
198
210
</ button >
0 commit comments