This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +49
-8
lines changed Expand file tree Collapse file tree 5 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ export default class GitTabHeaderView extends React.Component {
22
22
}
23
23
24
24
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
+
25
30
return (
26
31
< header className = "github-Project" >
27
32
{ this . renderCommitter ( ) }
@@ -33,8 +38,9 @@ export default class GitTabHeaderView extends React.Component {
33
38
</ select >
34
39
< button className = "github-Project-lock btn btn-small"
35
40
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 } />
38
44
</ button >
39
45
</ header >
40
46
) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ export default class GithubTabHeaderView extends React.Component {
20
20
}
21
21
22
22
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
+
23
28
return (
24
29
< header className = "github-Project" >
25
30
{ this . renderUser ( ) }
@@ -29,11 +34,11 @@ export default class GithubTabHeaderView extends React.Component {
29
34
onChange = { this . props . handleWorkDirChange } >
30
35
{ this . renderWorkDirs ( ) }
31
36
</ 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 }
34
39
disabled = { this . props . changingLock }
35
- onClick = { this . props . handleLockToggle } >
36
- < Octicon icon = { this . props . contextLocked ? 'lock' : 'globe' } />
40
+ title = { lockToggleTitle } >
41
+ < Octicon icon = { lockIcon } />
37
42
</ button >
38
43
</ header >
39
44
) ;
Original file line number Diff line number Diff line change 18
18
}
19
19
20
20
&-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
+
21
29
border : none ;
22
30
background-color : transparent ;
23
31
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
+ }
24
54
}
25
55
}
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ describe('GitTabHeaderView', function() {
69
69
it ( 'renders unlocked when the lock is disengaged' , function ( ) {
70
70
const wrapper = build ( { contextLocked : false } ) ;
71
71
72
- assert . isTrue ( wrapper . exists ( 'Octicon[icon="globe "]' ) ) ;
72
+ assert . isTrue ( wrapper . exists ( 'Octicon[icon="unlock "]' ) ) ;
73
73
} ) ;
74
74
75
75
it ( 'calls handleLockToggle when the lock is clicked' , function ( ) {
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ describe('GithubTabHeaderView', function() {
65
65
it ( 'renders unlocked when the lock is disengaged' , function ( ) {
66
66
const wrapper = build ( { contextLocked : false } ) ;
67
67
68
- assert . isTrue ( wrapper . exists ( 'Octicon[icon="globe "]' ) ) ;
68
+ assert . isTrue ( wrapper . exists ( 'Octicon[icon="unlock "]' ) ) ;
69
69
} ) ;
70
70
71
71
it ( 'calls handleLockToggle when the lock is clicked' , function ( ) {
You can’t perform that action at this time.
0 commit comments