-
Notifications
You must be signed in to change notification settings - Fork 253
/
SidebarHeader.js
49 lines (47 loc) 路 1.39 KB
/
SidebarHeader.js
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
import React from 'react';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import steemconnect from 'steemconnect';
import Loading from '../../widgets/Loading';
import Icon from '../../widgets/Icon';
import Avatar from '../../widgets/Avatar';
import './SidebarHeader.scss';
const SidebarHeader = ({
auth,
user,
hideSidebar,
onClickMenu,
}) =>
<div className="SidebarHeader">
<a className="hide-sidebar" onClick={() => hideSidebar()}>
<Icon name="arrow_back" className="Icon--menu" />
</a>
<div className="SidebarHeader__log">
{
auth.isFetching &&
<Loading color="white" />
}
{
!auth.isAuthenticated && !auth.isFetching &&
<a href={steemconnect.getLoginURL()}>
<Icon name="lock_outline" />
{ ' ' }<FormattedMessage id="login" />
</a>
}
{
auth.isAuthenticated &&
<div>
<Link to={`/@${user.name}`} className="my-1">
<Avatar sm username={user.name} reputation={user.reputation}/>
</Link>
<div className="SidebarHeader__username">
@{ `${user.name} ` }
<a onClick={() => onClickMenu({menu: 'settings'})}>
<Icon name="settings" xs />
</a>
</div>
</div>
}
</div>
</div>;
export default SidebarHeader;