-
Notifications
You must be signed in to change notification settings - Fork 394
Match vision tab overhaul #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
bd7e9ae
add ward log draft
9d1f65f
fix a performance issue for the Vision page
c23f12d
improve the ward log table
e38c463
improve the ward log visual
4910708
polish the wardlog visual
4db566a
add the player filter prototypes
9e346df
fix the responsive bugs in the vision page
b099d50
Merge remote-tracking branch 'upstream/master' into own_table
9916375
fixes the errors caused by merging upstream
843a0c2
Merge remote-tracking branch 'upstream/master' into own_table
3ddc16b
apply fixes following code review
b7ce459
remove some lint
b4db5a3
remove a lint bypass
98a2831
remove a lint bypass
890e51f
refactored Fixed to its own file
fdf6900
fix issues related to the CR
12d6828
eslint: allow same precedence operators to be mix
6eb4a48
fixed a problem with a mutation of immutable data
60f06bf
Revert "eslint: allow same precedence operators to be mix"
e827ba7
fix linting issues
cb0106a
fix some issues after review
5d8e8f5
fixed a crash when opening an unparsed match
8b2de47
coerce the player instead of using a guard
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -43,5 +43,4 @@ | |
</script> | ||
<script src="/build/bundle.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,80 @@ | ||
import React from 'react'; | ||
import { | ||
Row, | ||
Col, | ||
} from 'react-flexbox-grid'; | ||
import Avatar from 'material-ui/Avatar'; | ||
import Button from 'material-ui/RaisedButton'; | ||
import { | ||
grey800 as filterOff, | ||
blueGrey700 as filterOn, | ||
} from 'material-ui/styles/colors'; | ||
import styles from '../Match.css'; // extract filters from there | ||
|
||
import { heroTd } from '../matchColumns'; | ||
|
||
|
||
export default class PlayerFilter extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
this.getObserverCount = () => this.props.player.obs_log.length; | ||
this.getSentryCount = () => this.props.player.sen_log.length; | ||
this.getMuiThemeProps = () => ({ | ||
fullWidth: true, | ||
disabledBackgroundColor: filterOff, | ||
}); | ||
} | ||
|
||
generateFilterKey(type) { | ||
return `${this.props.player.player_slot}-${type}`; | ||
} | ||
|
||
render() { | ||
const { | ||
player, | ||
onFilterClick, | ||
} = this.props; | ||
const obsCount = this.getObserverCount(); | ||
const senCount = this.getSentryCount(); | ||
const [opacityOn, opacityOff] = [1, 0.4]; | ||
return ( | ||
<Row | ||
className={styles['filter-row']} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use camelcase in the css files so we don't need to do things like this. I know camelCase isn't standard css, but for css-modules, it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
middle="xs" | ||
between="xs" | ||
> | ||
<Col xs={12} sm={7}> | ||
<Row xs> | ||
<Col>{heroTd(player)}</Col> | ||
</Row> | ||
</Col> | ||
<Col xs={12} sm={5}> | ||
<Row> | ||
<Col xs> | ||
<Button | ||
{...this.getMuiThemeProps()} | ||
label={obsCount} | ||
disabled={!obsCount} | ||
backgroundColor={this.generateFilterKey('observer') in this.props.activeFilters ? filterOff : filterOn} | ||
style={{ opacity: obsCount > 0 ? opacityOn : opacityOff }} | ||
onClick={() => onFilterClick(this.generateFilterKey('observer'), player.player_slot, 'observer')} | ||
icon={<Avatar size={24} src={`${API_HOST}/apps/dota2/images/items/ward_observer_lg.png`} />} | ||
/> | ||
</Col> | ||
<Col xs> | ||
<Button | ||
{...this.getMuiThemeProps()} | ||
label={senCount} | ||
disabled={!senCount} | ||
backgroundColor={this.generateFilterKey('sentry') in this.props.activeFilters ? filterOff : filterOn} | ||
style={{ opacity: senCount > 0 ? opacityOn : opacityOff }} | ||
onClick={() => onFilterClick(this.generateFilterKey('sentry'), player.player_slot, 'sentry')} | ||
icon={<Avatar size={24} src={`${API_HOST}/apps/dota2/images/items/ward_sentry_lg.png`} />} | ||
/> | ||
</Col> | ||
</Row> | ||
</Col> | ||
</Row> | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need to bind this in the constructor so you don't lose 'this' context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be static.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seems so.