buttonExSite.js 539 B

123456789101112131415161718192021
  1. import { Button } from 'antd';
  2. import { actionAuthLogout } from '../action';
  3. import { connect } from 'react-redux';
  4. import { Link } from 'react-router-dom/cjs/react-router-dom.min';
  5. import {useHistory} from 'react-router-dom';
  6. const ButtonExit = ({authLogaut}) => {
  7. let history = useHistory();
  8. const exit = () => {
  9. authLogaut();
  10. history.push("/");
  11. }
  12. return (
  13. <Button onClick={exit}>Выход</Button>
  14. )
  15. }
  16. const ButtonExSite = connect(null, {authLogaut:actionAuthLogout})(ButtonExit);
  17. export default ButtonExSite;