File tree 2 files changed +26
-0
lines changed 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ const Tab = ({
28
28
selectTab ( 3 )
29
29
}
30
30
31
+ const onSelfServiceClick = ( ) => {
32
+ if ( currentTab === 4 ) {
33
+ return
34
+ }
35
+ selectTab ( 4 )
36
+ }
37
+
31
38
const tabComponent = (
32
39
< ul className = { styles . challengeTab } >
33
40
< li
@@ -72,6 +79,20 @@ const Tab = ({
72
79
>
73
80
Users
74
81
</ li >
82
+ < li
83
+ key = 'tab-item-self-service'
84
+ className = { cn ( styles . item , { [ styles . active ] : currentTab === 4 } ) }
85
+ onClick = { onSelfServiceClick }
86
+ onKeyDown = { e => {
87
+ if ( e . key !== 'Enter' ) {
88
+ return
89
+ }
90
+ onSelfServiceClick ( )
91
+ } }
92
+ role = 'presentation'
93
+ >
94
+ Self-Service
95
+ </ li >
75
96
</ ul >
76
97
)
77
98
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class TabContainer extends Component {
41
41
this . setState ( { currentTab : 2 } )
42
42
} else if ( nextProps . history . location . pathname === '/users' ) {
43
43
this . setState ( { currentTab : 3 } )
44
+ } else if ( nextProps . history . location . pathname === '/self-service' ) {
45
+ this . setState ( { currentTab : 4 } )
44
46
} else {
45
47
this . setState ( { currentTab : 0 } )
46
48
}
@@ -85,6 +87,9 @@ class TabContainer extends Component {
85
87
} else if ( tab === 3 ) {
86
88
history . push ( '/users' )
87
89
this . setState ( { currentTab : 3 } )
90
+ } else if ( tab === 4 ) {
91
+ history . push ( '/self-service' )
92
+ this . setState ( { currentTab : 4 } )
88
93
}
89
94
90
95
resetSidebarActiveParams ( )
You can’t perform that action at this time.
0 commit comments