|
1 | 1 | import React from 'react';
|
2 | 2 | import Select from 'react-select';
|
| 3 | +import Action from './Action'; |
| 4 | +import { useStoreContext } from '../store'; |
3 | 5 |
|
4 | 6 | // SwitchStateDropdown should display options including all
|
5 | 7 | // and specific states being used
|
6 | 8 | // TODO: Need to get the getter name (for functional components)
|
7 | 9 | // and state name for stateful components
|
8 | 10 | const SwitchStateDropdown = () => {
|
| 11 | + const [{ tabs, currentTab}, dispatch] = useStoreContext(); |
| 12 | + const { snapshots } = tabs[currentTab]; |
9 | 13 | // 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 |
11 | 15 | // Should consider how to import the state names being changed
|
12 | 16 | // Should display the "All state", as well as specific state names as the options
|
13 | 17 | // When clicked on "All state" >> should display all Actions
|
14 | 18 | // 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); |
15 | 21 |
|
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 | + // ]; |
21 | 27 |
|
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 | + /> |
28 | 34 | )
|
29 | 35 | }
|
30 | 36 |
|
|
0 commit comments