Skip to content

Commit

Permalink
Improve animations controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadorequest committed Jan 14, 2021
1 parent f216066 commit 57f418d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
11 changes: 9 additions & 2 deletions src/stories/nrn/animation/Animated3Dots.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import Animated3Dots, { Props } from '../../../components/svg/Animated3Dots';
export default {
title: 'Next Right Now/Animation/Animated3Dots',
component: Animated3Dots,
argTypes: {},
argTypes: {
fill: {
control: 'color',
},
},
} as Meta;

export const DefaultExample: Story<Props> = () => <Animated3Dots fill={'blue'} />;
export const DefaultExample: Story<Props> = (props) => <Animated3Dots {...props} />;
DefaultExample.args = {
fill: 'blue',
};
11 changes: 9 additions & 2 deletions src/stories/nrn/animation/AnimatedTextBubble.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ import AnimatedTextBubble, { Props } from '../../../components/svg/AnimatedTextB
export default {
title: 'Next Right Now/Animation/AnimatedTextBubble',
component: AnimatedTextBubble,
argTypes: {},
argTypes: {
fill: {
control: 'color',
},
},
} as Meta;

export const DefaultExample: Story<Props> = () => <AnimatedTextBubble fill={'blue'} />;
export const DefaultExample: Story<Props> = (props) => <AnimatedTextBubble {...props} />;
DefaultExample.args = {
fill: 'blue',
};
11 changes: 7 additions & 4 deletions src/stories/nrn/animation/BubbleTimer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ export default {
argTypes: {},
} as Meta;

export const DefaultExample: Story<Props> = () => {
const duration = 2000;
export const DefaultExample: Story<Props> = (props) => {
const { duration } = props;

return (
<BubbleTimer
fill={'blue'}
duration={duration}
{...props}
>
<p>Content displayed after {duration}ms has passed.</p>
</BubbleTimer>
);
};
DefaultExample.args = {
fill: 'blue',
duration: 2000,
};
6 changes: 5 additions & 1 deletion src/stories/nrn/animation/Loader.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import Loader, { Props } from '../../../components/animations/Loader';
export default {
title: 'Next Right Now/Animation/Loader',
component: Loader,
argTypes: {},
parameters: {
controls: {
hideNoControlsWarning: true,
},
},
} as Meta;

export const DefaultExample: Story<Props> = () => <Loader />;

1 comment on commit 57f418d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.