Skip to content

Commit a32bc51

Browse files
committed
feat: 🎸 add dark mode support to audio player
1 parent 906117d commit a32bc51

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎src/__story__/react-simple-player.story.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ storiesOf('react-simple-player/widths', module)
4949
</div>
5050
);
5151
});
52+
53+
storiesOf('react-simple-player', module).add('dark mode', () => {
54+
return <Embed isDark url={'https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_700KB.mp3'} />;
55+
});

‎src/blocks/react-simple-player/index.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import * as React from 'react';
22
import {BlockProps} from '../..';
33
import {Player} from 'react-simple-player';
44

5-
const SimplePlayerWrapper: React.FC<BlockProps> = ({url, width, renderWrap}) => {
6-
return renderWrap(<Player src={url} height={50} hideVolume={width < 500} />);
5+
const SimplePlayerWrapper: React.FC<BlockProps> = ({url, isDark, width, renderWrap}) => {
6+
return renderWrap(
7+
<Player src={url} height={50} hideVolume={width < 500} grey={isDark ? [20, 23, 26] : [240, 243, 246]} />,
8+
);
79
};
810

911
export default SimplePlayerWrapper;

0 commit comments

Comments
 (0)