Skip to content

Commit f76fbcd

Browse files
feat: add toast success message for signup and signup first user
1 parent b8f2900 commit f76fbcd

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

packages/user/src/components/Signup/SignupWrapper.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useTranslation } from "@prefabs.tech/react-i18n";
22
import { Message } from "@prefabs.tech/react-ui";
33
import React, { useState } from "react";
4+
import { toast } from "react-toastify";
45

56
import { DEFAULT_PATHS } from "@/constants";
67
import { signup } from "@/supertokens";
@@ -83,6 +84,7 @@ export const SignupWrapper: React.FC<IProperties> = ({
8384
await setUser(result.user);
8485

8586
onSignupSuccess && (await onSignupSuccess(result));
87+
toast.success(`${t("signup.messages.success")}`);
8688
}
8789
})
8890
.catch(async (error) => {

packages/user/src/views/SignupFirstUser.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useTranslation } from "@prefabs.tech/react-i18n";
22
import { AuthPage, Message } from "@prefabs.tech/react-ui";
33
import { useEffect, useState } from "react";
44
import { useNavigate } from "react-router-dom";
5+
import { toast } from "react-toastify";
56

67
import { getIsFirstUser, signUpFirstUser } from "@/api/user";
78
import { DEFAULT_PATHS } from "@/constants";
@@ -51,13 +52,15 @@ export const SignUpFirstUser = ({
5152
.then(() => {
5253
setSignUpFirstUserLoading(false);
5354
setLoginLoading(true);
55+
toast.success(`${t("firstUser.signup.messages.success")}`);
5456

5557
// TODO Sign up first-user should return authenticated user from api
5658
login(credentials)
5759
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5860
.then((result: any) => {
5961
if (result?.user) {
6062
setUser(result.user);
63+
toast.success(`${t("login.messages.success")}`);
6164
}
6265
})
6366
.catch(() => {

0 commit comments

Comments
 (0)