Skip to content
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

Display certified ulogger icon not just in in feed but also in post content #115

Merged
merged 2 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/components/CertifiedUlogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function CertifiedUlogger({ intl }) {
return (
<BTooltip
title={intl.formatMessage(
{ id: 'verified_ulogger', defaultMessage: 'Verified Ulogger' },
{ id: 'certified_ulogger', defaultMessage: 'Certified Ulogger' },
)}
>
<img
Expand Down
4 changes: 4 additions & 0 deletions src/client/components/Story/StoryFull.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getProxyImageURL } from '../../helpers/image';
import Popover from '../Popover';
import BTooltip from '../BTooltip';
import ReputationTag from '../ReputationTag';
import CertifiedUlogger from '../CertifiedUlogger';
import { getHtml } from './Body';
import BodyContainer from '../../containers/Story/BodyContainer';
import StoryDeleted from './StoryDeleted';
Expand Down Expand Up @@ -378,6 +379,9 @@ class StoryFull extends React.Component {
<Link to={`/@${post.author}`}>
<span className="username">{post.author}</span>
<ReputationTag reputation={post.author_reputation} />
{postState.isCertifiedUlogger &&
<CertifiedUlogger />
}
</Link>
<BTooltip
title={
Expand Down
6 changes: 6 additions & 0 deletions src/client/post/PostContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getRebloggedList,
getPendingReblogs,
getFollowingList,
getUloggersFollowingList,
getPendingFollows,
getIsEditorSaving,
getVotingPower,
Expand Down Expand Up @@ -43,6 +44,7 @@ import DMCARemovedMessage from '../components/Story/DMCARemovedMessage';
reblogList: getRebloggedList(state),
pendingReblogs: getPendingReblogs(state),
followingList: getFollowingList(state),
uloggersFollowingList: getUloggersFollowingList(state),
pendingFollows: getPendingFollows(state),
saving: getIsEditorSaving(state),
sliderMode: getVotingPower(state),
Expand Down Expand Up @@ -70,6 +72,7 @@ class PostContent extends React.Component {
reblogList: PropTypes.arrayOf(PropTypes.number),
pendingReblogs: PropTypes.arrayOf(PropTypes.number),
followingList: PropTypes.arrayOf(PropTypes.string),
uloggersFollowingList: PropTypes.arrayOf(PropTypes.string),
pendingFollows: PropTypes.arrayOf(PropTypes.string),
pendingBookmarks: PropTypes.arrayOf(PropTypes.number).isRequired,
saving: PropTypes.bool.isRequired,
Expand All @@ -94,6 +97,7 @@ class PostContent extends React.Component {
reblogList: [],
pendingReblogs: [],
followingList: [],
uloggersFollowingList: [],
pendingFollows: [],
bookmarks: {},
sliderMode: 'auto',
Expand Down Expand Up @@ -165,6 +169,7 @@ class PostContent extends React.Component {
reblogList,
pendingReblogs,
followingList,
uloggersFollowingList,
pendingFollows,
bookmarks,
pendingBookmarks,
Expand Down Expand Up @@ -195,6 +200,7 @@ class PostContent extends React.Component {
isLiked: userVote.percent > 0,
isReported: userVote.percent < 0,
userFollowed: followingList.includes(content.author),
isCertifiedUlogger: uloggersFollowingList.includes(content.author),
};

const pendingLike =
Expand Down