Skip to content

Commit

Permalink
refactor: Pager story
Browse files Browse the repository at this point in the history
  • Loading branch information
samshara committed Jun 11, 2024
1 parent 47dce59 commit 603e94d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
10 changes: 4 additions & 6 deletions packages/go-ui-storybook/src/stories/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import {
ProgressBar as PureProgressBar,
ProgressBarProps as PureProgressBarProps,
ProgressBarProps,
} from '@ifrc-go/ui';

interface ProgressBarProps extends PureProgressBarProps{}

function WrappedProgressBar(props: ProgressBarProps) {
function ProgressBar(props: ProgressBarProps) {
return (
// eslint-disable-next-line react/jsx-props-no-spreading
// eslint-disable-next-line react/jsx-props-no-spreading
<PureProgressBar {...props} />
);
}

export default WrappedProgressBar;
export default ProgressBar;
19 changes: 10 additions & 9 deletions packages/go-ui-storybook/src/stories/Progressbar.stories.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ProgressBarProps } from '@ifrc-go/ui';
import type {
Meta,
StoryObj,
Expand All @@ -12,7 +13,7 @@ const meta = {
layout: 'centered',
design: {
type: 'figma',
url: 'https://www.figma.com/file/myeW85ibN5p2SlnXcEpxFD/IFRC-GO---UI-Current---1?type=design&node-id=0-4957&mode=design&t=KwxbuoUQxqcLyZbG-0',
url: 'https://www.figma.com/file/k9SOqgh5jk9PxzuBKdMKsA/IFRC-GO---UI-Library?node-id=14425-221303&t=tvoCZGUCjrbFSV16-4',
allowFullscreen: true,
},
},
Expand All @@ -21,28 +22,28 @@ const meta = {
} satisfies Meta<typeof ProgressBar>;

export default meta;
type Story = StoryObj<typeof meta>;

type Story = StoryObj<ProgressBarProps>;

export const Default: Story = {
args: {
className: 'progress-bar',
value: 50,
title: 'Total People',
totalValue: 100,
showPercentageInTitle: true,
value: 75,
title: 'Total Projects Completed',
totalValue: 150,
},
};

export const WithTitle : Story = {
export const WithPercentageInTitle: Story = {
args: {
...Default.args,
title: 'Total People',
showPercentageInTitle: true,
},
};

export const WithDescription: Story = {
args: {
...Default.args,
description: 'Loading progress of a file',
description: 'Number of projects completed successfully this year.',
},
};
4 changes: 2 additions & 2 deletions packages/go-ui-storybook/src/stories/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@
}

.progress-bar{
width:10rem;
}
width:20rem;
}

0 comments on commit 603e94d

Please sign in to comment.