-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change avatar to use nextjs image url
- Loading branch information
Magnus Alexander Strømseng
committed
Apr 10, 2024
1 parent
12dace8
commit b95948d
Showing
3 changed files
with
22 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import React from "react"; | ||
| import * as AvatarPrimitive from "@radix-ui/react-avatar"; | ||
| import { cn } from "@/lib/utils"; | ||
| const STRAPI_URL = process.env.STRAPI_URL; | ||
|
|
||
| const AvatarImageFix = React.forwardRef< | ||
| React.ElementRef<typeof AvatarPrimitive.Image>, | ||
| React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> | ||
| >(({ className, src, ...props }, ref) => ( | ||
| <AvatarPrimitive.Image | ||
| ref={ref} | ||
| className={cn("aspect-square h-full w-full", className)} | ||
| src={STRAPI_URL + "_next/image?url=" + src + "&w=100&q=100"} | ||
| {...props} | ||
| /> | ||
| )); | ||
| AvatarImageFix.displayName = "AvatarImageFix"; | ||
|
|
||
| export { AvatarImageFix }; |
This file was deleted.
Oops, something went wrong.