forked from mattermost/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTeamListItem.jsx
54 lines (51 loc) · 1.38 KB
/
TeamListItem.jsx
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
// Copyright (c) 2015-2016 Yuya Ochiai
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import PropTypes from 'prop-types';
export default class TeamListItem extends React.Component {
constructor(props) {
super(props);
this.handleTeamRemove = this.handleTeamRemove.bind(this);
this.handleTeamEditing = this.handleTeamEditing.bind(this);
}
handleTeamRemove() {
this.props.onTeamRemove();
}
handleTeamEditing() {
this.props.onTeamEditing();
}
render() {
return (
<div className='TeamListItem list-group-item'>
<div
className='TeamListItem-left'
onClick={this.props.onTeamClick}
>
<h4 className='list-group-item-heading'>{ this.props.name }</h4>
<p className='list-group-item-text'>
{ this.props.url }
</p>
</div>
<div className='pull-right'>
<a
href='#'
onClick={this.handleTeamEditing}
>{'Edit'}</a>
{' - '}
<a
href='#'
onClick={this.handleTeamRemove}
>{'Remove'}</a>
</div>
</div>
);
}
}
TeamListItem.propTypes = {
name: PropTypes.string,
onTeamEditing: PropTypes.func,
onTeamRemove: PropTypes.func,
onTeamClick: PropTypes.func,
url: PropTypes.string,
};