Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fixes #4923 - My Shots favorite icon indicator on signout
Browse files Browse the repository at this point in the history
  • Loading branch information
punamdahiya committed Sep 21, 2018
1 parent e632f48 commit 6d25109
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions server/src/pages/shotindex/view.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* globals controller */
const sendEvent = require("../../browser-send-event.js");
const reactruntime = require("../../reactruntime");
const classnames = require("classnames");
const { MyShotsFooter } = require("./footer");
const React = require("react");
const PropTypes = require("prop-types");
Expand Down Expand Up @@ -314,12 +315,14 @@ class Card extends React.Component {
}

let favoriteIndicator = null;
if (this.props.hasFxa) {
if (!shot.expireTime) {
favoriteIndicator = <Localized id="shotIndexFavoriteIcon"><div className="fav-shot" title=""></div></Localized>;
} else {
favoriteIndicator = <Localized id="shotIndexNonFavoriteIcon"><div className="non-fav-shot" title=""></div></Localized>;
}
if (!shot.expireTime) {
favoriteIndicator = <Localized id="shotIndexFavoriteIcon">
<div className={classnames("fav-shot", {"inactive": !this.props.hasFxa})} title=""></div>
</Localized>;
} else if (this.props.hasFxa) {
favoriteIndicator = <Localized id="shotIndexNonFavoriteIcon">
<div className="non-fav-shot" title=""></div>
</Localized>;
}

const deleteConfirmationClass = this.state.deletePanelOpen ? "panel-open" : "";
Expand Down
3 changes: 3 additions & 0 deletions static/css/shot-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@

.fav-shot {
background-image: url("../img/icon-heart.svg");
&.inactive {
opacity: 0.4;
}
}

.non-fav-shot {
Expand Down

0 comments on commit 6d25109

Please sign in to comment.