Skip to content

Commit 8fa0443

Browse files
committed
scroll
1 parent fa27eb2 commit 8fa0443

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/app/components/SwitchState.jsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
import React from 'react';
22
import Select from 'react-select';
3+
import Action from './Action';
4+
import { useStoreContext } from '../store';
35

46
// SwitchStateDropdown should display options including all
57
// and specific states being used
68
// TODO: Need to get the getter name (for functional components)
79
// and state name for stateful components
810
const SwitchStateDropdown = () => {
11+
const [{ tabs, currentTab}, dispatch] = useStoreContext();
12+
const { snapshots } = tabs[currentTab];
913
// Requirements:
10-
// Should be able to filter the Actions by the name of the state being changed
14+
// Should be able to filter the Actions by the name of the state being changed
1115
// Should consider how to import the state names being changed
1216
// Should display the "All state", as well as specific state names as the options
1317
// When clicked on "All state" >> should display all Actions
1418
// When clicked on a specific "state" >> should only display Actions corresponding to the state
19+
console.log('hLELLLLLLLO')
20+
console.log('what the snapshots look like:', snapshots);
1521

16-
const sampleDropdown = [
17-
{label: 'Overview'},
18-
{label: 'setUsername'},
19-
{label: 'setPassword'}
20-
];
22+
// const sampleDropdown = [
23+
// {label: 'Overview'},
24+
// {label: 'setUsername'},
25+
// {label: 'setPassword'}
26+
// ];
2127

22-
return (
23-
<Select
24-
className="state-dropdown"
25-
placeholder="Choose your state"
26-
options={sampleDropdown}
27-
/>
28+
return (
29+
<Select
30+
className="state-dropdown"
31+
placeholder="Choose your state"
32+
options={sampleDropdown}
33+
/>
2834
)
2935
}
3036

0 commit comments

Comments
 (0)