Skip to content

Commit

Permalink
refactor(member): extend ReactionButtonProps with `React.ButtonHTML…
Browse files Browse the repository at this point in the history
…Attributes`
  • Loading branch information
Jeong-Ag committed Dec 23, 2024
1 parent 02596fb commit 481094a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/member/src/components/common/Comment/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Comment = ({
className="flex items-center space-x-2"
countNumber={likes}
onClick={() => commentLikesMutate(id)}
isPending={isPending}
disabled={isPending}
>
<ThumbUpOutline />
</ReactionButton>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import { cn } from '@clab-platforms/utils';

interface ReactionButtonProps {
interface ReactionButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
children: React.ReactNode;
onClick?: () => void;
className?: string;
countNumber?: number;
isPending?: boolean;
}
const ReactionButton = ({
onClick,
className,
countNumber,
children,
isPending,
className,
...props
}: ReactionButtonProps) => {
return (
<button
onClick={onClick}
className={cn('p-1', className)}
disabled={isPending}
>
<button className={cn('p-1', className)} {...props}>
{children}
<p className="font-semibold text-gray-600">{countNumber ?? 0}</p>
</button>
Expand Down

0 comments on commit 481094a

Please sign in to comment.