Add small notification when adding widget

This commit is contained in:
ajnart
2023-01-04 22:46:05 +09:00
parent 14d4bdbac7
commit b0bdb4c090

View File

@@ -1,5 +1,6 @@
import { useModals } from '@mantine/modals'; import { useModals } from '@mantine/modals';
import { TablerIcon } from '@tabler/icons'; import { showNotification } from '@mantine/notifications';
import { IconChecks, TablerIcon } from '@tabler/icons';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../../../../../config/provider'; import { useConfigContext } from '../../../../../../config/provider';
import { useConfigStore } from '../../../../../../config/store'; import { useConfigStore } from '../../../../../../config/store';
@@ -61,8 +62,13 @@ export const WidgetElementType = ({ id, image, disabled, widget }: WidgetElement
true, true,
!isEditMode !isEditMode
); );
closeModal('selectElement'); closeModal('selectElement');
showNotification({
title: t('descriptor.name'),
message: t('descriptor.description'),
icon: <IconChecks stroke={1.5} />,
color: 'teal',
});
}; };
return ( return (