MainChatButtton.jsx 607 B

12345678910111213141516171819
  1. import { useSelector } from 'react-redux';
  2. import { generalMessage } from '../../../reducers/userDataReducer';
  3. import './userInfo.scss';
  4. import { store } from '../../../store';
  5. export const MainChatButtton = () => {
  6. const isPrivatChat = useSelector(state => state.userDataReducer.isPrivatChat)
  7. return (
  8. <div
  9. className={!isPrivatChat? 'online active' :'online' }
  10. onClick={() => {store.dispatch(generalMessage())}}
  11. >
  12. <div>Main Chat</div>
  13. <span style={{color: 'green'}}> for all </span>
  14. </div>
  15. )
  16. }