forked from atom/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpr-status-context-view.js
More file actions
46 lines (42 loc) · 1.38 KB
/
Copy pathpr-status-context-view.js
File metadata and controls
46 lines (42 loc) · 1.38 KB
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
import React from 'react';
import {createFragmentContainer, graphql} from 'react-relay';
import PropTypes from 'prop-types';
import Octicon from '../atom/octicon';
import {buildStatusFromStatusContext} from '../models/build-status';
export class BarePrStatusContextView extends React.Component {
static propTypes = {
context: PropTypes.shape({
context: PropTypes.string.isRequired,
description: PropTypes.string,
state: PropTypes.string.isRequired,
targetUrl: PropTypes.string,
}).isRequired,
}
render() {
const {context, description, state, targetUrl} = this.props.context;
const {icon, classSuffix} = buildStatusFromStatusContext({state});
return (
<li className="github-PrStatuses-list-item">
<span className="github-PrStatuses-list-item-icon">
<Octicon icon={icon} className={`github-PrStatuses--${classSuffix}`} />
</span>
<span className="github-PrStatuses-list-item-context">
<strong>{context}</strong> {description}
</span>
<span className="github-PrStatuses-list-item-details-link">
<a href={targetUrl}>Details</a>
</span>
</li>
);
}
}
export default createFragmentContainer(BarePrStatusContextView, {
context: graphql`
fragment prStatusContextView_context on StatusContext {
context
description
state
targetUrl
}
`,
});