mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 18:47:44 +00:00
Add Random button
This commit is contained in:
parent
e083150e33
commit
7825367fa4
5 changed files with 53 additions and 2 deletions
12
src/App.js
12
src/App.js
|
|
@ -148,6 +148,14 @@ class App extends React.Component {
|
|||
value={this.props.searchQuery || ""}
|
||||
placeholder={"Search..."}
|
||||
/>
|
||||
<span style={{ flexGrow: 1 }} />
|
||||
<button
|
||||
onClick={() => {
|
||||
this.props.requestRandomSkin();
|
||||
}}
|
||||
>
|
||||
Random
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id="infinite-skins"
|
||||
|
|
@ -175,12 +183,14 @@ const mapStateToProps = state => ({
|
|||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
// TODO: Extract to action creator
|
||||
setSelectedSkin(hash, position) {
|
||||
dispatch(Actions.selectedSkin(hash, position));
|
||||
},
|
||||
setSearchQuery(query) {
|
||||
dispatch(Actions.searchQueryChanged(query));
|
||||
},
|
||||
requestRandomSkin() {
|
||||
dispatch(Actions.requestedRandomSkin());
|
||||
}
|
||||
});
|
||||
export default connect(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue