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

Commit

Permalink
Merge pull request #32 from IzumiSy/IzumiSy/add_user_profile_link
Browse files Browse the repository at this point in the history
Add user profile link on tweets
  • Loading branch information
k0kubun authored Sep 30, 2016
2 parents 9c6dd6a + d024b42 commit f3c74d8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
20 changes: 17 additions & 3 deletions src/components/tweet-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ export default class TweetHeader extends React.Component {
now: PropTypes.number,
}

generateTwitterProfileUrl(screen_name) {
return `https://twitter.com/${screen_name}`
}

render() {
return(
const tweetUser = this.props.tweet.user

return (
<div className='tweet_header clearfix'>
<div className='name_wrapper'>
<span className='user_name'>{this.props.tweet.user.name}</span>
<span className='screen_name'>{this.props.tweet.user.screen_name}</span>
<a
href={this.generateTwitterProfileUrl(tweetUser.screen_name)}
className='user_name external-link external-link-twitter'
target='_blank'
>
{tweetUser.name}
</a>
<span className='screen_name'>
{tweetUser.screen_name}
</span>
</div>
<Time className='created_at' time={this.props.tweet.created_at} now={this.props.now} />
</div>
Expand Down
16 changes: 13 additions & 3 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,19 @@ body {
background: #389cd7;
}

&.active .external-link {
color: white;
text-decoration: underline;
&.active {
.external-link {
color: white;
text-decoration: underline;
}

.user_name {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}
}
}

Expand Down

0 comments on commit f3c74d8

Please sign in to comment.