|
@@ -1,12 +1,9 @@
|
|
import Switch from '@mui/material/Switch';
|
|
import Switch from '@mui/material/Switch';
|
|
import { useDispatch } from 'react-redux';
|
|
import { useDispatch } from 'react-redux';
|
|
import { showUserInfoBox } from '../../reducers/userDataReducer';
|
|
import { showUserInfoBox } from '../../reducers/userDataReducer';
|
|
-import { useSelector } from 'react-redux';
|
|
|
|
|
|
|
|
export const SwitchButton = () => {
|
|
export const SwitchButton = () => {
|
|
|
|
|
|
- let showUserInfo = useSelector(state => state.messageReducer.showUserInfoBox)// || localStorage.getItem('showBox');
|
|
|
|
-
|
|
|
|
const label = { inputProps: { 'aria-label': 'Switch demo' } };
|
|
const label = { inputProps: { 'aria-label': 'Switch demo' } };
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
@@ -20,7 +17,7 @@ export const SwitchButton = () => {
|
|
|
|
|
|
<label>Show users infobar</label>
|
|
<label>Show users infobar</label>
|
|
|
|
|
|
- <Switch {...label} size="small" defaultChecked onChange={handleChange} />
|
|
|
|
|
|
+ <Switch {...label} size="small" defaultChecked onChange={() => handleChange()} />
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|