-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(controls): Add react version of mp3 controls behind option (#1302)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9f26b06
commit e437b13
Showing
13 changed files
with
631 additions
and
67 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@import '~box-ui-elements/es/styles/variables'; | ||
|
||
.bp-MP3Controls { | ||
display: flex; | ||
flex-direction: column; | ||
width: 360px; // Required because the controls are the only visible elements within the viewer | ||
background-color: $black; | ||
} | ||
|
||
.bp-MP3Controls-bar { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 0 10px 5px; | ||
} | ||
|
||
.bp-MP3Controls-group { | ||
display: flex; | ||
align-items: center; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import DurationLabels, { Props as DurationLabelsProps } from '../controls/media/DurationLabels'; | ||
import PlayPauseToggle, { Props as PlayControlsProps } from '../controls/media/PlayPauseToggle'; | ||
import SettingsControls from '../controls/media/SettingsControls'; | ||
import TimeControls, { Props as TimeControlsProps } from '../controls/media/TimeControls'; | ||
import VolumeControls, { Props as VolumeControlsProps } from '../controls/media/VolumeControls'; | ||
import './MP3Controls.scss'; | ||
|
||
export type Props = DurationLabelsProps & PlayControlsProps & TimeControlsProps & VolumeControlsProps; | ||
|
||
export default function MP3Controls({ | ||
bufferedRange, | ||
currentTime, | ||
durationTime, | ||
isPlaying, | ||
onMuteChange, | ||
onPlayPause, | ||
onTimeChange, | ||
onVolumeChange, | ||
volume, | ||
}: Props): JSX.Element { | ||
return ( | ||
<div className="bp-MP3Controls"> | ||
<TimeControls | ||
bufferedRange={bufferedRange} | ||
currentTime={currentTime} | ||
durationTime={durationTime} | ||
onTimeChange={onTimeChange} | ||
/> | ||
|
||
<div className="bp-MP3Controls-bar"> | ||
<div className="bp-MP3Controls-group"> | ||
<PlayPauseToggle isPlaying={isPlaying} onPlayPause={onPlayPause} /> | ||
<VolumeControls onMuteChange={onMuteChange} onVolumeChange={onVolumeChange} volume={volume} /> | ||
<DurationLabels currentTime={currentTime} durationTime={durationTime} /> | ||
</div> | ||
|
||
<div className="bp-MP3Controls-group"> | ||
<SettingsControls /> | ||
</div> | ||
</div> | ||
</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
Oops, something went wrong.