Skip to content

Commit

Permalink
refactor(emoji): define assetSize variable
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwooseong committed Aug 1, 2024
1 parent 245baa3 commit 3c10b3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/bezier-react/src/components/Emoji/Emoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Emoji = forwardRef<HTMLDivElement, EmojiProps>(function Emoji(
{ style, imageUrl, className, name, size = '24', ...rest },
forwardedRef
) {
const url = imageUrl ?? getEmojiUrl(name, Number(size) >= 60 ? '160' : '80')
const assetSize = Number(size) >= 60 ? '160' : '80'

return (
<div
Expand All @@ -38,7 +38,9 @@ export const Emoji = forwardRef<HTMLDivElement, EmojiProps>(function Emoji(
aria-description={name}
style={
{
'--b-emoji-background-image': cssUrl(url),
'--b-emoji-background-image': cssUrl(
imageUrl ?? getEmojiUrl(name, assetSize)
),
...style,
} as CSSProperties
}
Expand Down

0 comments on commit 3c10b3e

Please sign in to comment.