mirror of
https://github.com/coder/coder.git
synced 2026-10-31 11:02:50 +08:00
revert(site): remove built-in emoji avatar inset (#28533)
> 🤖 This PR was written by Coder Agents on behalf of Jake Howell.
Reverts `75400428ad2b84c707f60fc5e6b378f46f565ef9` (`fix(site/src): give
built-in emoji avatars a consistent inset`).
The global built-in emoji detection and inline padding are causing
regressions. Revert this behavior so a replacement can be developed
separately.
## Changes
- Remove automatic `/emojis/` source detection from `Avatar`.
- Restore caller-controlled avatar variants and styles.
- Remove the built-in emoji inset stories.
## Verification
- Confirmed the resulting patch is the inverse of the target commit.
This commit is contained in:
@@ -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: "",
|
||||
|
||||
@@ -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 }))}
|
||||
{...props}
|
||||
>
|
||||
<AvatarPrimitive.Image
|
||||
|
||||
Reference in New Issue
Block a user