forked from atom/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbranch-view.js
More file actions
29 lines (24 loc) · 741 Bytes
/
Copy pathbranch-view.js
File metadata and controls
29 lines (24 loc) · 741 Bytes
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
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import {BranchPropType} from '../prop-types';
export default class BranchView extends React.Component {
static propTypes = {
currentBranch: BranchPropType.isRequired,
refRoot: PropTypes.func,
}
static defaultProps = {
refRoot: () => {},
}
render() {
const classNames = cx(
'github-branch', 'inline-block', {'github-branch-detached': this.props.currentBranch.isDetached()},
);
return (
<div className={classNames} ref={this.props.refRoot}>
<span className="icon icon-git-branch" />
<span className="branch-label">{this.props.currentBranch.getName()}</span>
</div>
);
}
}