@@ -22,6 +22,7 @@ interface ActionProps {
22
22
componentData : { actualDuration : number } | undefined ;
23
23
state ?: Record < string , unknown > ;
24
24
viewIndex : number ;
25
+ isCurrIndex : boolean ;
25
26
handleOnkeyDown : ( e : any , i : number ) => any ;
26
27
logChangedState : ( index : number ) => any ;
27
28
}
@@ -53,6 +54,7 @@ const Action = (props: ActionProps): JSX.Element => {
53
54
componentName,
54
55
componentData,
55
56
viewIndex,
57
+ isCurrIndex,
56
58
handleOnkeyDown,
57
59
logChangedState,
58
60
} = props ;
@@ -98,43 +100,55 @@ const Action = (props: ActionProps): JSX.Element => {
98
100
return (
99
101
< div
100
102
// Invoking keyboard functionality; functionality is in ActionContainer;
101
- onKeyDown = { ( e ) => handleOnkeyDown ( e , viewIndex ) }
103
+ onKeyDown = { e => handleOnkeyDown ( e , viewIndex ) }
102
104
className = {
103
105
selected || last ? 'action-component selected' : 'action-component'
104
106
}
105
107
onClick = { ( ) => {
106
108
dispatch ( changeView ( index ) ) ;
107
109
} }
108
- role = ' presentation'
110
+ role = " presentation"
109
111
style = { index > sliderIndex ? { color : '#5f6369' } : { } }
110
112
tabIndex = { index }
111
113
>
112
114
< ReactHover options = { optionsCursorTrueWithMargin } >
113
- < Trigger type = ' trigger' >
114
- < div className = ' action-component-trigger' style = { index > sliderIndex ? { color : '#5f6369' } : { } } >
115
- < div className = ' action-component-text' >
115
+ < Trigger type = " trigger" >
116
+ < div className = " action-component-trigger" style = { index > sliderIndex ? { color : '#5f6369' } : { } } >
117
+ < div className = " action-component-text" >
116
118
{ `${ displayName } : ${ componentName !== 'nameless' ? componentName : '' } ` }
117
119
{ /* {`displayName: ${displayName}` } */ }
118
120
</ div >
119
- < button className = ' time-button' type = ' button' >
121
+ < button className = " time-button" type = " button" >
120
122
{ displayTime }
121
123
</ button >
122
- < button
123
- className = 'jump-button'
124
- onClick = { ( e : any ) : void => {
125
- e . stopPropagation ( ) ;
126
- dispatch ( changeSlider ( index ) ) ;
127
- dispatch ( changeView ( index ) ) ;
128
- } }
129
- tabIndex = { index }
130
- type = 'button'
131
- >
132
- Jump
133
- </ button >
124
+ {
125
+ isCurrIndex ? (
126
+ < button
127
+ className = "current-location"
128
+ type = "button"
129
+ >
130
+ Current
131
+ </ button >
132
+ )
133
+ : (
134
+ < button
135
+ className = "jump-button"
136
+ onClick = { ( e : any ) : void => {
137
+ e . stopPropagation ( ) ;
138
+ dispatch ( changeSlider ( index ) ) ;
139
+ dispatch ( changeView ( index ) ) ;
140
+ } }
141
+ tabIndex = { index }
142
+ type = "button"
143
+ >
144
+ Jump
145
+ </ button >
146
+ )
147
+ }
134
148
</ div >
135
149
</ Trigger >
136
- < Hover type = ' hover' >
137
- < div style = { { padding : '0.5rem 1rem' } } id = ' hover-box' >
150
+ < Hover type = " hover" >
151
+ < div style = { { padding : '0.5rem 1rem' } } id = " hover-box" >
138
152
< p > { logChangedState ( index ) } </ p >
139
153
</ div >
140
154
</ Hover >
0 commit comments