Skip to content

Commit

Permalink
✨ feat: Add new props buttonStyle and title to AudioPlayerProps
Browse files Browse the repository at this point in the history
This commit introduces new props `buttonStyle` and `title` to the
`AudioPlayerProps` interface. These props are used in the `AudioPlayer`
component to style the button and display a title.

Changes:
- Added `buttonStyle` and `title` props to `AudioPlayerProps`
- Utilized `buttonStyle` prop to style the button
- Utilized `title` prop to display a title
  • Loading branch information
canisminor1990 committed Nov 19, 2023
1 parent feaf739 commit 9e93042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/react/AudioPlayer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface AudioPlayerProps {
audio: AudioProps;
buttonActive?: boolean;
buttonSize?: ActionIconProps['size'];
buttonStyle?: CSSProperties;
className?: string;
isLoading?: boolean;
onInitPlay?: () => void;
Expand All @@ -35,6 +36,7 @@ export interface AudioPlayerProps {
timeRender?: 'tag' | 'text';
timeStyle?: CSSProperties;
timeType?: 'left' | 'current' | 'combine';
title?: string;
}

const AudioPlayer = memo<AudioPlayerProps>(
Expand Down Expand Up @@ -64,6 +66,8 @@ const AudioPlayer = memo<AudioPlayerProps>(
onInitPlay,
onPause,
onStop,
title,
buttonStyle,
onPlay,
}) => {
const { isPlaying, play, stop, pause, duration, setTime, currentTime, download } = audio;
Expand Down Expand Up @@ -118,6 +122,8 @@ const AudioPlayer = memo<AudioPlayerProps>(
loading={isLoading}
onClick={isPlaying ? (allowPause ? handlePause : handleStop) : handlePlay}
size={buttonSize || { blockSize: 32, fontSize: 16 }}
style={buttonStyle}
title={title}
/>
</div>
{showSlider && (
Expand Down

0 comments on commit 9e93042

Please sign in to comment.