Add Random button

This commit is contained in:
Jordan Eldredge 2018-12-01 20:01:19 -08:00
parent e083150e33
commit 7825367fa4
5 changed files with 53 additions and 2 deletions

View file

@ -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(