Skip to content

Commit

Permalink
fixing toast messages on user edit form
Browse files Browse the repository at this point in the history
  • Loading branch information
kkatusic committed Nov 21, 2024
1 parent 035394a commit bfc5521
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"label.email_confirm_code": "Confirma el codi",
"label.email_verify_banner": "Obté l'accés complet als teus comptes i projectes. Verifica la teva adreça de correu electrònic! <button>Verifica el correu</button>",
"label.email_actions_text": "Verifica el teu correu electrònic per gestionar els teus projectes!",
"label.email_error_verify": "Error de verificació del correu electrònic",
"label.enable_change": "Habilita el canvi",
"label.enable_recurring_donations": "Habilitar Donacions Recurrents",
"label.ends_on": "acaba el",
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"label.email_confirm_code": "Confirm Code",
"label.email_verify_banner": "Get the full access to your accounts and projects. Verify your email address! <button>Verify email</button>",
"label.email_actions_text": "Verify your email to manage your projects!",
"label.email_error_verify": "Error verification email",
"label.enable_change": "Enable Change",
"label.enable_recurring_donations": "Enable Recurring Donations",
"label.ends_on": "ends on",
Expand Down
1 change: 1 addition & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"label.email_confirm_code": "Confirmar código",
"label.email_verify_banner": "Obtén acceso completo a tus cuentas y proyectos. ¡Verifica tu dirección de correo electrónico! <button>Verificar correo</button>",
"label.email_actions_text": "¡Verifica tu correo electrónico para gestionar tus proyectos!",
"label.email_error_verify": "Error de verificación del correo electrónico",
"label.enable_change": "Ayuda al Cambio",
"label.enable_recurring_donations": "Habilitar Donaciones Recurrentes",
"label.ends_on": "termina el",
Expand Down
23 changes: 19 additions & 4 deletions src/components/views/onboarding/InfoStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { fetchUserByAddress } from '@/features/user/user.thunks';
import { requiredOptions, validators } from '@/lib/constants/regex';
import { useGeneralWallet } from '@/providers/generalWalletProvider';
import { client } from '@/apollo/apolloClient';
import { showToastError } from '@/lib/helpers';
import InputStyled from '@/components/styled-components/Input';
import { EInputValidation } from '@/types/inputValidation';

Expand Down Expand Up @@ -151,10 +150,16 @@ const InfoStep: FC<IStep> = ({ setStep }) => {
if (data.sendUserEmailConfirmationCodeFlow === 'EMAIL_EXIST') {
setValidationStatus(EInputValidation.WARNING);
setDisableVerifyButton(true);
showToastError(
gToast(
formatMessage({
id: 'label.email_used_another',
}),
{
type: ToastType.DANGER,
title: formatMessage({
id: 'label.email_error_verify',
}),
},
);
}

Expand All @@ -171,7 +176,12 @@ const InfoStep: FC<IStep> = ({ setStep }) => {
}
} catch (error) {
if (error instanceof Error) {
showToastError(error.message);
gToast(error.message, {
type: ToastType.DANGER,
title: formatMessage({
id: 'label.email_error_verify',
}),
});
}
console.log(error);
}
Expand Down Expand Up @@ -205,7 +215,12 @@ const InfoStep: FC<IStep> = ({ setStep }) => {
}
} catch (error) {
if (error instanceof Error) {
showToastError(error.message);
gToast(error.message, {
type: ToastType.DANGER,
title: formatMessage({
id: 'label.email_error_verify',
}),
});
}
console.log(error);
}
Expand Down

0 comments on commit bfc5521

Please sign in to comment.