Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2910 from sarracini/better_background_image
Browse files Browse the repository at this point in the history
nit(highlights): Simplify background image for card UI
  • Loading branch information
sarracini committed Jul 19, 2017
2 parents d834cd3 + b225b40 commit 3033243
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions system-addon/content-src/components/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ class Card extends React.Component {
toggleContextMenu(event, index) {
this.setState({showContextMenu: true, activeCard: index});
}
setBackgroundImageStyle(image) {
const style = {};
if (image) {
style.backgroundImage = `url(${image})`;
} else {
style.display = "none";
}
return style;
}
render() {
const {index, link, dispatch} = this.props;
const isContextMenuOpen = this.state.showContextMenu && this.state.activeCard === index;
Expand All @@ -39,7 +30,7 @@ class Card extends React.Component {
return (<li className={`card-outer${isContextMenuOpen ? " active" : ""}`}>
<a href={link.url}>
<div className="card">
<div className="card-preview-image" style={this.setBackgroundImageStyle(link.image)} />
{link.image && <div className="card-preview-image" style={{backgroundImage: `url(${link.image})`}} />}
<div className="card-details">
<div className="card-host-name"> {hostname} </div>
<h4 className="card-title"> {link.title} </h4>
Expand Down

0 comments on commit 3033243

Please sign in to comment.