diff options
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Tray.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/components/Tray.js b/app/components/Tray.js new file mode 100644 index 0000000000..69f14cb7ca --- /dev/null +++ b/app/components/Tray.js @@ -0,0 +1,28 @@ +import React, { Component, PropTypes } from 'react'; +import { TrayMenu, TrayItem } from '../lib/components/TrayMenu'; + +export default class Tray extends Component { + + static propTypes = { + handle: PropTypes.object.isRequired, + } + + logout() { + this.props.login({ username: '', loggedIn: false }); + this.props.history.push('/'); + } + + render() { + const loggedIn = this.props.user && this.props.user.loggedIn; + + return ( + <TrayMenu tray={this.props.handle}> + {<TrayItem label="Log out" click={::this.logout} visible={loggedIn} />} + {<TrayItem type="separator" visible={loggedIn} />} + <TrayItem label="Privacy Policy" /> + <TrayItem label="Visit homepage" /> + </TrayMenu> + ); + } + +}
\ No newline at end of file |
