// Buddy list stuff
var BuddyListItem = React.createClass({
+ propTypes: {
+ bicon_url: React.PropTypes.string,
+ display_name: React.PropTypes.string.isRequired,
+ status_msg: React.PropTypes.string
+ },
render: function () {
return <div className="buddy">
<img className="buddyicon" src={this.props.bicon_url} />
});
var ConversationTab = React.createClass({
+ // TODO: consider DRY-ing these propTypes up by making some model classes?
+ propTypes: {
+ buddy: React.PropTypes.shape({
+ display_name: React.PropTypes.string.isRequired,
+ }).isRequired,
+ onClick: React.PropTypes.func.isRequired
+ },
render: function() {
var classname = "conv-tab";
if (this.props.active) {
});
var ConversationTabBar = React.createClass({
+ propTypes: {
+ tabs: React.PropTypes.arrayOf(
+ React.PropTypes.shape({
+ display_name: React.PropTypes.string.isRequired,
+ }).isRequired
+ ).isRequired,
+ onTabSwitch: React.PropTypes.func.isRequired,
+ focused_tab: React.PropTypes.number
+ },
render: function() {
var tabs = [];
for (var i = 0 ; i < this.props.tabs.length ; i++) {
var ConversationTextEntry = React.createClass({
mixins: [React.addons.LinkedStateMixin],
+ propTypes: {
+ onSendMessage: React.PropTypes.func.isRequired
+ },
getInitialState: function() {
return {"text": ""};
},
});
var ConversationTabContent = React.createClass({
+ propTypes: {
+ messages: React.PropTypes.arrayOf(React.PropTypes.shape({
+ direction: React.PropTypes.string.isRequired,
+ timestamp: React.PropTypes.string.isRequired,
+ text: React.PropTypes.string.isRequired
+ })).isRequired,
+ buddy: React.PropTypes.shape({
+ id: React.PropTypes.string.isRequired,
+ display_name: React.PropTypes.string.isRequired
+ }),
+ onSendMessage: React.PropTypes.func.isRequired
+ },
render: function() {
var messages = [];
for (var i = 0 ; i < this.props.messages.length ; i++) {