1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(ui): add icon to button [EE-3662] (#7204)

This commit is contained in:
Chaim Lev-Ari 2022-07-06 17:05:00 +03:00 committed by GitHub
parent b4acbfc9e1
commit 88c4a43a19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 104 additions and 27 deletions

View file

@ -1,5 +1,6 @@
import { Meta, Story } from '@storybook/react';
import { PropsWithChildren } from 'react';
import { Download } from 'react-feather';
import { Button, Props } from './Button';
@ -16,7 +17,7 @@ function Template({
}: JSX.IntrinsicAttributes & PropsWithChildren<Props>) {
return (
<Button onClick={onClick} color={color} size={size} disabled={disabled}>
<i className="fa fa-download" aria-hidden="true" /> Primary Button
Primary Button
</Button>
);
}
@ -63,11 +64,42 @@ export function Danger() {
);
}
export function ButtonIcon() {
return (
<Button color="primary" onClick={() => {}} icon={Download}>
Button with an icon
</Button>
);
}
export function ButtonIconLarge() {
return (
<Button color="primary" onClick={() => {}} icon={Download} size="large">
Button with an icon
</Button>
);
}
export function ButtonIconMedium() {
return (
<Button color="primary" onClick={() => {}} icon={Download} size="medium">
Button with an icon
</Button>
);
}
export function ButtonIconXSmall() {
return (
<Button color="primary" onClick={() => {}} icon={Download} size="xsmall">
Button with an icon
</Button>
);
}
export function Default() {
return (
<Button color="default" onClick={() => {}}>
<i className="fa fa-plus-circle" aria-hidden="true" /> Add an environment
variable
Default
</Button>
);
}