Skip to content

Commit

Permalink
add AudioPlayer component
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs committed Oct 22, 2024
1 parent d7c47a2 commit 54dd147
Show file tree
Hide file tree
Showing 13 changed files with 825 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dotcom-rendering/.storybook/decorators/themeDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export const colourSchemeDecorator =
<Args = StrictArgs,>(formats: ArticleFormat[]): Decorator<Args> =>
(Story, context) => (
<>
{formats.map((format) => (
{formats.map((format, index) => (
<div
key={index}
data-color-scheme={colourScheme}
css={css(paletteDeclarations(format, colourScheme))}
style={{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import type { Meta, StoryObj } from '@storybook/react';
import { defaultFormats } from '../../../.storybook/decorators/splitThemeDecorator';
import { allModes } from '../../../.storybook/modes';
import { AudioPlayer as Player } from './AudioPlayer';
// import audioFile from './stories/default_audio_test.mp3';

const meta = {
title: 'Components/Audio Player',
component: Player,
} satisfies Meta<typeof Player>;

export default meta;

type Story = StoryObj<typeof meta>;

export const AudioPlayer = {
args: {
// src: audioFile,
src: 'https://audio.guim.co.uk/2024/10/18-57753-USEE_181024.mp3',
mediaId: 'mediaId',
showVolumeControls: true,
},
parameters: {
// We only want to snapshot the `multipleFormats` version below.
chromatic: { disable: true },
},
} satisfies Story;

export const MultipleFormats = {
args: AudioPlayer.args,
parameters: {
formats: defaultFormats,
chromatic: {
modes: {
horizontal: allModes.splitHorizontal,
},
},
},
} satisfies Story;
Loading

0 comments on commit 54dd147

Please sign in to comment.