Skip to content

Commit

Permalink
chore: improve Reactions styles
Browse files Browse the repository at this point in the history
  • Loading branch information
enjidev committed Jan 11, 2023
1 parent 338007d commit 473bcc8
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 47 deletions.
92 changes: 48 additions & 44 deletions apps/enji.dev/src/components/Reactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,58 +78,62 @@ function Reactions() {
'dark:border-divider-dark dark:bg-slate-900/80'
)}
>
<div className={clsx('flex items-center gap-1')}>
<EmojiReaction
title="Claps"
defaultImage="/assets/emojis/clapping-hands.png"
animatedImage="/assets/emojis/clapping-hands-animated.png"
onClick={() => {
setClapCount((current) => current + 1);
}}
/>
<EmojiReaction
title="Wow"
defaultImage="/assets/emojis/astonished-face.png"
animatedImage="/assets/emojis/astonished-face-animated.png"
onClick={() => {
setAmazedCount((current) => current + 1);
}}
/>
</div>
<div className={clsx('flex items-center gap-2')}>
<ReactionCounter count={clapCount}>
<Image
className={clsx('h-4 w-4 select-none')}
alt="Claps"
src="/assets/emojis/clapping-hands.png"
width={48}
height={48}
quality={100}
priority
<div className={clsx('flex items-center gap-4')}>
<div className={clsx('flex items-center gap-1 pl-2')}>
<EmojiReaction
title="Claps"
defaultImage="/assets/emojis/clapping-hands.png"
animatedImage="/assets/emojis/clapping-hands-animated.png"
onClick={() => {
setClapCount((current) => current + 1);
}}
/>
</ReactionCounter>
<ReactionCounter count={amazedCount}>
<Image
className={clsx('h-4 w-4 select-none')}
alt="Amazed"
src="/assets/emojis/astonished-face.png"
width={48}
height={48}
quality={100}
priority
<EmojiReaction
title="Wow"
defaultImage="/assets/emojis/astonished-face.png"
animatedImage="/assets/emojis/astonished-face-animated.png"
onClick={() => {
setAmazedCount((current) => current + 1);
}}
/>
</ReactionCounter>
</div>
<div className={clsx('flex items-center gap-2')}>
<ReactionCounter count={clapCount}>
<Image
className={clsx('h-4 w-4 select-none')}
alt="Claps"
src="/assets/emojis/clapping-hands.png"
width={48}
height={48}
quality={100}
priority
/>
</ReactionCounter>
<ReactionCounter count={amazedCount}>
<Image
className={clsx('h-4 w-4 select-none')}
alt="Amazed"
src="/assets/emojis/astonished-face.png"
width={48}
height={48}
quality={100}
priority
/>
</ReactionCounter>
</div>
</div>
<div className={clsx('flex items-center gap-4')}>
<div className={clsx('hidden', 'sm:block')}>
<ReactionCounter count={sharedCount}>
<ShareIcon className={clsx('h-3 w-3')} />
</ReactionCounter>
</div>
<ShareButton
onItemClick={() => {
setSharedCount((current) => current + 1);
}}
/>
</div>
<ShareButton
onItemClick={() => {
setSharedCount((current) => current + 1);
}}
/>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/enji.dev/src/components/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function ShareButton({ onItemClick = () => {} }: ShareButtonProps) {
initial="hide"
animate="show"
className={clsx(
'border-divider-light absolute bottom-16 right-0 z-[902] flex w-full flex-col overflow-hidden rounded-2xl border bg-white pb-2 pt-1',
'border-divider-light absolute bottom-16 right-0 z-[902] flex w-56 flex-col overflow-hidden rounded-2xl border bg-white pb-2 pt-1',
'dark:border-divider-dark dark:bg-[#161e31]'
)}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/enji.dev/src/contents-layouts/Post/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function Post({
)}
>
<WithTableOfContentsMock>
<div className={clsx('mx-auto px-4', 'sm:max-w-[600px] lg:px-24')}>
<div className={clsx('mx-auto max-w-[360px]', 'sm:max-w-[420px]')}>
<Reactions />
</div>
</WithTableOfContentsMock>
Expand Down
2 changes: 1 addition & 1 deletion apps/enji.dev/src/contents-layouts/Project/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function ProjectLayout({
)}
>
<WithTableOfContentsMock>
<div className={clsx('mx-auto px-4', 'sm:max-w-[600px] lg:px-24')}>
<div className={clsx('mx-auto max-w-[360px]', 'sm:max-w-[420px]')}>
<Reactions />
</div>
</WithTableOfContentsMock>
Expand Down

0 comments on commit 473bcc8

Please sign in to comment.