Skip to content

Commit

Permalink
make affiliation optional, off by default
Browse files Browse the repository at this point in the history
  • Loading branch information
roadscape committed May 16, 2019
1 parent dd73e5f commit acafc17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/components/cards/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ class CommentImpl extends React.Component {
<Author
author={comment.author}
authorRepLog10={authorRepLog10}
showAffiliation
/>
</span>
&nbsp; &middot; &nbsp;
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/cards/PostFull.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ function TimeAuthorCategory({ content, authorRepLog10, showTags }) {
<Icon name="clock" className="space-right" />
<TimeAgoWrapper date={content.created} className="updated" />
{} {tt('g.by')}{' '}
<Author author={content.author} authorRepLog10={authorRepLog10} />
<Author
author={content.author}
authorRepLog10={authorRepLog10}
showAffiliation
/>
{showTags && (
<span>
{' '}
Expand All @@ -53,6 +57,7 @@ function TimeAuthorCategoryLarge({ content, authorRepLog10 }) {
<Author
author={content.author}
authorRepLog10={authorRepLog10}
showAffiliation
/>
<span>
{' '}
Expand Down
14 changes: 11 additions & 3 deletions src/app/components/elements/Author/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class Author extends React.Component {
follow: bool,
mute: bool,
authorRepLog10: number,
showAffiliation: bool,
};
static defaultProps = {
follow: true,
mute: true,
showAffiliation: false,
};

constructor(...args) {
Expand Down Expand Up @@ -89,7 +91,13 @@ class Author extends React.Component {

shouldComponentUpdate = shouldComponentUpdate(this, 'Author');
render() {
const { author, follow, mute, authorRepLog10 } = this.props; // html
const {
author,
follow,
mute,
authorRepLog10,
showAffiliation,
} = this.props; // html
const { username } = this.props; // redux
const { name, about } = this.props.account
? normalizeProfile(this.props.account.toJS())
Expand All @@ -107,7 +115,7 @@ class Author extends React.Component {
<Link to={'/@' + author}>{author}</Link>
</strong>{' '}
<Reputation value={authorRepLog10} />
{AffiliationMap[author] ? (
{showAffiliation && AffiliationMap[author] ? (
<span className="affiliation">
{tt('g.affiliation_' + AffiliationMap[author])}
</span>
Expand All @@ -132,7 +140,7 @@ class Author extends React.Component {
to={'/@' + author}
>
{author} <Reputation value={authorRepLog10} />
{AffiliationMap[author] ? (
{showAffiliation && AffiliationMap[author] ? (
<span className="affiliation">
{tt(
'g.affiliation_' +
Expand Down

0 comments on commit acafc17

Please sign in to comment.