Merge pull request #12774 from strapi/dark-mode/tracking

[Dark mode] Tracking mode changes
This commit is contained in:
ronronscelestes 2022-03-08 11:47:33 +01:00 committed by GitHub
commit fb3a9efa8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import {
useNotification,
useOverlayBlocker,
auth,
useTracking,
} from '@strapi/helper-plugin';
import { useIntl } from 'react-intl';
import { Formik } from 'formik';
@ -64,6 +65,7 @@ const ProfilePage = () => {
const { setUserDisplayName } = useAppInfos();
const queryClient = useQueryClient();
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const toggleNotification = useNotification();
const { lockApp, unlockApp } = useOverlayBlocker();
const { notifyStatus } = useNotifyAT();
@ -100,6 +102,7 @@ const ProfilePage = () => {
setUserDisplayName(userDisplayName);
changeLocale(data.preferedLanguage);
onChangeTheme(data.currentTheme);
trackUsage('didChangeMode', { newMode: data.currentTheme });
toggleNotification({
type: 'success',