Skip to content

Commit 1a124c8

Browse files
committed
dropdown shows opened project
1 parent ae0f68f commit 1a124c8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/app/components/SwitchApp.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react';
22
import Select from 'react-select';
33
import { useStoreContext } from '../store';
4+
import { setTab } from '../actions/actions';
45

56
const SwitchAppDropdown = () => {
6-
// const { selectedApp, loadApp, allApps } = props;
7+
// const { loadApp } = setTab;
78
const [{ currentTab, tabs }, dispatch] = useStoreContext();
89

910
const tabsArray = [];
@@ -22,10 +23,11 @@ const SwitchAppDropdown = () => {
2223
className="react-select-container"
2324
classNamePrefix="react-select"
2425
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+
}}
2931
options={tabsArray}
3032
/>
3133
);

0 commit comments

Comments
 (0)