mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: add event tracking (WIP)
This commit is contained in:
1 parent
dd90ceb77b
commit
b6f53017a9
2 files changed
+15
-1
No files matched your search
@@ -1,10 +1,23 @@
|
||||
<script lang="ts">
|
||||
import { trackEvent } from '$lib/actions/analytics';
|
||||
|
||||
export let disabled = false;
|
||||
export let icon: string = null;
|
||||
export let event: string = null;
|
||||
|
||||
function track() {
|
||||
if (!event) {
|
||||
return;
|
||||
}
|
||||
|
||||
trackEvent(`click_${event}`, {
|
||||
from: 'button'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<li class="drop-list-item">
|
||||
<button class="drop-button" on:click|preventDefault {disabled}>
|
||||
<button class="drop-button" on:click={track} on:click|preventDefault {disabled}>
|
||||
<span class="text"><slot /></span>
|
||||
{#if icon}
|
||||
<span class={`icon-${icon}`} aria-hidden="true" />
|
||||
|
||||
+1
@@ -136,6 +136,7 @@
|
||||
</button>
|
||||
<svelte:fragment slot="list">
|
||||
<DropListItem
|
||||
event="edit_attribute"
|
||||
icon="pencil"
|
||||
on:click={() => {
|
||||
selectedAttribute = attribute;
|
||||
|
||||
Reference in new issue
Block a user