-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/favorite-channel' into develop
- Loading branch information
Showing
36 changed files
with
1,523 additions
and
369 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React, { Component, PropTypes } from 'react'; | ||
import cx from 'classnames'; | ||
import styles from './Buttonbar.scss'; | ||
|
||
export default class Buttonbar extends Component { | ||
static propTypes = { | ||
onBan: PropTypes.func.isRequired, | ||
onControl: PropTypes.func.isRequired, | ||
onNext: PropTypes.func.isRequired, | ||
onTaste: PropTypes.func.isRequired, | ||
song: PropTypes.object.isRequired, | ||
playing: PropTypes.bool, | ||
} | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
renderFavorite = (favorite, onClick) => { | ||
const title = favorite ? '取消喜欢' : '喜欢'; | ||
|
||
return ( | ||
<button onClick={onClick} title={title} > | ||
<i className={cx('material-icons', { favorite })} > favorite </i> | ||
</button> | ||
); | ||
} | ||
|
||
renderPlay = (playing, onClick) => { | ||
const icon = playing ? 'pause' : 'play_arrow'; | ||
const title = playing ? '暂停' : '播放'; | ||
|
||
return ( | ||
<button onClick={onClick} title={title}> | ||
<i className="material-icons" > {icon} </i> | ||
</button> | ||
); | ||
} | ||
|
||
render() { | ||
const { song, playing } = this.props; | ||
|
||
return ( | ||
<div className={styles.buttonBar}> | ||
<div className="tasteButtonGroup"> | ||
{this.renderFavorite(song.favorite, this.props.onTaste)} | ||
<button onClick={this.props.onBan} title="不再播放" > | ||
<i className="material-icons" > cancel </i> | ||
</button> | ||
</div> | ||
<div className="controlButtonGroup"> | ||
{this.renderPlay(playing, this.props.onControl)} | ||
<button onClick={this.props.onNext} title="下一首" > | ||
<i className="material-icons" > skip_next </i> | ||
</button> | ||
</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
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
.processbar { | ||
position: relative; | ||
width: 20rem; | ||
width: 15rem; | ||
|
||
:global { | ||
.default { | ||
|
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
Oops, something went wrong.