Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass classnames to icons in base button #159

Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions src/__snapshots__/storybook.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ exports[`Storyshots Button Default 1`] = `
<span>
<span
aria-hidden={true}
className="icon iconWrapper"
className="icon my-btn-icon iconWrapper"
data-test-id="myButtonIconTestId"
id="myButtonIcon"
role="presentation"
Expand Down Expand Up @@ -830,7 +830,7 @@ exports[`Storyshots Button Neutral 1`] = `
<span>
<span
aria-hidden={true}
className="icon iconWrapper"
className="icon my-btn-icon iconWrapper"
data-test-id="myButtonIconTestId"
id="myButtonIcon"
role="presentation"
Expand Down Expand Up @@ -879,7 +879,7 @@ exports[`Storyshots Button Primary 1`] = `
<span>
<span
aria-hidden={true}
className="icon iconWrapper"
className="icon my-btn-icon iconWrapper"
data-test-id="myButtonIconTestId"
id="myButtonIcon"
role="presentation"
Expand Down Expand Up @@ -928,7 +928,7 @@ exports[`Storyshots Button Secondary 1`] = `
<span>
<span
aria-hidden={true}
className="icon iconWrapper"
className="icon my-btn-icon iconWrapper"
data-test-id="myButtonIconTestId"
id="myButtonIcon"
role="presentation"
Expand Down Expand Up @@ -1040,7 +1040,7 @@ exports[`Storyshots Button Toggle 1`] = `
<span>
<span
aria-hidden={true}
className="icon iconWrapper"
className="icon my-btn-icon iconWrapper"
data-test-id="myButtonIconTestId"
id="myButtonIcon"
role="presentation"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const BaseButton: FC<InternalButtonProps> = React.forwardRef(
const getButtonIcon = (): JSX.Element => (
<Icon
{...iconProps}
classNames={styles.icon}
classNames={mergeClasses([styles.icon, iconProps.classNames])}
size={getButtonIconSize()}
/>
);
Expand Down