2020-06-19 06:51:39 -08:00
|
|
|
import React, { useCallback } from 'react'
|
|
|
|
|
import { useDispatch } from 'react-redux'
|
2021-05-25 05:58:06 -08:00
|
|
|
import { Logout as RALogout } from 'react-admin'
|
2020-11-08 09:15:46 -09:00
|
|
|
import { clearQueue } from '../actions'
|
2020-06-19 06:51:39 -08:00
|
|
|
|
2021-05-25 05:58:06 -08:00
|
|
|
const Logout = (props) => {
|
2020-06-19 06:51:39 -08:00
|
|
|
const dispatch = useDispatch()
|
|
|
|
|
const handleClick = useCallback(() => dispatch(clearQueue()), [dispatch])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<span onClick={handleClick}>
|
2021-05-25 05:58:06 -08:00
|
|
|
<RALogout {...props} />
|
2020-06-19 06:51:39 -08:00
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
2021-05-25 05:58:06 -08:00
|
|
|
|
|
|
|
|
export default Logout
|