diff --git a/src/app/components/Actions/Action.tsx b/src/app/components/Actions/Action.tsx index 34f84b740..31dd368ae 100644 --- a/src/app/components/Actions/Action.tsx +++ b/src/app/components/Actions/Action.tsx @@ -9,7 +9,7 @@ import { ActionProps, OptionsCursorTrueWithMargin } from '../../FrontendTypes'; import { useDispatch } from 'react-redux'; /* - This render's the individual snapshot components on the left side column + This renders the individual snapshot components on the left side column */ /** diff --git a/src/app/components/Actions/DropDown.tsx b/src/app/components/Actions/DropDown.tsx new file mode 100644 index 000000000..9459d8b1e --- /dev/null +++ b/src/app/components/Actions/DropDown.tsx @@ -0,0 +1,25 @@ +import Select from 'react-select'; +import React, { useEffect, useState } from 'react'; + +const DropDown = (): JSX.Element => { + const [hook, setHook] = useState('useState'); + + const handleChange = (selectedHook: {hooks:string}) => { + setHook(selectedHook); + } + +const options = [ + {value: 'useState', label: 'useState'}, + {value: 'useReducer', label: 'useReducer'}, + {value: 'useContext', label: 'useContext'} +]; + + return ( + { dispatch(setTab(parseInt(e.value, 10))); }} options={tabsArray} + isSearchable={false} // Disable search functionality + menuIsOpen={false} // Prevent dropdown from opening + components={customComponents} /> ); }; diff --git a/src/app/containers/ActionContainer.tsx b/src/app/containers/ActionContainer.tsx index d81e995a1..28d2acc4a 100644 --- a/src/app/containers/ActionContainer.tsx +++ b/src/app/containers/ActionContainer.tsx @@ -2,9 +2,11 @@ import React, { useEffect, useState } from 'react'; import Action from '../components/Actions/Action'; import SwitchAppDropdown from '../components/Actions/SwitchApp'; +// Import new dropdown import { emptySnapshots, changeView, changeSlider } from '../slices/mainSlice'; import { useDispatch, useSelector } from 'react-redux'; import RouteDescription from '../components/Actions/RouteDescription'; +import DropDown from '../components/Actions/DropDown'; import { ActionContainerProps, CurrentTab, MainState, Obj, RootState } from '../FrontendTypes'; import { Button, Switch } from '@mui/material'; @@ -221,6 +223,8 @@ function ActionContainer(props: ActionContainerProps): JSX.Element { {recordingActions ? : } + {/* add new component here for dropdown menu for useStae/ useReducer- ragad */} +