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

446 linkify username in comment #1686

Merged
merged 13 commits into from
Sep 1, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/components/cards/PostFull.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function TimeAuthorCategoryLarge({content, authorRepLog10}) {
return (
<span className="PostFull__time_author_category_large vcard">
<TimeAgoWrapper date={content.created} className="updated float-right" />
<Userpic account={content.author} />
<Link to={'/@' + content.author} className="float-left Userpic-wrapper"><Userpic account={content.author} /></Link>
<div className="right-side">
<Author author={content.author} authorRepLog10={authorRepLog10} />
<span> {tt('g.in')} <TagList post={content} single /></span>
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/cards/PostFull.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
strong, a {color: #999}
font-size: 120%;
display: block;
> .Userpic {
> .Userpic-wrapper,
.Userpic {
margin-top: -4px;
float: left;
}
Expand Down
54 changes: 29 additions & 25 deletions src/app/components/elements/Author.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ class Author extends React.Component {
author: string.isRequired,
follow: bool,
mute: bool,
popupEnabled: bool,
authorRepLog10: number,
};
static defaultProps = {
follow: true,
mute: true,
popupEnabled: false
};

constructor(...args){
Expand All @@ -48,45 +50,47 @@ class Author extends React.Component {
const {author, follow, mute, authorRepLog10} = this.props; // html
const {username} = this.props; // redux
const {name, about} = this.props.account ? normalizeProfile(this.props.account.toJS()) : {};

if (!(follow || mute) || username === author) {
return <span className="author" itemProp="author" itemScope itemType="http://schema.org/Person">
return (<span className="author" itemProp="author" itemScope itemType="http://schema.org/Person">
<Link to={'/@' + author}><strong>{author}</strong></Link> <Reputation value={authorRepLog10} />
</span>;
</span>)
}

return (
<span className="Author">
<span
onClick={this.toggle}
ref={(c) => { this.target = c; }}
>
<span>
<span
itemProp="author"
itemScope
itemType="http://schema.org/Person"
>
<strong>{author}</strong>
<Link to={'/@' + author}><strong>{author}</strong></Link>
</span>
<Icon name="dropdown-arrow" />
<Reputation value={authorRepLog10} />
</span>
<Overlay
show={this.state.show}
onHide={this.close}
placement="bottom"
container={this}
target={() => findDOMNode(this.target)}
rootClose
>
<span onClick={this.toggle}
ref={(c) => { this.target = c; }}>
<Icon name="dropdown-arrow" />
<Reputation value={authorRepLog10} />
</span>
<Overlay
show={this.state.show}
onHide={this.close}
placement="bottom"
container={this}
target={() => findDOMNode(this.target)}
rootClose
>
<AuthorDropdown
author={author}
follow={follow}
mute={mute}
authorRepLog10={authorRepLog10}
name={name}
about={about}
username={username}
author={author}
follow={follow}
mute={mute}
authorRepLog10={authorRepLog10}
name={name}
about={about}
username={username}
/>
</Overlay>
</span>
</span>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/elements/Userpic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Userpic extends Component {
width: (width || 48) + 'px',
height: (height || 48) + 'px'}

return <div className="Userpic" style={style} />;
return (<div className="Userpic" style={style} />)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/app/components/elements/Userpic.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.Userpic-wrapper,
.Userpic {
display: inline-block;

Expand Down