Skip to content

Commit

Permalink
chore: updating constant names to be consistent with other components
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Jan 29, 2025
1 parent 1176268 commit 9059d5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { IconSize } from '../icon';
import { ButtonIconSize } from './ButtonIcon.types';

export const BUTTON_ICON_SIZE_CLASSMAP = {
export const BUTTON_ICON_SIZE_CLASS_MAP = {
[ButtonIconSize.Sm]: 'h-6 w-6',
[ButtonIconSize.Md]: 'h-8 w-8',
[ButtonIconSize.Lg]: 'h-10 w-10',
} as const;

export const BUTTON_ICON_SIZE_TO_ICON_SIZE_MAP = {
export const BUTTON_ICON_SIZE_TO_ICON_SIZE_CLASS_MAP = {
[ButtonIconSize.Sm]: IconSize.Sm,
[ButtonIconSize.Md]: IconSize.Md,
[ButtonIconSize.Lg]: IconSize.Lg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { twMerge } from '../../utils/tw-merge';
import { ButtonBase } from '../button-base';
import { Icon } from '../icon';
import {
BUTTON_ICON_SIZE_CLASSMAP,
BUTTON_ICON_SIZE_TO_ICON_SIZE_MAP,
BUTTON_ICON_SIZE_CLASS_MAP,
BUTTON_ICON_SIZE_TO_ICON_SIZE_CLASS_MAP,
} from './ButtonIcon.constants';
import type { ButtonIconProps } from './ButtonIcon.types';
import { ButtonIconSize } from './ButtonIcon.types';
Expand All @@ -32,7 +32,7 @@ export const ButtonIcon = React.forwardRef<HTMLButtonElement, ButtonIconProps>(
// Base styles
'p-0',
// Size styles
BUTTON_ICON_SIZE_CLASSMAP[size],
BUTTON_ICON_SIZE_CLASS_MAP[size],
// Floating styles
isFloating && [
'rounded-full',
Expand Down Expand Up @@ -60,7 +60,7 @@ export const ButtonIcon = React.forwardRef<HTMLButtonElement, ButtonIconProps>(
>
<Icon
name={iconName}
size={BUTTON_ICON_SIZE_TO_ICON_SIZE_MAP[size]}
size={BUTTON_ICON_SIZE_TO_ICON_SIZE_CLASS_MAP[size]}
className={twMerge('text-inherit', iconProps?.className)}
{...iconProps}
/>
Expand Down

0 comments on commit 9059d5c

Please sign in to comment.