Skip to content

Commit ca755db

Browse files
committed
Split full repo name
1 parent 23d0309 commit ca755db

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/js/components/repository.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@ var Repository = React.createClass({
1616
},
1717

1818
render: function () {
19+
var organisationName, repositoryName;
20+
21+
if (typeof this.props.repoName === 'string') {
22+
var splitName = this.props.repoName.split('/');
23+
organisationName = splitName[0];
24+
repositoryName = splitName[1];
25+
}
26+
1927
return (
2028
<div>
2129
<div className='row repository'>
2230
<div className='col-xs-2'><img className='avatar' src={this.getAvatar()} /></div>
23-
<div className='col-xs-10 name' onClick={this.openBrowser}>{this.props.repoName}</div>
31+
<div className='col-xs-10 name' onClick={this.openBrowser}>
32+
<span>{repositoryName}</span>
33+
/
34+
<span>{organisationName}</span>
35+
</div>
2436
</div>
2537

2638
{this.props.repo.map(function (obj) {

0 commit comments

Comments
 (0)