diff options
author | nickago <ngonella@calpoly.edu> | 2015-08-06 11:05:13 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-08-06 11:44:13 -0700 |
commit | 3815ab806585afa205c074c0b40ddc31e4314190 (patch) | |
tree | eb606b7763f70f0c5171716e9f4d0405f193714c /web/react/components | |
parent | 3f987db4a5a3aacbe40ad6105e55341355ff0943 (diff) | |
download | chat-3815ab806585afa205c074c0b40ddc31e4314190.tar.gz chat-3815ab806585afa205c074c0b40ddc31e4314190.tar.bz2 chat-3815ab806585afa205c074c0b40ddc31e4314190.zip |
Added keys to array-based elements and made getMe asynchronous
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/post_list.jsx | 14 | ||||
-rw-r--r-- | web/react/components/settings_sidebar.jsx | 3 | ||||
-rw-r--r-- | web/react/components/sidebar_header.jsx | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index bb1b1704c..0ee7e9969 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -439,9 +439,9 @@ module.exports = React.createClass({ currentPostDay = utils.getDateForUnixTicks(post.create_at); if (currentPostDay.toDateString() != previousPostDay.toDateString()) { postCtls.push( - <div className="date-separator"> - <hr className="separator__hr" /> - <div className="separator__text">{currentPostDay.toDateString()}</div> + <div key="date_div" className="date-separator"> + <hr key="date_line" className="separator__hr" /> + <div key="date" className="separator__text">{currentPostDay.toDateString()}</div> </div> ); } @@ -449,9 +449,9 @@ module.exports = React.createClass({ if (post.create_at > last_viewed && !rendered_last_viewed) { rendered_last_viewed = true; postCtls.push( - <div className="new-separator"> - <hr id="new_message" className="separator__hr" /> - <div className="separator__text">New Messages</div> + <div key="unviewed_div" className="new-separator"> + <hr key="unviewed_line" id="new_message" className="separator__hr" /> + <div key="unviewedMessage" className="separator__text">New Messages</div> </div> ); } @@ -459,7 +459,7 @@ module.exports = React.createClass({ previousPostDay = currentPostDay; } } else { - postCtls.push(<LoadingScreen position="absolute" />); + postCtls.push(<LoadingScreen key="loading" position="absolute" />); } return ( diff --git a/web/react/components/settings_sidebar.jsx b/web/react/components/settings_sidebar.jsx index ae8510cf2..b4d291622 100644 --- a/web/react/components/settings_sidebar.jsx +++ b/web/react/components/settings_sidebar.jsx @@ -4,6 +4,7 @@ var utils = require('../utils/utils.jsx'); module.exports = React.createClass({ + displayName:'SettingsSidebar', updateTab: function(tab) { this.props.updateTab(tab); $('.settings-modal').addClass('display--content'); @@ -14,7 +15,7 @@ module.exports = React.createClass({ <div className=""> <ul className="nav nav-pills nav-stacked"> {this.props.tabs.map(function(tab) { - return <li className={self.props.activeTab == tab.name ? 'active' : ''}><a href="#" onClick={function(){self.updateTab(tab.name);}}><i className={tab.icon}></i>{tab.ui_name}</a></li> + return <li key={tab.name+'_li'} className={self.props.activeTab == tab.name ? 'active' : ''}><a key={tab.name + '_a'} href="#" onClick={function(){self.updateTab(tab.name);}}><i key={tab.name+'_i'} className={tab.icon}></i>{tab.ui_name}</a></li> })} </ul> </div> diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx index ba8f9bacd..023de3a19 100644 --- a/web/react/components/sidebar_header.jsx +++ b/web/react/components/sidebar_header.jsx @@ -87,7 +87,8 @@ var NavbarDropdown = React.createClass({ } }); } - teams.push(<li><a href={utils.getWindowLocationOrigin() + '/signup_team'}>Create a New Team</a></li>); + teams.push(<li key="newTeam_li"><a key="newTeam_a" href={utils.getWindowLocationOrigin() + "/signup_team" }>Create a New Team</a></li>); + return ( <ul className='nav navbar-nav navbar-right'> |