pl-fe: Complete migration of settings store
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import { changeSettingImmediate } from 'pl-fe/actions/settings';
|
||||
import { changeSetting } from 'pl-fe/actions/settings';
|
||||
import { Column, Button, Form, FormActions, FormGroup, Input, Text } from 'pl-fe/components/ui';
|
||||
import { useAppDispatch } from 'pl-fe/hooks';
|
||||
import toast from 'pl-fe/toast';
|
||||
@ -26,7 +26,7 @@ const DevelopersChallenge = () => {
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (answer === 'fe-pl') {
|
||||
dispatch(changeSettingImmediate(['isDeveloper'], true));
|
||||
dispatch(changeSetting(['isDeveloper'], true));
|
||||
toast.success(intl.formatMessage(messages.success));
|
||||
} else {
|
||||
toast.error(intl.formatMessage(messages.fail));
|
||||
|
||||
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
||||
import { Link, useHistory } from 'react-router-dom';
|
||||
|
||||
import { changeSettingImmediate } from 'pl-fe/actions/settings';
|
||||
import { changeSetting } from 'pl-fe/actions/settings';
|
||||
import { Column, Text } from 'pl-fe/components/ui';
|
||||
import SvgIcon from 'pl-fe/components/ui/icon/svg-icon';
|
||||
import { useAppDispatch } from 'pl-fe/hooks';
|
||||
@ -38,7 +38,7 @@ const Developers: React.FC = () => {
|
||||
const leaveDevelopers = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.preventDefault();
|
||||
|
||||
dispatch(changeSettingImmediate(['isDeveloper'], false));
|
||||
dispatch(changeSetting(['isDeveloper'], false));
|
||||
toast.success(intl.formatMessage(messages.leave));
|
||||
history.push('/');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user