forked from atom/github
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremote-selector-view.js
38 lines (34 loc) · 1.26 KB
/
remote-selector-view.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
import React from 'react';
import PropTypes from 'prop-types';
import {RemoteSetPropType, BranchPropType} from '../prop-types';
export default class RemoteSelectorView extends React.Component {
static propTypes = {
remotes: RemoteSetPropType.isRequired,
currentBranch: BranchPropType.isRequired,
selectRemote: PropTypes.func.isRequired,
}
render() {
const {remotes, currentBranch, selectRemote} = this.props;
// todo: ask Ash how to test this before merging.
return (
<div className="github-RemoteSelector">
<div className="github-GitHub-LargeIcon icon icon-mirror" />
<h1>Select a Remote</h1>
<div className="initialize-repo-description">
<span>This repository has multiple remotes hosted at GitHub.com.
Select a remote to see pull requests associated
with the <strong>{currentBranch.getName()}</strong> branch:</span>
</div>
<ul>
{Array.from(remotes, remote => (
<li key={remote.getName()}>
<button className="btn btn-primary" onClick={e => selectRemote(e, remote)}>
{remote.getName()} ({remote.getOwner()}/{remote.getRepo()})
</button>
</li>
))}
</ul>
</div>
);
}
}