Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion apps/web/src/components/pullRequest/PullRequestReactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export function PullRequestReactionBar({
reference,
onRefresh,
className,
compact = false,
}: {
readonly reactions: ReadonlyArray<PullRequestReaction>;
readonly canReact: boolean;
Expand All @@ -60,6 +61,7 @@ export function PullRequestReactionBar({
readonly reference: PullRequestRef;
readonly onRefresh: () => void;
readonly className?: string | undefined;
readonly compact?: boolean;
}) {
const [pickerOpen, setPickerOpen] = useState(false);
const [pending, setPending] = useState<{
Expand Down Expand Up @@ -110,6 +112,7 @@ export function PullRequestReactionBar({
disabled={!canReact}
className={cn(
PILL_CLASS,
compact && "h-5 px-1.5",
reaction.viewerHasReacted
? "border-primary/60 bg-primary/10 text-foreground"
: "border-border/70 bg-muted/40 text-muted-foreground",
Expand All @@ -136,14 +139,15 @@ export function PullRequestReactionBar({
className={cn(
PILL_CLASS,
"border-border/70 px-1.5 text-muted-foreground hover:border-primary/60 hover:text-foreground",
compact && "h-5 px-1",
shown.length === 0 &&
!pickerOpen &&
"opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100",
)}
/>
}
>
<SmilePlusIcon aria-hidden className="size-3.5" />
<SmilePlusIcon aria-hidden className={compact ? "size-3" : "size-3.5"} />
</PopoverTrigger>
<PopoverPopup align="start" className="w-auto" side="top" viewportClassName="py-2">
<div className="flex items-center gap-0.5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ export function PullRequestSummaryTab({
</div>
)}
<PullRequestReactionBar
className="mt-2"
compact
reactions={detail.reactions ?? []}
canReact={detail.capabilities.reactions === true}
environmentId={environmentId}
Expand Down
Loading