1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-18 13:48:58 +02:00

fix: prod guard

This commit is contained in:
Tymoteusz Czech 2023-10-19 11:35:59 +02:00
parent aaef6ba175
commit 283a908b90
No known key found for this signature in database
GPG Key ID: 133555230D88D75F

View File

@ -1,3 +1,4 @@
import { useState } from 'react';
import { Dialogue } from 'component/common/Dialogue/Dialogue';
import { Alert } from '@mui/material';
import { Checkbox, FormControlLabel } from '@mui/material';
@ -26,9 +27,11 @@ export const FeatureStrategyProdGuard = ({
}: IFeatureStrategyProdGuardProps) => {
const { value: settings, setValue: setSettings } =
getFeatureStrategyProdGuardSettings();
const [hide, setHide] = useState(settings.hide);
const toggleHideSetting = () => {
setSettings((prev) => ({ hide: !prev.hide }));
setHide((prev) => !prev);
};
return (
@ -52,7 +55,7 @@ export const FeatureStrategyProdGuard = ({
label="Don't show again"
control={
<Checkbox
checked={settings.hide}
checked={hide}
onChange={toggleHideSetting}
/>
}