1
0
Fork 0
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:
Fedor Katurov 2023-12-29 12:59:01 +07:00
parent e483079baf
commit ccdea72437
5 changed files with 15 additions and 5 deletions

View file

@ -86,6 +86,7 @@
"@types/react": "^17.0.2", "@types/react": "^17.0.2",
"@types/react-router-dom": "^5.1.7", "@types/react-router-dom": "^5.1.7",
"@types/throttle-debounce": "^2.1.0", "@types/throttle-debounce": "^2.1.0",
"@types/umami": "^0.1.5",
"@types/yup": "^0.29.11", "@types/yup": "^0.29.11",
"@typescript-eslint/eslint-plugin": "^5.10.1", "@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1", "@typescript-eslint/parser": "^5.10.1",

View file

@ -32,7 +32,10 @@ const Header: FC<HeaderProps> = observer(() => {
const { borisCommentedAt } = useUpdates(); const { borisCommentedAt } = useUpdates();
const { indicatorEnabled } = useNotifications(); const { indicatorEnabled } = useNotifications();
const onLogin = useCallback(() => showModal(Dialog.Login, {}), [showModal]); const onLogin = useCallback(() => {
umami.track('login-button');
showModal(Dialog.Login, {});
}, [showModal]);
const top = useScrollTop(); const top = useScrollTop();

View file

@ -25,6 +25,7 @@ const NodeCommentForm: FC<Props> = observer(({ saveComment }) => {
const onCommentSave = useCallback( const onCommentSave = useCallback(
async (comment: IComment) => { async (comment: IComment) => {
if (!isUser) { if (!isUser) {
umami.track('register-dialog-from-comment');
showRegisterDialog({}); showRegisterDialog({});
return; return;
} }

View file

@ -31,10 +31,10 @@ const NodeLayout = observer(() => {
useNodeCoverImage(node); useNodeCoverImage(node);
const onUnauthorizedLike = useCallback( const onUnauthorizedLike = useCallback(() => {
() => showRegisterDialog({}), umami.track('register-dialog-from-like');
[showRegisterDialog], showRegisterDialog({});
); }, [showRegisterDialog]);
return ( return (
<div className={styles.wrap}> <div className={styles.wrap}>

View file

@ -420,6 +420,11 @@
resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776" resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
integrity sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ== 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@*": "@types/yargs-parser@*":
version "20.2.1" version "20.2.1"
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129"