Use ID for notification

This commit is contained in:
ajnart
2023-01-06 01:10:16 +09:00
parent 52dcdf7ba3
commit 6fb199105b

View File

@@ -5,7 +5,7 @@ import { IconEditCircle, IconEditCircleOff } from '@tabler/icons';
import { getCookie } from 'cookies-next'; import { getCookie } from 'cookies-next';
import { Trans, useTranslation } from 'next-i18next'; import { Trans, useTranslation } from 'next-i18next';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { cleanNotifications, showNotification } from '@mantine/notifications'; import { hideNotification, showNotification } from '@mantine/notifications';
import { useConfigContext } from '../../../../../config/provider'; import { useConfigContext } from '../../../../../config/provider';
import { useScreenSmallerThan } from '../../../../../hooks/useScreenSmallerThan'; import { useScreenSmallerThan } from '../../../../../hooks/useScreenSmallerThan';
@@ -47,12 +47,13 @@ export const ToggleEditModeAction = () => {
}, },
}), }),
radius: 'md', radius: 'md',
id: 'toggle-edit-mode',
autoClose: false, autoClose: false,
title: <Title order={4}>{t('popover.title')}</Title>, title: <Title order={4}>{t('popover.title')}</Title>,
message: <Trans i18nKey="layout/header/actions/toggle-edit-mode:popover.text" />, message: <Trans i18nKey="layout/header/actions/toggle-edit-mode:popover.text" />,
}); });
} else { } else {
cleanNotifications(); hideNotification('toggle-edit-mode');
} }
}; };
const { primaryColor, secondaryColor } = useColorTheme(); const { primaryColor, secondaryColor } = useColorTheme();