Skip to content

Commit

Permalink
Merge pull request #261 from web3ui/fix/remove-onclick-event-icon
Browse files Browse the repository at this point in the history
fix: remove onClick event from Icon component
  • Loading branch information
dani69654 authored Mar 10, 2022
2 parents 1213092 + b969db5 commit 29c0a35
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/components/Icon/Icon.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export const StyledIconDiv = styled.div`
flex-direction: column;
justify-content: center;
line-height: 0px;
pointer-events: none;
`;
7 changes: 1 addition & 6 deletions src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { IconProps } from './types';

const Icon: React.FC<IconProps> = ({
fill = 'inherit',
onClick = () => {},
size = 18,
svg,
style,
Expand All @@ -22,11 +21,7 @@ const Icon: React.FC<IconProps> = ({
return collection[key](fill, size, style);
};

return (
<StyledIconDiv onClick={onClick}>
{getIcon(fill, size, svg, style)}
</StyledIconDiv>
);
return <StyledIconDiv>{getIcon(fill, size, svg, style)}</StyledIconDiv>;
};

export default Icon;
5 changes: 0 additions & 5 deletions src/components/Icon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ export interface IconProps {
*/
fill?: string;

/**
* Run function if Icon is clikec
*/
onClick?: () => void;

/**
* set a pixel size, SVGs render as a square icons
*/
Expand Down

0 comments on commit 29c0a35

Please sign in to comment.