Skip to content

Commit 979633b

Browse files
authored
Merge pull request #426 from lifeomic/icon-button-primary-color
Add `primary` as an option for `color` prop on `<IconButton`
2 parents 68f6d23 + 347c1b5 commit 979633b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/components/IconButton/IconButton.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ export const useStyles = makeStyles(
7878
opacity: 0.44,
7979
},
8080
},
81+
primary: {
82+
color: theme.palette.primary.main,
83+
'&:hover, &:focus': {
84+
color: theme.palette.primary[900],
85+
},
86+
'&:disabled': {
87+
color: theme.palette.primary.main,
88+
opacity: 0.44,
89+
},
90+
},
8191
size0: {
8292
'& > svg': {
8393
width: 18,
@@ -147,7 +157,7 @@ export type IconButtonClasses = GetClasses<typeof useStyles>;
147157
export interface IconButtonProps
148158
extends React.ComponentPropsWithoutRef<'button'> {
149159
['aria-label']: string;
150-
color?: 'default' | 'inverse' | 'negative' | 'positive';
160+
color?: 'default' | 'inverse' | 'negative' | 'positive' | 'primary';
151161
icon: React.MemoExoticComponent<
152162
(props: React.SVGProps<SVGSVGElement>) => JSX.Element
153163
>;
@@ -204,6 +214,7 @@ export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
204214
[classes.inverse]: color === 'inverse',
205215
[classes.negative]: color === 'negative',
206216
[classes.positive]: color === 'positive',
217+
[classes.primary]: color === 'primary',
207218
},
208219
{
209220
[classes.paddingTop0]: paddingTop === 0,

0 commit comments

Comments
 (0)