Skip to content

Commit 03ce13d

Browse files
committed
fix: feedIcon margin
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 44646d8 commit 03ce13d

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

apps/renderer/src/modules/boost/modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => {
5252
return (
5353
<div className="flex w-full flex-col gap-3 lg:w-[80vw] lg:max-w-[350px]">
5454
<div className="center flex flex-col gap-2">
55-
<FeedIcon className="mr-0" feed={feed} size={50} />
55+
<FeedIcon noMargin feed={feed} size={50} />
5656

5757
<h1 className="center mt-2 flex flex-wrap text-lg font-bold">
5858
<div className="center flex shrink-0">

apps/renderer/src/modules/discover/recommendations-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const RecommendationCard: FC<RecommendationCardProps> = memo(
5656
<CardTitle className="relative z-[1] flex items-center pt-[10px] text-base @[280px]:pt-10">
5757
<span className="center box-content flex aspect-square rounded-full bg-background p-1.5">
5858
<span className="overflow-hidden rounded-full">
59-
<FeedIcon size={28} className="mr-0" siteUrl={`https://${data.url}`} />
59+
<FeedIcon size={28} noMargin siteUrl={`https://${data.url}`} />
6060
</span>
6161
</span>
6262
<a

apps/renderer/src/modules/entry-content/components/SupportCreator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const SupportCreator = ({ entryId }: { entryId: string }) => {
5050
enableModal
5151
/>
5252
) : (
53-
<FeedIcon className="mr-0 w-40 flex-col gap-3 p-0" size={46} feed={feed} fallback />
53+
<FeedIcon noMargin className="w-40 flex-col gap-3 p-0" size={46} feed={feed} fallback />
5454
)}
5555
<span className="-mt-6 text-lg font-medium">{feed.title}</span>
5656

apps/renderer/src/modules/feed/feed-icon.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function FeedIcon({
8686
siteUrl,
8787
useMedia,
8888
disableFadeIn,
89+
noMargin,
8990
}: {
9091
feed?: FeedIconFeed | null
9192
entry?: FeedIconEntry | null
@@ -100,7 +101,9 @@ export function FeedIcon({
100101

101102
useMedia?: boolean
102103
disableFadeIn?: boolean
104+
noMargin?: boolean
103105
}) {
106+
const marginClassName = noMargin ? "" : "mr-2"
104107
const image =
105108
(useMedia
106109
? entry?.media?.find((i) => i.type === "photo")?.url || entry?.authorAvatar
@@ -139,7 +142,7 @@ export function FeedIcon({
139142
className={cn(
140143
"flex shrink-0 items-center justify-center rounded-sm",
141144
"text-white",
142-
"mr-2",
145+
marginClassName,
143146
className,
144147
)}
145148
>
@@ -176,7 +179,7 @@ export function FeedIcon({
176179
ImageElement = (
177180
<PlatformIcon url={image} style={sizeStyle} className={cn("center", className)}>
178181
<m.img
179-
className={cn("mr-2", className)}
182+
className={cn(marginClassName, className)}
180183
style={sizeStyle}
181184
{...(disableFadeIn ? {} : fadeInVariant)}
182185
/>
@@ -203,7 +206,7 @@ export function FeedIcon({
203206
className={cn("center", className)}
204207
>
205208
<FallbackableImage
206-
className={cn("mr-2", className)}
209+
className={cn(marginClassName, className)}
207210
style={sizeStyle}
208211
fallbackUrl={fallbackSrc}
209212
/>
@@ -212,15 +215,19 @@ export function FeedIcon({
212215
break
213216
}
214217
case feed?.type === "inbox": {
215-
ImageElement = <i className="i-mgc-inbox-cute-fi mr-2 shrink-0" style={sizeStyle} />
218+
ImageElement = (
219+
<i className={cn("i-mgc-inbox-cute-fi shrink-0", marginClassName)} style={sizeStyle} />
220+
)
216221
break
217222
}
218223
case !!feed?.title && !!feed.title[0]: {
219224
ImageElement = fallbackIcon
220225
break
221226
}
222227
default: {
223-
ImageElement = <i className="i-mgc-link-cute-re mr-2 shrink-0" style={sizeStyle} />
228+
ImageElement = (
229+
<i className={cn("i-mgc-link-cute-re shrink-0", marginClassName)} style={sizeStyle} />
230+
)
224231
break
225232
}
226233
}
@@ -231,7 +238,7 @@ export function FeedIcon({
231238

232239
if (fallback && !!finalSrc) {
233240
return (
234-
<Avatar className="mr-2 shrink-0" style={sizeStyle}>
241+
<Avatar className={cn("shrink-0", marginClassName)} style={sizeStyle}>
235242
<AvatarImage className="rounded-sm object-cover" asChild src={finalSrc}>
236243
{ImageElement}
237244
</AvatarImage>
@@ -246,12 +253,12 @@ export function FeedIcon({
246253
if (!finalSrc) return ImageElement
247254
// Else
248255
return (
249-
<Avatar className="shrink-0" style={sizeStyle}>
256+
<Avatar className={cn("shrink-0", marginClassName)} style={sizeStyle}>
250257
<AvatarImage asChild src={finalSrc}>
251258
{ImageElement}
252259
</AvatarImage>
253260
<AvatarFallback delayMs={200}>
254-
<div className={cn("mr-2", className)} style={sizeStyle} data-placeholder={finalSrc} />
261+
<div className={className} style={sizeStyle} data-placeholder={finalSrc} />
255262
</AvatarFallback>
256263
</Avatar>
257264
)

apps/renderer/src/modules/settings/tabs/lists/modals.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const RowRender = ({ feedId, listId }: { feedId: string; listId: string }) => {
302302
href={UrlBuilder.shareFeed(feed.id)}
303303
className="flex items-center gap-2 font-semibold"
304304
>
305-
{feed.siteUrl && <FeedIcon className="mr-0" siteUrl={feed.siteUrl} />}
305+
{feed.siteUrl && <FeedIcon noMargin siteUrl={feed.siteUrl} />}
306306
<span className="inline-block max-w-[200px] truncate">{feed.title}</span>
307307
</a>
308308
</TableCell>

0 commit comments

Comments
 (0)