mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
Remove onClick option from Icon.tsx
This commit is contained in:
@@ -32,10 +32,6 @@ const Wrapper = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const helloWorld = () => {
|
||||
alert("Hello world!");
|
||||
};
|
||||
|
||||
const colors = ["primary", "link", "info", "success", "warning", "danger", "white", "light", "dark", "black", "text"];
|
||||
const sizing = ["xs", "sm", "lg", "2x", "3x", "5x", "7x", "10x"];
|
||||
|
||||
@@ -77,11 +73,6 @@ storiesOf("Icon", module)
|
||||
<Icon title="rotate-270" name="snowboarding fa-rotate-270" />
|
||||
<Icon title="spin" name="spinner fa-spin" />
|
||||
<Icon title="custom sizing" name="cat" className="is-size-4" />
|
||||
<Icon
|
||||
title="custom background and onClick"
|
||||
name="hand-sparkles"
|
||||
className="has-background-primary-25"
|
||||
onClick={() => helloWorld()}
|
||||
/>
|
||||
<Icon title="custom background" name="hand-sparkles" className="has-background-primary-25" />
|
||||
</>
|
||||
));
|
||||
|
||||
@@ -30,7 +30,6 @@ type Props = {
|
||||
name: string;
|
||||
color: string;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
};
|
||||
|
||||
export default class Icon extends React.Component<Props> {
|
||||
@@ -40,16 +39,12 @@ export default class Icon extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { title, iconStyle, name, color, className, onClick } = this.props;
|
||||
const { title, iconStyle, name, color, className } = this.props;
|
||||
if (title) {
|
||||
return (
|
||||
<i
|
||||
title={title}
|
||||
className={classNames(iconStyle, "fa-fw", "fa-" + name, `has-text-${color}`, className)}
|
||||
onClick={onClick}
|
||||
/>
|
||||
<i title={title} className={classNames(iconStyle, "fa-fw", "fa-" + name, `has-text-${color}`, className)} />
|
||||
);
|
||||
}
|
||||
return <i className={classNames(iconStyle, "fa-" + name, `has-text-${color}`, className)} onClick={onClick} />;
|
||||
return <i className={classNames(iconStyle, "fa-" + name, `has-text-${color}`, className)} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32820,8 +32820,7 @@ exports[`Storyshots Icon More options 1`] = `
|
||||
/>
|
||||
<i
|
||||
className="fas fa-fw fa-hand-sparkles has-text-grey-light has-background-primary-25"
|
||||
onClick={[Function]}
|
||||
title="custom background and onClick"
|
||||
title="custom background"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user