Convert 'info' usage to Toast
This commit is contained in:
parent
b348ca71b9
commit
642d1d8b3e
2 changed files with 3 additions and 4 deletions
|
@ -3,7 +3,6 @@ import { defineMessages, useIntl } from 'react-intl';
|
||||||
|
|
||||||
import { approveUsers } from 'soapbox/actions/admin';
|
import { approveUsers } from 'soapbox/actions/admin';
|
||||||
import { rejectUserModal } from 'soapbox/actions/moderation';
|
import { rejectUserModal } from 'soapbox/actions/moderation';
|
||||||
import snackbar from 'soapbox/actions/snackbar';
|
|
||||||
import { Stack, HStack, Text, IconButton } from 'soapbox/components/ui';
|
import { Stack, HStack, Text, IconButton } from 'soapbox/components/ui';
|
||||||
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
||||||
import { makeGetAccount } from 'soapbox/selectors';
|
import { makeGetAccount } from 'soapbox/selectors';
|
||||||
|
@ -41,7 +40,7 @@ const UnapprovedAccount: React.FC<IUnapprovedAccount> = ({ accountId }) => {
|
||||||
const handleReject = () => {
|
const handleReject = () => {
|
||||||
dispatch(rejectUserModal(intl, account.id, () => {
|
dispatch(rejectUserModal(intl, account.id, () => {
|
||||||
const message = intl.formatMessage(messages.rejected, { acct: `@${account.acct}` });
|
const message = intl.formatMessage(messages.rejected, { acct: `@${account.acct}` });
|
||||||
dispatch(snackbar.info(message));
|
toast.info(message);
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
||||||
import { Redirect } from 'react-router-dom';
|
import { Redirect } from 'react-router-dom';
|
||||||
|
|
||||||
import { resetPassword } from 'soapbox/actions/security';
|
import { resetPassword } from 'soapbox/actions/security';
|
||||||
import snackbar from 'soapbox/actions/snackbar';
|
|
||||||
import { Button, Form, FormActions, FormGroup, Input } from 'soapbox/components/ui';
|
import { Button, Form, FormActions, FormGroup, Input } from 'soapbox/components/ui';
|
||||||
import { useAppDispatch } from 'soapbox/hooks';
|
import { useAppDispatch } from 'soapbox/hooks';
|
||||||
|
import toast from 'soapbox/toast';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
nicknameOrEmail: { id: 'password_reset.fields.username_placeholder', defaultMessage: 'Email or username' },
|
nicknameOrEmail: { id: 'password_reset.fields.username_placeholder', defaultMessage: 'Email or username' },
|
||||||
|
@ -25,7 +25,7 @@ const PasswordReset = () => {
|
||||||
dispatch(resetPassword(nicknameOrEmail)).then(() => {
|
dispatch(resetPassword(nicknameOrEmail)).then(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setSuccess(true);
|
setSuccess(true);
|
||||||
dispatch(snackbar.info(intl.formatMessage(messages.confirmation)));
|
toast.info(intl.formatMessage(messages.confirmation));
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue