This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 408
Expand file tree
/
Copy pathgit-identity-view.js
More file actions
53 lines (50 loc) · 1.87 KB
/
git-identity-view.js
File metadata and controls
53 lines (50 loc) · 1.87 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
47
48
49
50
51
52
53
import React from 'react';
import PropTypes from 'prop-types';
import AtomTextEditor from '../atom/atom-text-editor';
export default class GitIdentityView extends React.Component {
static propTypes = {
// Model
usernameBuffer: PropTypes.object.isRequired,
emailBuffer: PropTypes.object.isRequired,
canWriteLocal: PropTypes.bool.isRequired,
// Action methods
setLocal: PropTypes.func.isRequired,
setGlobal: PropTypes.func.isRequired,
close: PropTypes.func.isRequired,
};
render() {
return (
<div className="github-GitIdentity">
<h1 className="github-GitIdentity-title">
Git Identity
</h1>
<p className="github-GitIdentity-explanation">
Please set the username and email address that you wish to use to author git commits. This will write to the
<code>user.name</code> and <code>user.email</code> values in your git configuration at the chosen scope.
</p>
<div className="github-GitIdentity-text">
<AtomTextEditor mini placeholderText="name" buffer={this.props.usernameBuffer} />
<AtomTextEditor mini placeholderText="email address" buffer={this.props.emailBuffer} />
</div>
<div className="github-GitIdentity-buttons">
<button className="btn" onClick={this.props.close}>
Cancel
</button>
<button
className="btn btn-primary"
title="Configure git for this repository"
onClick={this.props.setLocal}
disabled={!this.props.canWriteLocal}>
Use for this repository
</button>
<button
className="btn btn-primary"
title="Configure git globally for your operating system user account"
onClick={this.props.setGlobal}>
Use for all repositories
</button>
</div>
</div>
);
}
}