mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
🔒 SSR UPDATE
This commit is contained in:
parent
23f82d956a
commit
cb44d3db8b
31 changed files with 991 additions and 210 deletions
|
@ -7,7 +7,7 @@ import type { PaletteOption } from './command-palette.types';
|
|||
const isModalOpen = ref(false);
|
||||
const inputRef = ref();
|
||||
const router = useRouter();
|
||||
const isMac = computed(() => window.navigator.userAgent.toLowerCase().includes('mac'));
|
||||
const isMac = computed(() => true);
|
||||
|
||||
const commandPaletteStore = useCommandPaletteStore();
|
||||
const { searchPrompt, filteredSearchResult } = storeToRefs(commandPaletteStore);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import CSelect from '@/ui/c-select/c-select.vue';
|
||||
|
||||
const { availableLocales, locale } = useI18n();
|
||||
|
||||
const localesLong: Record<string, string> = {
|
||||
|
@ -21,7 +23,7 @@ const localeOptions = computed(() =>
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<c-select
|
||||
<CSelect
|
||||
v-model:value="locale"
|
||||
:options="localeOptions"
|
||||
placeholder="Select a language"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import type Plausible from 'plausible-tracker';
|
||||
// import type Plausible from 'plausible-tracker';
|
||||
import { inject } from 'vue';
|
||||
|
||||
export { createTrackerService, useTracker };
|
||||
|
@ -7,21 +7,21 @@ export { createTrackerService, useTracker };
|
|||
function createTrackerService({ plausible }: { plausible: ReturnType<typeof Plausible> }) {
|
||||
return {
|
||||
trackEvent({ eventName }: { eventName: string }) {
|
||||
plausible.trackEvent(eventName);
|
||||
// plausible.trackEvent(eventName);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function useTracker() {
|
||||
const plausible: ReturnType<typeof Plausible> | undefined = inject('plausible');
|
||||
// const plausible: ReturnType<any> | undefined = inject('plausible');
|
||||
//
|
||||
// if (_.isNil(plausible)) {
|
||||
// throw new TypeError('Plausible must be instantiated');
|
||||
// }
|
||||
|
||||
if (_.isNil(plausible)) {
|
||||
throw new TypeError('Plausible must be instantiated');
|
||||
}
|
||||
|
||||
const tracker = createTrackerService({ plausible });
|
||||
// const tracker = createTrackerService({ plausible });
|
||||
|
||||
return {
|
||||
tracker,
|
||||
tracker: () => {},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue