📈 Add umami analytics using homarr.dev

This commit is contained in:
ajnart
2023-10-24 14:46:14 +02:00
parent 31aef6f3d9
commit b9a226f59c
14 changed files with 66 additions and 38 deletions

View File

@@ -8,6 +8,7 @@ import { useStyles } from './styles';
interface GenericAvailableElementTypeProps {
name: string;
id: string;
handleAddition: () => Promise<void>;
description?: string;
image: string | Icon;
@@ -16,6 +17,7 @@ interface GenericAvailableElementTypeProps {
export const GenericAvailableElementType = ({
name,
id,
description,
image,
disabled,

View File

@@ -1,4 +1,4 @@
import { Grid, Text } from '@mantine/core';
import { Container, Grid, Text } from '@mantine/core';
import { IconCursorText } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
@@ -21,12 +21,13 @@ export const AvailableStaticTypes = ({ onClickBack }: AvailableStaticTypesProps)
</Text>
<Grid grow>
{/*
<GenericAvailableElementType
name="Static Text"
description="Display a fixed string on your dashboard"
image={IconCursorText}
handleAddition={/* TODO: add something? */ async () => {}}
/>
handleAddition={async () => {}}
/> */}
</Grid>
</>
);

View File

@@ -3,10 +3,10 @@ import { showNotification } from '@mantine/notifications';
import { Icon, IconChecks } from '@tabler/icons-react';
import { useTranslation } from 'next-i18next';
import { v4 as uuidv4 } from 'uuid';
import { useConfigContext } from '~/config/provider';
import { useConfigStore } from '~/config/store';
import { IWidget, IWidgetDefinition } from '~/widgets/widgets';
import { useEditModeStore } from '../../../../Views/useEditModeStore';
import { GenericAvailableElementType } from '../Shared/GenericElementType';
@@ -97,6 +97,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement
icon: <IconChecks stroke={1.5} />,
color: 'teal',
});
umami.track('Add widget', { id: widget.id });
};
return (
@@ -104,6 +105,7 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement
name={t('descriptor.name')}
description={t('descriptor.description') ?? undefined}
image={image}
id={widget.id}
disabled={disabled}
handleAddition={handleAddition}
/>