File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import Select from 'react-select' ;
3
3
import { useStoreContext } from '../store' ;
4
+ import { setTab } from '../actions/actions' ;
4
5
5
6
const SwitchAppDropdown = ( ) => {
6
- // const { selectedApp, loadApp, allApps } = props ;
7
+ // const { loadApp } = setTab ;
7
8
const [ { currentTab, tabs } , dispatch ] = useStoreContext ( ) ;
8
9
9
10
const tabsArray = [ ] ;
@@ -22,10 +23,11 @@ const SwitchAppDropdown = () => {
22
23
className = "react-select-container"
23
24
classNamePrefix = "react-select"
24
25
value = { currTab }
25
- // onChange={
26
- // // setApp (like setSpeed in speed dropdown) goes here
27
- // loadApp
28
- // }
26
+ // onChange={dispatch(setTab(loadApp))}
27
+ onChange = { ( e ) => {
28
+ dispatch ( setTab ( parseInt ( e . value , 10 ) ) ) ;
29
+ // console.log(e)
30
+ } }
29
31
options = { tabsArray }
30
32
/>
31
33
) ;
You can’t perform that action at this time.
0 commit comments