mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-16 00:53:10 +00:00
show twitter retweets in a form of the original status. anchors to feed avatars
This commit is contained in:
@@ -36,9 +36,16 @@ module.exports = React.createClass({
|
||||
},
|
||||
render() {
|
||||
var messages = this.state.messages.map((message) => {
|
||||
|
||||
var image = <img className="message__image" src={message.image} />;
|
||||
|
||||
if(message.imageLink) {
|
||||
image = <a target="_blank" href={message.imageLink}>{image}</a>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="message">
|
||||
<img className="message__image" src={message.image} />
|
||||
{image}
|
||||
<div className="message__content">
|
||||
<div className="message__body" dangerouslySetInnerHTML={{__html:message.body}}></div>
|
||||
<div className="message__icon">
|
||||
|
||||
@@ -12,7 +12,6 @@ module.exports = {
|
||||
var template = _.template(githubEvent.parse(item).text);
|
||||
|
||||
var repository = `https://github.com/${item.repo.name}`;
|
||||
|
||||
var branch;
|
||||
if(item.payload.ref) {
|
||||
branch = item.payload.ref.replace('refs/heads/', '');
|
||||
@@ -27,6 +26,7 @@ module.exports = {
|
||||
|
||||
return {
|
||||
image: item.actor.avatar_url,
|
||||
imageLink: `//githubEvent.com/${item.actor.login}`,
|
||||
body: `${item.actor.login} ${message}`,
|
||||
timestamp: new Date(item.created_at),
|
||||
url: message.url,
|
||||
@@ -34,8 +34,14 @@ module.exports = {
|
||||
};
|
||||
},
|
||||
twitter(item) {
|
||||
|
||||
if(item.retweeted) {
|
||||
item = item.retweeted_status;
|
||||
}
|
||||
|
||||
return {
|
||||
image: item.user.profile_image_url,
|
||||
imageLink: `//twitter.com/${item.user.screen_name}`,
|
||||
body: twitterText.autoLink(item.text),
|
||||
timestamp: new Date(item.created_at),
|
||||
type: 'twitter'
|
||||
|
||||
Reference in New Issue
Block a user