Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions site/src/components/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@ export const NonSquaredIcon: Story = {
},
};

export const BuiltInEmojiLgSize: Story = {
args: {
size: "lg",
src: "/emojis/1f64c.png",
},
};

export const BuiltInEmojiMdSize: Story = {
args: {
src: "/emojis/1f64c.png",
},
};

export const BuiltInEmojiSmSize: Story = {
args: {
size: "sm",
src: "/emojis/1f64c.png",
},
};

export const FallbackLgSize: Story = {
args: {
src: "",
Expand Down
15 changes: 1 addition & 14 deletions site/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,13 @@ export const Avatar: React.FC<AvatarProps> = ({
fallback,
alt = "",
children,
style,
...props
}) => {
const { externalImages } = useAppearance();

const isEmoji = src?.startsWith("/emojis/");

return (
<AvatarPrimitive.Root
className={cn(
avatarVariants({
size,
variant: isEmoji ? "default" : variant,
className,
}),
)}
style={{
...style,
padding: isEmoji ? "20%" : style?.padding,
}}
className={cn(avatarVariants({ size, variant, className }))}

This comment was marked as low quality.

{...props}
>
<AvatarPrimitive.Image
Expand Down
Loading