mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-20 14:56:17 -04:00
refactor(tracker): better tracker injection
This commit is contained in:
parent
bf88836dbe
commit
def60e7248
6 changed files with 67 additions and 37 deletions
|
@ -9,6 +9,7 @@ import { config } from '@/config';
|
|||
import MenuIconItem from '@/components/MenuIconItem.vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
import { useToolStore } from '@/tools/tools.store';
|
||||
import { useTracker } from '@/modules/tracker/tracker.services';
|
||||
import SearchBar from '../components/SearchBar.vue';
|
||||
import HeroGradient from '../assets/hero-gradient.svg?component';
|
||||
import MenuLayout from '../components/MenuLayout.vue';
|
||||
|
@ -23,6 +24,8 @@ const commitSha = config.app.lastCommitSha.slice(0, 7);
|
|||
const makeLabel = (tool: Tool) => () => h(RouterLink, { to: tool.path }, { default: () => tool.name });
|
||||
const makeIcon = (tool: Tool) => () => h(MenuIconItem, { tool });
|
||||
|
||||
const { tracker } = useTracker();
|
||||
|
||||
const toolStore = useToolStore();
|
||||
|
||||
const menuOptions = computed<MenuGroupOption[]>(() =>
|
||||
|
@ -157,7 +160,7 @@ const menuOptions = computed<MenuGroupOption[]>(() =>
|
|||
target="_blank"
|
||||
class="support-button"
|
||||
:bordered="false"
|
||||
@click="() => $tracker.trackEvent({ eventName: 'Support button clicked' })"
|
||||
@click="() => tracker.trackEvent({ eventName: 'Support button clicked' })"
|
||||
>
|
||||
Buy me a coffee
|
||||
<n-icon v-if="!styleStore.isSmallScreen" :component="Heart" style="margin-left: 5px" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue