Change match hover design

This commit is contained in:
Felix Hamme 2018-12-08 00:44:49 +01:00
parent 7bbeee9e25
commit 0bbaaa4d3b
2 changed files with 10 additions and 8 deletions

View File

@ -75,17 +75,11 @@ class Match extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
isHovered: false,
modal: false modal: false
}; };
this.handleHover = this.handleHover.bind(this);
this.toggleModal = this.toggleModal.bind(this); this.toggleModal = this.toggleModal.bind(this);
} }
handleHover() {
this.setState({isHovered: !this.state.isHovered});
}
toggleModal() { toggleModal() {
this.setState({modal: !this.state.modal}) this.setState({modal: !this.state.modal})
} }
@ -128,8 +122,7 @@ class Match extends React.Component {
} }
return ( return (
<div className='mb-3'> <div className='mb-3'>
<Card className={(this.state.isHovered ? 'shadow' : 'shadow-sm')} onMouseEnter={this.handleHover} <Card className='shadow-sm match' onClick={this.toggleModal}>
onMouseLeave={this.handleHover} onClick={this.toggleModal}>
<CardBody className={'border py-2 ' + cardClass}> <CardBody className={'border py-2 ' + cardClass}>
<MatchTable match={this.props.match}/> <MatchTable match={this.props.match}/>
</CardBody> </CardBody>

View File

@ -13,3 +13,12 @@
.minw-25 { .minw-25 {
min-width: 25%; min-width: 25%;
} }
.match:hover {
box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}
.match:hover > div {
border-width: 3px !important;
margin: -2px;
}