mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Added user button and menu.
This commit is contained in:
parent
a5930f1772
commit
6e23a8a53b
21 changed files with 268 additions and 83 deletions
13
hooks/useDocumentClick.js
Normal file
13
hooks/useDocumentClick.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { useEffect } from 'react';
|
||||
|
||||
export default function useDocumentClick(handler) {
|
||||
useEffect(() => {
|
||||
document.addEventListener('click', handler);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('click', handler);
|
||||
};
|
||||
}, [handler]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -31,7 +31,7 @@ export default function useRequireLogin() {
|
|||
return;
|
||||
}
|
||||
|
||||
await dispatch(updateUser({ user }));
|
||||
await dispatch(updateUser(user));
|
||||
|
||||
setUser(user);
|
||||
setLoading(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue