Skip to content

Commit

Permalink
Add discreet option to IconButton
Browse files Browse the repository at this point in the history
  • Loading branch information
phlmn authored and anuejn committed May 2, 2024
1 parent 24d8e74 commit da549d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frontend/src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ export function IconButton({
size,
iconClassName,
iconAfter = false,
discreet = false,
...props
}: {
icon: IconType;
label: string;
size?: number;
iconClassName?: string;
iconAfter?: boolean;
discreet?: boolean;
} & ComponentProps<'button'>) {
const Icon = icon;

Expand All @@ -68,9 +70,8 @@ export function IconButton({
title={label}
aria-label={label}
className={clsx(
'hover:bg-gray-200 dark:hover:bg-neutral-700',
!discreet && 'p-2 hover:bg-gray-200 dark:hover:bg-neutral-700',
'rounded-full',
'p-2',
props.className,
)}
>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export function HelpPopup({ children, className }: { children?: ReactNode; class
popupClassName="w-[300px]"
button={
<IconButton
className="inline-block !p-0 !bg-transparent"
className="inline-block"
discreet={true}
icon={IoHelpCircleOutline}
label={`help`}
/>
Expand Down

0 comments on commit da549d2

Please sign in to comment.