Improve the frontend 3
This commit is contained in:
@@ -9,12 +9,12 @@ import {
|
||||
getCookieCategories,
|
||||
CookiePreferences
|
||||
} from '../../components/ui/CookieConsent';
|
||||
import { useToast } from '../../hooks/ui/useToast';
|
||||
import { showToast } from '../../utils/toast';
|
||||
|
||||
export const CookiePreferencesPage: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { success } = useToast();
|
||||
|
||||
|
||||
const [preferences, setPreferences] = useState<CookiePreferences>({
|
||||
essential: true,
|
||||
@@ -48,7 +48,7 @@ export const CookiePreferencesPage: React.FC = () => {
|
||||
};
|
||||
|
||||
saveCookieConsent(updatedPreferences);
|
||||
success(
|
||||
showToast.success(
|
||||
t('common:cookie.preferences_saved', 'Your cookie preferences have been saved successfully.'),
|
||||
{ title: t('common:cookie.success', 'Preferences Saved') }
|
||||
);
|
||||
@@ -66,7 +66,7 @@ export const CookiePreferencesPage: React.FC = () => {
|
||||
|
||||
saveCookieConsent(allEnabled);
|
||||
setPreferences(allEnabled);
|
||||
success(
|
||||
showToast.success(
|
||||
t('common:cookie.all_accepted', 'All cookies have been accepted.'),
|
||||
{ title: t('common:cookie.success', 'Preferences Saved') }
|
||||
);
|
||||
@@ -84,7 +84,7 @@ export const CookiePreferencesPage: React.FC = () => {
|
||||
|
||||
saveCookieConsent(essentialOnly);
|
||||
setPreferences(essentialOnly);
|
||||
success(
|
||||
showToast.success(
|
||||
t('common:cookie.only_essential', 'Only essential cookies are enabled.'),
|
||||
{ title: t('common:cookie.success', 'Preferences Saved') }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user