diff --git a/src/routes/Player/ControlBar/ControlBar.js b/src/routes/Player/ControlBar/ControlBar.js index a976d6f25..0057b03cd 100644 --- a/src/routes/Player/ControlBar/ControlBar.js +++ b/src/routes/Player/ControlBar/ControlBar.js @@ -13,7 +13,8 @@ class ControlBar extends Component { this.state = { time: -1, volume: -1, - volumeSliderOpen: false + volumePopupOpen: false, + sharePopupOpen: false }; } @@ -25,7 +26,8 @@ class ControlBar extends Component { nextProps.volume !== this.props.volume || nextState.time !== this.state.time || nextState.volume !== this.state.volume || - nextState.volumeSliderOpen !== this.state.volumeSliderOpen; + nextState.volumePopupOpen !== this.state.volumePopupOpen || + nextState.sharePopupOpen !== this.state.sharePopupOpen; } componentWillUnmount() { @@ -77,12 +79,20 @@ class ControlBar extends Component { this.props.paused ? this.props.play() : this.props.pause(); } - onVloumeSliderOpen = () => { - this.setState({ volumeSliderOpen: true }); + onVolumePopupOpen = () => { + this.setState({ volumePopupOpen: true }); } - onVolumeSliderClose = () => { - this.setState({ volumeSliderOpen: false }); + onVolumePopupClose = () => { + this.setState({ volumePopupOpen: false }); + } + + onSharePopupOpen = () => { + this.setState({ sharePopupOpen: true }); + } + + onSharePopupClose = () => { + this.setState({ sharePopupOpen: false }); } formatTime = (time) => { @@ -119,10 +129,7 @@ class ControlBar extends Component { return (
- +
); } @@ -154,17 +161,14 @@ class ControlBar extends Component { 'ic_volume3'; return ( - + -
- +
+
-
+
+ +
+ +
+
+ +
+ + + ); + } + render() { return (
@@ -192,6 +211,7 @@ class ControlBar extends Component { {this.renderTimeLabel()}
{this.renderVolumeButton()} + {this.renderShareButton()}
); diff --git a/src/routes/Player/ControlBar/styles.less b/src/routes/Player/ControlBar/styles.less index 32eba8304..231155beb 100644 --- a/src/routes/Player/ControlBar/styles.less +++ b/src/routes/Player/ControlBar/styles.less @@ -37,20 +37,28 @@ } } -.volume-slider-container { - padding: ceil((@buttons-bar-height * 0.4)) 0; - width: @buttons-bar-height; +.popup-container { border-width: 1px 1px 0px 1px; - .volume-slider { - width: floor((@buttons-bar-height * 0.4)); - height: floor((@buttons-bar-height * 3)); + &.volume-popup-container { + padding: ceil((@buttons-bar-height * 0.4)) 0; + width: @buttons-bar-height; - .volume-thumb { + .volume-slider { width: floor((@buttons-bar-height * 0.4)); - height: floor((@buttons-bar-height * 0.4)); + height: floor((@buttons-bar-height * 3)); + + .volume-thumb { + width: floor((@buttons-bar-height * 0.4)); + height: floor((@buttons-bar-height * 0.4)); + } } } + + &.share-popup-container { + width: 300px; + height: 180px; + } } .control-bar-container { @@ -116,7 +124,7 @@ } } -.volume-slider-container { +.popup-container { display: flex; justify-content: center; align-items: center;