Skip to content

Commit a9df592

Browse files
committed
Add button stories
1 parent 95558c2 commit a9df592

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

frontend/src/app/jira-control/avatar/avatar.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
} as Meta;
88

99
const avatarUrl =
10-
'https://res.cloudinary.com/dvujyxh7e/image/upload/c_scale,%3Cspan%20class="x x-first x-last">w_48/v1593253478/trung-vo_bioxmc.png';
10+
'https://res.cloudinary.com/dvujyxh7e/image/upload/c_scale,%3Cspan%20class="x x-first x-last">w_128/v1593253478/trung-vo_bioxmc.png';
1111

1212
const Template: Story<AvatarComponent> = (args: AvatarComponent) => ({
1313
component: AvatarComponent,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Meta, Story } from '@storybook/angular';
2+
import { ButtonComponent } from './button.component';
3+
4+
export default {
5+
title: 'Components/Button',
6+
component: ButtonComponent
7+
} as Meta;
8+
9+
interface ButtonProps extends ButtonComponent {
10+
label: string;
11+
}
12+
13+
const Template: Story<ButtonComponent> = ({ label, className }: Partial<ButtonProps>) => ({
14+
component: ButtonComponent,
15+
moduleMetadata: {
16+
declarations: [ButtonComponent], // Removed if no template
17+
imports: []
18+
},
19+
template: `<j-button className='${className}'>${label}</j-button>`
20+
});
21+
22+
export const Primary: Story<ButtonProps> = Template.bind({});
23+
Primary.args = {
24+
className: 'btn-primary',
25+
label: 'Primary'
26+
};
27+
28+
export const Secondary: Story<ButtonProps> = Template.bind({});
29+
Secondary.args = {
30+
className: 'btn-secondary',
31+
label: 'Secondary'
32+
};
33+
34+
export const Empty: Story<ButtonProps> = Template.bind({});
35+
Empty.args = {
36+
icon: "times",
37+
className: 'btn-empty',
38+
label: 'Cancel'
39+
};

0 commit comments

Comments
 (0)