Created
February 1, 2015 16:23
-
-
Save rstudner/5ad410d71a077b357e1e to your computer and use it in GitHub Desktop.
This can't be the right way :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ActivityRow = React.createClass({ | |
render: function() { | |
return ( | |
<div className="activity-row"> | |
<span className="activity-time-stamp">{this.props.activity.timestamp}</span> | |
<p>{this.props.activity.title}</p> | |
<p className="activity-detail">{this.props.activity.detail}</p> | |
</div> | |
) | |
} | |
}); | |
var ActivityList = React.createClass({ | |
render: function() { | |
var activityRows = this.props.data.map(function (activity) { | |
return ( | |
<ActivityRow activity={activity}></ActivityRow> | |
); | |
}); | |
return ( | |
<div>{activityRows}</div> //I don't want this wrapper div.. how do I get around this sort of thing? | |
) | |
} | |
}); | |
var ActivityBox = React.createClass({ | |
render: function() { | |
return ( | |
<div className="span4 incident-activity-feed"> | |
<h4>Activity Feed</h4> | |
<ActivityList data={this.props.data} /> | |
</div> | |
); | |
} | |
}); | |
$(document).ready(function () { | |
React.render( | |
<ActivityBox data={fakeData.assetActivities} />, | |
document.getElementById('activity-feed') | |
); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment