mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
Merge pull request #157 from rschamp/bugfix/GH-152
Fix #152: Don't output activity without a message
This commit is contained in:
commit
21b7386270
2 changed files with 18 additions and 14 deletions
|
@ -38,20 +38,21 @@ var Activity = React.createClass({
|
|||
var actionDate = new Date(item.datetime_created + 'Z');
|
||||
var activityMessageHTML = '<a href=' + actorProfileUrl + '>' +
|
||||
item.actor.username + '</a>' + item.message;
|
||||
|
||||
return (
|
||||
<li key={item.pk}>
|
||||
<a href={actorProfileUrl}>
|
||||
<img src={item.actor.thumbnail_url} width="34" height="34" />
|
||||
<p dangerouslySetInnerHTML={{__html: activityMessageHTML}}></p>
|
||||
<p>
|
||||
<span className="stamp">
|
||||
<FormattedRelative value={actionDate} />
|
||||
</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
if (item.message.replace(/\s/g, '')) {
|
||||
return (
|
||||
<li key={item.pk}>
|
||||
<a href={actorProfileUrl}>
|
||||
<img src={item.actor.thumbnail_url} width="34" height="34" />
|
||||
<p dangerouslySetInnerHTML={{__html: activityMessageHTML}}></p>
|
||||
<p>
|
||||
<span className="stamp">
|
||||
<FormattedRelative value={actionDate} />
|
||||
</span>
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</ul>
|
||||
</Box>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
var React = require('react');
|
||||
var render = require('../../lib/render.jsx');
|
||||
|
||||
var Activity = require('../../components/activity/activity.jsx');
|
||||
var Box = require('../../components/box/box.jsx');
|
||||
var Button = require('../../components/forms/button.jsx');
|
||||
var Carousel = require('../../components/carousel/carousel.jsx');
|
||||
|
@ -32,6 +33,8 @@ var Components = React.createClass({
|
|||
title="Carousel component in a box!">
|
||||
<Carousel />
|
||||
</Box>
|
||||
<h1>{'What\'s Happening??'}</h1>
|
||||
<Activity />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue