Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 4955c9b

Browse files
committed
Use the new unlock icon in the button
1 parent 2ea1377 commit 4955c9b

File tree

5 files changed

+49
-8
lines changed

5 files changed

+49
-8
lines changed

lib/views/git-tab-header-view.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export default class GitTabHeaderView extends React.Component {
2222
}
2323

2424
render() {
25+
const lockIcon = this.props.contextLocked ? 'lock' : 'unlock';
26+
const lockToggleTitle = this.props.contextLocked ?
27+
'Change repository with the dropdown' :
28+
'Follow the active pane item';
29+
2530
return (
2631
<header className="github-Project">
2732
{this.renderCommitter()}
@@ -33,8 +38,9 @@ export default class GitTabHeaderView extends React.Component {
3338
</select>
3439
<button className="github-Project-lock btn btn-small"
3540
onClick={this.props.handleLockToggle}
36-
disabled={this.props.changingLock}>
37-
<Octicon icon={this.props.contextLocked ? 'lock' : 'globe'} />
41+
disabled={this.props.changingLock}
42+
title={lockToggleTitle}>
43+
<Octicon icon={lockIcon} />
3844
</button>
3945
</header>
4046
);

lib/views/github-tab-header-view.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export default class GithubTabHeaderView extends React.Component {
2020
}
2121

2222
render() {
23+
const lockIcon = this.props.contextLocked ? 'lock' : 'unlock';
24+
const lockToggleTitle = this.props.contextLocked ?
25+
'Change repository with the dropdown' :
26+
'Follow the active pane item';
27+
2328
return (
2429
<header className="github-Project">
2530
{this.renderUser()}
@@ -29,11 +34,11 @@ export default class GithubTabHeaderView extends React.Component {
2934
onChange={this.props.handleWorkDirChange}>
3035
{this.renderWorkDirs()}
3136
</select>
32-
<button
33-
className="github-Project-lock btn btn-small"
37+
<button className="github-Project-lock btn btn-small"
38+
onClick={this.props.handleLockToggle}
3439
disabled={this.props.changingLock}
35-
onClick={this.props.handleLockToggle}>
36-
<Octicon icon={this.props.contextLocked ? 'lock' : 'globe'} />
40+
title={lockToggleTitle}>
41+
<Octicon icon={lockIcon} />
3742
</button>
3843
</header>
3944
);

styles/project.less

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,38 @@
1818
}
1919

2020
&-lock.btn {
21+
width: 40px;
22+
height: 20px;
23+
padding: 0;
24+
display: flex;
25+
flex-direction: row;
26+
justify-content: center;
27+
align-items: baseline;
28+
2129
border: none;
2230
background-color: transparent;
2331
background-image: none;
32+
33+
&:active, &:hover {
34+
background-color: transparent;
35+
background-image: none;
36+
}
37+
}
38+
39+
.icon {
40+
padding: 0;
41+
margin: 0;
42+
line-height: 1em;
43+
fill: @text-color;
44+
45+
&:hover {
46+
fill: @text-color-highlight;
47+
}
48+
49+
&.icon-unlock {
50+
width: 21px;
51+
height: 17px;
52+
padding-left: 1px;
53+
}
2454
}
2555
}

test/views/git-tab-header-view.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('GitTabHeaderView', function() {
6969
it('renders unlocked when the lock is disengaged', function() {
7070
const wrapper = build({contextLocked: false});
7171

72-
assert.isTrue(wrapper.exists('Octicon[icon="globe"]'));
72+
assert.isTrue(wrapper.exists('Octicon[icon="unlock"]'));
7373
});
7474

7575
it('calls handleLockToggle when the lock is clicked', function() {

test/views/github-tab-header-view.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('GithubTabHeaderView', function() {
6565
it('renders unlocked when the lock is disengaged', function() {
6666
const wrapper = build({contextLocked: false});
6767

68-
assert.isTrue(wrapper.exists('Octicon[icon="globe"]'));
68+
assert.isTrue(wrapper.exists('Octicon[icon="unlock"]'));
6969
});
7070

7171
it('calls handleLockToggle when the lock is clicked', function() {

0 commit comments

Comments
 (0)