diff --git a/frontend/src/components/ChannelAddButtom.jsx.jsx b/frontend/src/components/ChannelAddButtom.jsx.jsx index 29a6e55..e3ff9ee 100644 --- a/frontend/src/components/ChannelAddButtom.jsx.jsx +++ b/frontend/src/components/ChannelAddButtom.jsx.jsx @@ -1,17 +1,6 @@ import { Button } from 'react-bootstrap'; -import { useDispatch, useSelector } from 'react-redux'; -import { openModal, closeModal } from '../slices/modalsSlice'; -import Component from './Modal'; -const ButtonPlus = () => { - const dispatch = useDispatch(); - const modals = useSelector((state) => state.modals); - console.log(modals) - const hideModal = () => dispatch(closeModal()); - - const showModal = () => { - dispatch(openModal({ type: 'addChannel'})); - }; +const ButtonPlus = ({ showModal }) => { return ( <> @@ -29,7 +18,6 @@ const ButtonPlus = () => { + - {modals.type === 'addChannel' && ()} diff --git a/frontend/src/components/Modal.jsx b/frontend/src/components/Modal.jsx index b49ab8d..2fd6c29 100644 --- a/frontend/src/components/Modal.jsx +++ b/frontend/src/components/Modal.jsx @@ -25,16 +25,14 @@ const Component = ({ onHide, show }) => { }, []); return ( - - + + Add -
{ - const { data: channels = [], refetch } = useGetChannelsQuery(); const dispatch = useDispatch(); const channelsRef = useRef(null); + + const { data: channels = [], refetch } = useGetChannelsQuery(); const activeChannel = useSelector(activeChannelSelector); + const modals = useSelector((state) => state.modals); + + const hideModal = () => dispatch(closeModal()); + + // const showModal = () => { + // dispatch(openModal({ type: 'addChannel'})); + // }; return (