Skip to content

Commit

Permalink
feat: move replaceImgUrlIfNeed
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Dec 10, 2024
1 parent 8e248ad commit 4a4ecee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions apps/server/client/components/ui/feed-certification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
TooltipTrigger,
} from "@follow/components/ui/tooltip/index.jsx"
import type { FeedOrListRespModel } from "@follow/models/types"
import { replaceImgUrlIfNeed } from "@follow/utils/img-proxy"
import { cn } from "@follow/utils/utils"
import { useTranslation } from "react-i18next"

Expand Down Expand Up @@ -60,7 +59,7 @@ export const FeedCertification = ({
<span>{t("feed_item.claimed_by_owner")}</span>
{feed.owner ? (
<Avatar className="inline-flex aspect-square size-5 rounded-full">
<AvatarImage src={replaceImgUrlIfNeed(feed.owner.image || undefined)} />
<AvatarImage src={feed.owner.image || undefined} />
<AvatarFallback>{feed.owner.name?.slice(0, 2)}</AvatarFallback>
</Avatar>
) : (
Expand Down
6 changes: 1 addition & 5 deletions apps/server/client/pages/(main)/share/users/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Button } from "@follow/components/ui/button/index.jsx"
import { FeedIcon } from "@follow/components/ui/feed-icon/index.jsx"
import { LoadingCircle } from "@follow/components/ui/loading/index.jsx"
import { useTitle } from "@follow/hooks"
import { replaceImgUrlIfNeed } from "@follow/utils/img-proxy"
import { UrlBuilder } from "@follow/utils/url-builder"
import { cn } from "@follow/utils/utils"
import { Fragment } from "react"
Expand All @@ -35,10 +34,7 @@ export const Component = () => {
) : (
<Fragment>
<Avatar className="aspect-square size-16">
<AvatarImage
className="duration-200 animate-in fade-in-0"
src={replaceImgUrlIfNeed(user.data?.image || undefined)}
/>
<AvatarImage className="duration-200 animate-in fade-in-0" src={user.data?.image} />
<AvatarFallback>{user.data?.name?.slice(0, 2)}</AvatarFallback>
</Avatar>
<div className="mb-8 flex flex-col items-center">
Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/ui/avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { replaceImgUrlIfNeed } from "@follow/utils/img-proxy"
import { cn } from "@follow/utils/utils"
import * as AvatarPrimitive from "@radix-ui/react-avatar"
import * as React from "react"
Expand All @@ -21,6 +22,7 @@ export const AvatarImage = React.forwardRef<
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square size-full", className)}
src={replaceImgUrlIfNeed(props.src)}
{...props}
/>
))
Expand Down

0 comments on commit 4a4ecee

Please sign in to comment.