Add library events (#2448)

This commit is contained in:
Lipis 2020-12-04 19:18:20 +02:00 committed by GitHub
parent a2132c9bb7
commit e392bebc40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import { capitalizeString, isTransparent, setCursorForShape } from "../utils";
import Stack from "./Stack";
import useIsMobile from "../is-mobile";
import { getNonDeletedElements } from "../element";
import { trackEvent, EVENT_SHAPE } from "../analytics";
import { trackEvent, EVENT_SHAPE, EVENT_DIALOG } from "../analytics";
export const SelectedShapeActions = ({
appState,
@ -196,6 +196,9 @@ export const ShapesSwitcher = ({
title={`${capitalizeString(t("toolBar.library"))} — 9`}
aria-label={capitalizeString(t("toolBar.library"))}
onClick={() => {
if (!isLibraryOpen) {
trackEvent(EVENT_DIALOG, "library");
}
setAppState({ isLibraryOpen: !isLibraryOpen });
}}
/>