mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
Add maintenance toast (#3052)
This commit is contained in:
parent
a9b6c3c53f
commit
6137846391
@ -9,6 +9,7 @@ import {
|
||||
import { useMaintenance } from 'hooks/api/getters/useMaintenance/useMaintenance';
|
||||
import { useMaintenanceApi } from 'hooks/api/actions/useMaintenanceApi/useMaintenanceApi';
|
||||
import { usePlausibleTracker } from 'hooks/usePlausibleTracker';
|
||||
import useToast from 'hooks/useToast';
|
||||
|
||||
const StyledContainer = styled('div')(({ theme }) => ({
|
||||
display: 'flex',
|
||||
@ -39,7 +40,14 @@ export const MaintenanceToggle = () => {
|
||||
const { enabled, refetchMaintenance } = useMaintenance();
|
||||
const { toggleMaintenance } = useMaintenanceApi();
|
||||
const { trackEvent } = usePlausibleTracker();
|
||||
const { setToastData } = useToast();
|
||||
const updateEnabled = async () => {
|
||||
setToastData({
|
||||
type: 'success',
|
||||
title: `Maintenance mode has been successfully ${
|
||||
enabled ? 'disabled' : 'enabled'
|
||||
}`,
|
||||
});
|
||||
trackEvent('maintenance', {
|
||||
props: {
|
||||
eventType: `maintenance ${enabled ? 'de' : ''}activated`,
|
||||
|
@ -39,7 +39,7 @@ process.nextTick(async () => {
|
||||
anonymiseEventLog: false,
|
||||
responseTimeWithAppName: true,
|
||||
variantsPerEnvironment: true,
|
||||
maintenance: false,
|
||||
maintenance: true,
|
||||
featuresExportImport: true,
|
||||
newProjectOverview: true,
|
||||
projectStatusApi: true,
|
||||
|
Loading…
Reference in New Issue
Block a user