1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 06:32:34 +01:00

styling for removing item

This commit is contained in:
devfake 2016-02-24 12:44:29 +01:00
parent 6f0d2e4c60
commit c430c04e7d
2 changed files with 44 additions and 1 deletions

View File

@ -2,6 +2,14 @@ import React from 'react';
class FloxItem extends React.Component { class FloxItem extends React.Component {
constructor(props) {
super(props);
this.state = {
removed: false
}
}
render() { render() {
let title = this.props.data.title; let title = this.props.data.title;
@ -12,6 +20,7 @@ class FloxItem extends React.Component {
<span className="item-title">{title}</span> <span className="item-title">{title}</span>
<i className="icon-close-small" onClick={this.closeHiddenContent.bind(this)}></i> <i className="icon-close-small" onClick={this.closeHiddenContent.bind(this)}></i>
<a href={"https://www.youtube.com/results?search_query=" + title + " Trailer"} target="_blank" className="trailer-btn">Watch Trailer</a> <a href={"https://www.youtube.com/results?search_query=" + title + " Trailer"} target="_blank" className="trailer-btn">Watch Trailer</a>
<span className={'remove-btn' + (this.state.removed ? ' reset' : '')} onClick={this.handleItemRemove.bind(this)}>{this.state.removed ? "Bring it back" : "Remove from list"}</span>
</div> </div>
<div className="item-image"> <div className="item-image">
{this.props.image ? <img src={this.props.image} /> : <i className="icon-no-image"></i>} {this.props.image ? <img src={this.props.image} /> : <i className="icon-no-image"></i>}
@ -40,6 +49,12 @@ class FloxItem extends React.Component {
closeHiddenContent() { closeHiddenContent() {
this.props.changeActiveKey(null); this.props.changeActiveKey(null);
} }
handleItemRemove() {
this.setState({
removed: true
})
}
} }
export default FloxItem; export default FloxItem;

View File

@ -161,7 +161,8 @@
} }
} }
.trailer-btn { .trailer-btn,
.remove-btn {
background: $main; background: $main;
color: #fff; color: #fff;
text-transform: uppercase; text-transform: uppercase;
@ -182,6 +183,33 @@
} }
} }
.remove-btn {
background: none;
color: #555;
width: 205px;
left: auto;
right: 20px;
cursor: pointer;
&:hover {
background: #c33939;
color: #fff;
}
&:active {
background: darken(#c33939, 10%);
}
&.reset {
background: #258dca;
color: #fff;
&:active {
background: darken(#258dca, 10%);
}
}
}
.icon-close-small { .icon-close-small {
position: absolute; position: absolute;
top: 15px; top: 15px;