-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4878c15
commit 2a923e7
Showing
3 changed files
with
24 additions
and
28 deletions.
There are no files selected for viewing
40 changes: 14 additions & 26 deletions
40
src/components/AudioVisualizer/AudioVisualizer.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,42 @@ | ||
import React from 'react' | ||
import { Meta, StoryObj } from '@storybook/react' | ||
import AudioVisualizer from './AudioVisualizer' | ||
import styles from './AudioVisualizer.module.css' | ||
|
||
const meta: Meta<typeof AudioVisualizer> = { | ||
title: 'common/AudioVisualizer', | ||
component: AudioVisualizer, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
bgColor: { | ||
description: 'Background color of the container', | ||
control: 'color', | ||
}, | ||
barColor: { | ||
description: 'Color of the bars', | ||
control: 'color', | ||
}, | ||
width: { | ||
description: 'Width of the container', | ||
control: 'text', | ||
}, | ||
height: { | ||
description: 'Height of the container', | ||
control: 'text', | ||
}, | ||
} | ||
barAlign: { | ||
description: 'Align the bars to the top, center, or bottom of the container (default: bottom)', | ||
defaultValue: 'bottom', | ||
options: ['top', 'center', 'bottom'], | ||
control: { type: 'radio' }, | ||
}, | ||
}, | ||
} | ||
export default meta | ||
type Story = StoryObj<typeof AudioVisualizer> | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
render: () => ( | ||
<div className={styles['story-container-full']}> | ||
<AudioVisualizer /> | ||
</div> | ||
), | ||
} | ||
|
||
export const FixedWidth: Story = { | ||
args: { | ||
width: '500px', | ||
height: '200px', | ||
}, | ||
} | ||
|
||
export const ChangeColor: Story = { | ||
args: { | ||
bgColor: '#eeeeee', | ||
barColor: '#aaeeaa', | ||
height: '100px', | ||
width: '100%', | ||
barAlign: 'bottom', | ||
}, | ||
render: ({ bgColor, barColor }) => ( | ||
<div className={styles['story-container-full']}> | ||
<AudioVisualizer bgColor={bgColor} barColor={barColor} /> | ||
</div> | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters