diff options
author | Jack <jackdeng@gmail.com> | 2015-09-22 08:16:51 -0700 |
---|---|---|
committer | Jack <jackdeng@gmail.com> | 2015-09-22 08:16:51 -0700 |
commit | 602bed85f2b32733f73e2edddb542fa36baac462 (patch) | |
tree | 06a6ee9b609a9122bc2f0e6f6e6300f9ba79a3aa /web/react/components/admin_console/admin_sidebar_header.jsx | |
parent | a31868336f97a91bfd5a7e91e99a9b294d131f90 (diff) | |
parent | f439c82d7c885b4c530ba9da0a41b17910743b55 (diff) | |
download | chat-602bed85f2b32733f73e2edddb542fa36baac462.tar.gz chat-602bed85f2b32733f73e2edddb542fa36baac462.tar.bz2 chat-602bed85f2b32733f73e2edddb542fa36baac462.zip |
fix conflict
Diffstat (limited to 'web/react/components/admin_console/admin_sidebar_header.jsx')
-rw-r--r-- | web/react/components/admin_console/admin_sidebar_header.jsx | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/web/react/components/admin_console/admin_sidebar_header.jsx b/web/react/components/admin_console/admin_sidebar_header.jsx new file mode 100644 index 000000000..81798da45 --- /dev/null +++ b/web/react/components/admin_console/admin_sidebar_header.jsx @@ -0,0 +1,60 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var AdminNavbarDropdown = require('./admin_navbar_dropdown.jsx'); +var UserStore = require('../../stores/user_store.jsx'); + +export default class SidebarHeader extends React.Component { + constructor(props) { + super(props); + + this.toggleDropdown = this.toggleDropdown.bind(this); + + this.state = {}; + } + + toggleDropdown(e) { + e.preventDefault(); + + if (this.refs.dropdown.blockToggle) { + this.refs.dropdown.blockToggle = false; + return; + } + + $('.team__header').find('.dropdown-toggle').dropdown('toggle'); + } + + render() { + var me = UserStore.getCurrentUser(); + var profilePicture = null; + + if (!me) { + return null; + } + + if (me.last_picture_update) { + profilePicture = ( + <img + className='user__picture' + src={'/api/v1/users/' + me.id + '/image?time=' + me.update_at} + /> + ); + } + + return ( + <div className='team__header theme'> + <a + href='#' + onClick={this.toggleDropdown} + > + {profilePicture} + <div className='header__info'> + <div className='user__name'>{'@' + me.username}</div> + <div className='team__name'>{'System Console'}</div> + </div> + </a> + <AdminNavbarDropdown ref='dropdown' /> + </div> + ); + } +}
\ No newline at end of file |