Commit 39550d80 authored by Ray Schamp's avatar Ray Schamp

Fix #152: Don't output activity without a message

parent 0b47ac87
...@@ -38,20 +38,21 @@ var Activity = React.createClass({ ...@@ -38,20 +38,21 @@ var Activity = React.createClass({
var actionDate = new Date(item.datetime_created + 'Z'); var actionDate = new Date(item.datetime_created + 'Z');
var activityMessageHTML = '<a href=' + actorProfileUrl + '>' + var activityMessageHTML = '<a href=' + actorProfileUrl + '>' +
item.actor.username + '</a>' + item.message; item.actor.username + '</a>' + item.message;
if (item.message.replace(/\s/g, '')) {
return ( return (
<li key={item.pk}> <li key={item.pk}>
<a href={actorProfileUrl}> <a href={actorProfileUrl}>
<img src={item.actor.thumbnail_url} width="34" height="34" /> <img src={item.actor.thumbnail_url} width="34" height="34" />
<p dangerouslySetInnerHTML={{__html: activityMessageHTML}}></p> <p dangerouslySetInnerHTML={{__html: activityMessageHTML}}></p>
<p> <p>
<span className="stamp"> <span className="stamp">
<FormattedRelative value={actionDate} /> <FormattedRelative value={actionDate} />
</span> </span>
</p> </p>
</a> </a>
</li> </li>
); );
}
})} })}
</ul> </ul>
</Box> </Box>
......
var React = require('react'); var React = require('react');
var render = require('../../lib/render.jsx'); var render = require('../../lib/render.jsx');
var Activity = require('../../components/activity/activity.jsx');
var Box = require('../../components/box/box.jsx'); var Box = require('../../components/box/box.jsx');
var Button = require('../../components/forms/button.jsx'); var Button = require('../../components/forms/button.jsx');
var Carousel = require('../../components/carousel/carousel.jsx'); var Carousel = require('../../components/carousel/carousel.jsx');
...@@ -32,6 +33,8 @@ var Components = React.createClass({ ...@@ -32,6 +33,8 @@ var Components = React.createClass({
title="Carousel component in a box!"> title="Carousel component in a box!">
<Carousel /> <Carousel />
</Box> </Box>
<h1>{'What\'s Happening??'}</h1>
<Activity />
</div> </div>
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment