This repository was archived by the owner on Sep 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserInformation.js
More file actions
62 lines (45 loc) · 1.77 KB
/
UserInformation.js
File metadata and controls
62 lines (45 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"use strict";
var React = require("react");
var DropdownButton = require("react-bootstrap/lib/DropdownButton");
var MenuItem = require("react-bootstrap/lib/MenuItem");
var Profile = require("./Profile");
var User = require("../models/client/User");
/**
* User information and logout
*
* @namespace components
* @class UserInformation
* @constructor
* @param {Object} props
* @param {models.client.User} props.user
*/
var UserInformation = React.createClass({
propTypes: {
user: React.PropTypes.instanceOf(User).isRequired,
},
render: function() {
var linkToProfile = "https://" + this.props.user.get("externalData").organisation_domain + "/users/profile/edit";
var linkToLogout = window.location.origin + "/logout";
return (
<div className="UserInformation">
<Profile.Overlay clickForDetails user={this.props.user} tipPlacement="left" >
<Profile.Badge user={this.props.user} size={40} />
</Profile.Overlay>
<DropdownButton id="UserInformation" className="menu" bsSize="xsmall" title={this.props.user.getFullName()} pullRight>
{/* TODO: redirect to puavo profile edit */}
<MenuItem header>
<a href={linkToProfile} target="_blank">
<i className="fa fa-cog"></i> Muokkaa profiiliasi
</a>
</MenuItem>
<MenuItem header>
<a href={linkToLogout}>
<i className="fa fa-sign-out"></i> Kirjaudu ulos
</a>
</MenuItem>
</DropdownButton>
</div>
);
}
});
module.exports = UserInformation;