-
Notifications
You must be signed in to change notification settings - Fork 406
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
Changes from 15 commits
bd7e9ae
9d1f65f
c23f12d
e38c463
4910708
4db566a
9e346df
b099d50
9916375
843a0c2
3ddc16b
b7ce459
b4db5a3
98a2831
890e51f
fdf6900
12d6828
6eb4a48
60f06bf
e827ba7
cb0106a
5d8e8f5
8b2de47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,5 +43,4 @@ | |
| </script> | ||
| <script src="/build/bundle.js"></script> | ||
| </body> | ||
|
|
||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,16 @@ | ||
| @import "../palette.css"; | ||
|
|
||
| :root { | ||
| --ward-log-height: 50px; | ||
| --slider-ticks-color: #757575; | ||
|
Member
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. I guess this colors should be defined in palette.css |
||
| --slider-ticks-color-active: #337AB7; | ||
| } | ||
|
|
||
| :export { | ||
| wardLogRowOddSurfaceColor: var(--tableRowOddSurfaceColor); | ||
| wardLogRowEvenSurfaceColor: var(--tableRowEvenSurfaceColor); | ||
| } | ||
|
|
||
| .Header { | ||
| text-align: center; | ||
| display: block; | ||
|
|
@@ -148,6 +159,117 @@ | |
| vertical-align: middle; | ||
| } | ||
|
|
||
| .ward-log { | ||
| width: 100%; | ||
| font-size: .8em; | ||
|
Member
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 have some defined font sizes in palette.css. I guess 0.8em is somehing like 12px so u can use
Author
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. I'll oblige but I think that using px as font size is a bad practice for mobility. I'd rather leave it that way or refactor to use em/rem all around.
Member
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 should link it to --fontSizeSmall then convert that em then |
||
|
|
||
| & .ward-log-header { | ||
| background-color: var(--tableHeaderSurfaceColor); | ||
| border-bottom: 1px solid var(--dividerLightColor); | ||
| text-transform: uppercase; | ||
| height: 58px; | ||
| } | ||
|
|
||
| & .ward-log-list { | ||
| padding: 0; | ||
| margin: 0; | ||
| } | ||
|
|
||
| & .timespan { | ||
| text-align: right; | ||
| } | ||
| } | ||
|
|
||
| .ward-log-item { | ||
| height: var(--ward-log-height); | ||
| background: rgb(31, 33, 45); | ||
| border-bottom: 1px solid var(--dividerColor); | ||
| } | ||
|
|
||
| .trans-table-row-enter { | ||
| height: 0; | ||
| opacity: 0; | ||
|
|
||
| &.trans-table-row-enter-active { | ||
| height: var(--ward-log-height); | ||
| opacity: 1; | ||
| transition: height 300ms ease, opacity 300ms ease; | ||
| } | ||
| } | ||
|
|
||
| .trans-table-row-leave { | ||
| height: var(--ward-log-height); | ||
| opacity: 1; | ||
|
|
||
| &.trans-table-row-leave-active { | ||
| height: 0px; | ||
| opacity: 0; | ||
| transition: height 300ms ease, opacity 300ms ease; | ||
| } | ||
| } | ||
|
|
||
| .ward-pin-enter { | ||
| opacity: 0; | ||
|
|
||
| &.ward-pin-enter-active { | ||
| opacity: 1; | ||
| transition: opacity 150ms ease; | ||
| } | ||
| } | ||
|
|
||
| .ward-pin-leave { | ||
| opacity: 1; | ||
|
|
||
| &.ward-pin-leave-active { | ||
| opacity: 0; | ||
| transition: opacity 150ms ease; | ||
| } | ||
| } | ||
|
|
||
| .slider-ticks { | ||
| position: relative; | ||
| height: 30px; | ||
| margin-top: 33px; | ||
| margin-bottom: -33px; | ||
| font-size: 0.66em; | ||
| border-color: var(--slider-ticks-color); | ||
| color: var(--slider-ticks-color); | ||
|
|
||
| & .slider-tick { | ||
| position: absolute; | ||
| display: inline-block; | ||
| height: 100%; | ||
| padding: 0 0.4em; | ||
| border-width: 0px; | ||
| border-color: inherit; | ||
| border-style: solid; | ||
| border-left-width: 1px; | ||
| cursor: pointer; | ||
|
|
||
| transition: color 150ms ease, border-color 150ms ease; | ||
|
|
||
| &.active { | ||
| border-color: var(--slider-ticks-color-active); | ||
| color: var(--slider-ticks-color-active); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .ward-log-player-filter { | ||
| padding: 0 .5rem; | ||
| font-size: .8em; | ||
|
|
||
| & .filter-header { | ||
| padding: .5rem; | ||
| border-bottom: 1px solid var(--dividerLightColor); | ||
| } | ||
|
|
||
| & .filter-row { | ||
| padding: .5em; | ||
| margin: 0 0; | ||
| } | ||
| } | ||
|
|
||
| .cosmetics { | ||
| display: inline-block; | ||
| margin: 5px; | ||
|
|
@@ -222,3 +344,4 @@ | |
| } | ||
| } | ||
| } | ||
|
|
||
| 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) { | ||
|
Member
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. don't you need to bind this in the constructor so you don't lose 'this' context?
Author
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.
Author
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. Doesn't seems so. |
||
| 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']} | ||
|
Member
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.
Author
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> | ||
| ); | ||
| } | ||
| } | ||
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.
Do we need this new 7 dependencies?
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.
Let me explain why those have been added: