-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #712 from odota/public_matches
add highest/lowest mmr matches
- Loading branch information
Showing
11 changed files
with
186 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* global API_HOST */ | ||
import fetch from 'isomorphic-fetch'; | ||
import querystring from 'querystring'; | ||
|
||
const REQUEST = 'publicMatches/REQUEST'; | ||
const OK = 'publicMatches/OK'; | ||
const ERROR = 'publicMatches/ERROR'; | ||
|
||
export const publicMatchesActions = { | ||
REQUEST, | ||
OK, | ||
ERROR, | ||
}; | ||
|
||
export const getPublicMatchesRequest = () => ({ | ||
type: REQUEST, | ||
}); | ||
|
||
export const getPublicMatchesOk = payload => ({ | ||
type: OK, | ||
payload, | ||
}); | ||
|
||
export const getPublicMatchesError = payload => ({ | ||
type: ERROR, | ||
payload, | ||
}); | ||
|
||
export const getPublicMatches = options => (dispatch) => { | ||
dispatch(getPublicMatchesRequest()); | ||
return fetch(`${API_HOST}/api/publicMatches?${querystring.stringify(options)}`) | ||
.then(response => response.json()) | ||
.then(json => dispatch(getPublicMatchesOk(json))) | ||
.catch(error => dispatch(getPublicMatchesError(error))); | ||
}; |
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 |
---|---|---|
@@ -1 +1,19 @@ | ||
@import "../palette.css"; | ||
|
||
.badge { | ||
display: inline-block; | ||
|
||
& svg { | ||
width: 10px !important; | ||
height: 10px !important; | ||
margin-right: 5px; | ||
} | ||
} | ||
|
||
.confirmed { | ||
composes: badge; | ||
|
||
& svg { | ||
fill: var(--colorGolden); | ||
} | ||
} |
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
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,15 @@ | ||
import { publicMatchesActions } from 'actions'; | ||
import { listData, selectors } from './reducerFactory'; | ||
|
||
const initialState = { | ||
loaded: false, | ||
error: false, | ||
loading: false, | ||
list: [], | ||
}; | ||
|
||
export default listData(initialState, publicMatchesActions); | ||
|
||
export const getPublicMatches = { | ||
...selectors(state => state.app.publicMatches), | ||
}; |