mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 12:26:40 +07:00
add analytic events
This commit is contained in:
parent
e483079baf
commit
ccdea72437
5 changed files with 15 additions and 5 deletions
|
@ -86,6 +86,7 @@
|
|||
"@types/react": "^17.0.2",
|
||||
"@types/react-router-dom": "^5.1.7",
|
||||
"@types/throttle-debounce": "^2.1.0",
|
||||
"@types/umami": "^0.1.5",
|
||||
"@types/yup": "^0.29.11",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||
"@typescript-eslint/parser": "^5.10.1",
|
||||
|
|
|
@ -32,7 +32,10 @@ const Header: FC<HeaderProps> = observer(() => {
|
|||
const { borisCommentedAt } = useUpdates();
|
||||
const { indicatorEnabled } = useNotifications();
|
||||
|
||||
const onLogin = useCallback(() => showModal(Dialog.Login, {}), [showModal]);
|
||||
const onLogin = useCallback(() => {
|
||||
umami.track('login-button');
|
||||
showModal(Dialog.Login, {});
|
||||
}, [showModal]);
|
||||
|
||||
const top = useScrollTop();
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ const NodeCommentForm: FC<Props> = observer(({ saveComment }) => {
|
|||
const onCommentSave = useCallback(
|
||||
async (comment: IComment) => {
|
||||
if (!isUser) {
|
||||
umami.track('register-dialog-from-comment');
|
||||
showRegisterDialog({});
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@ const NodeLayout = observer(() => {
|
|||
|
||||
useNodeCoverImage(node);
|
||||
|
||||
const onUnauthorizedLike = useCallback(
|
||||
() => showRegisterDialog({}),
|
||||
[showRegisterDialog],
|
||||
);
|
||||
const onUnauthorizedLike = useCallback(() => {
|
||||
umami.track('register-dialog-from-like');
|
||||
showRegisterDialog({});
|
||||
}, [showRegisterDialog]);
|
||||
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
|
|
|
@ -420,6 +420,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
|
||||
integrity sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==
|
||||
|
||||
"@types/umami@^0.1.5":
|
||||
version "0.1.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/umami/-/umami-0.1.5.tgz#e09b7404e65c79b5dc804130ae814ef7beb20483"
|
||||
integrity sha512-9MG8FuWArG85OOppjTU41AXF0ifAysjqqUgs68J1LOqOZKOHXLKv3G1NOYRKMAacYeL4f8rYR/spVAa+RfmDDA==
|
||||
|
||||
"@types/yargs-parser@*":
|
||||
version "20.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue