@@ -3,23 +3,23 @@ import Select from 'react-select';
3
3
import { useStoreContext } from '../store' ;
4
4
import { setTab } from '../actions/actions' ;
5
5
6
- const SwitchAppDropdown = ( ) => {
6
+ const SwitchAppDropdown = ( ) : JSX . Element => {
7
7
const [ { currentTab, tabs } , dispatch ] = useStoreContext ( ) ;
8
8
9
- const tabsArray : any [ ] = [ ] ;
9
+ const tabsArray : { } [ ] = [ ] ;
10
10
Object . keys ( tabs ) . forEach ( ( tab ) => {
11
11
tabsArray . unshift ( { value : tab , label : tabs [ tab ] . title } ) ;
12
12
} ) ;
13
13
14
- const currTab = {
14
+ const currTab : { } = {
15
15
value : currentTab ,
16
16
label : tabs [ currentTab ] . title ,
17
17
} ;
18
18
19
- const customStyles = {
20
- menu : ( provided , state ) => {
21
- const outline = state . isSelected ? 'transparent' : 'transparent' ;
22
- const margin = 0 ;
19
+ const customStyles : { } = {
20
+ menu : ( provided , state ) : { } => {
21
+ const outline : string = state . isSelected ? 'transparent' : 'transparent' ;
22
+ const margin : number = 0 ;
23
23
24
24
return { ...provided , outline, margin } ;
25
25
} ,
@@ -31,7 +31,7 @@ const SwitchAppDropdown = () => {
31
31
classNamePrefix = 'tab-select'
32
32
value = { currTab }
33
33
styles = { customStyles }
34
- onChange = { ( e ) => {
34
+ onChange = { ( e ) : void => {
35
35
dispatch ( setTab ( parseInt ( e . value , 10 ) ) ) ;
36
36
} }
37
37
options = { tabsArray }
0 commit comments