diff --git a/package.json b/package.json index 64dd38a27..ff3599cc9 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,6 @@ "yarn": "^1.22.17" }, "dependencies": { - "patch-package": "^6.5.0" + "patch-package": "^8.0.0" } } diff --git a/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx b/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx index b1564812f..2b9b0240b 100644 --- a/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx +++ b/packages/app-extension/src/components/Onboarding/pages/OnboardAccount.tsx @@ -77,9 +77,9 @@ export const OnboardAccount = ({ { - setOnboardingData({ username }); - nextStep(); + onNext={(username, firstName ,lastName) => { + setOnboardingData({ username, firstName, lastName }); + nextStep(); }} />, void; + onNext: (username: string, firstName: string, lastName: string) => void; }) => { const [username, setUsername] = useState(""); + const [firstName, setFirstName] = useState(""); + const [lastName, setLastName] = useState(""); const [error, setError] = useState(""); const theme = useCustomTheme(); @@ -34,12 +36,12 @@ export const UsernameForm = ({ const json = await res.json(); if (!res.ok) throw new Error(json.message || "There was an error"); - onNext(username); + onNext(username, firstName, lastName); } catch (err: any) { setError(err.message); } }, - [username] + [username, firstName, lastName] ); return ( @@ -105,6 +107,71 @@ export const UsernameForm = ({ } /> + + { + setFirstName( + e.target.value.toLowerCase().replace(/[^a-z_]/g, "") + ); + }} + error={error ? true : false} + errorMessage={error} + startAdornment={ + + + + } + /> + + + { + setLastName( + e.target.value.toLowerCase().replace(/[^a-z_]/g, "") + ); + }} + error={error ? true : false} + errorMessage={error} + startAdornment={ + + + + } + /> + + diff --git a/packages/common/src/constants.ts b/packages/common/src/constants.ts index ca9e6fc80..5e367aa59 100644 --- a/packages/common/src/constants.ts +++ b/packages/common/src/constants.ts @@ -579,7 +579,7 @@ export const ALCHEMY_ETHEREUM_MAINNET_API_KEY = "DlJr6QuBC2EaE-L60-iqQQGq9hi9-XSZ"; export const AVATAR_BASE_URL = "https://swr.xnfts.dev/avatars"; -export const BACKEND_API_URL = "https://backpack-api.xnfts.dev"; +export const BACKEND_API_URL = "http://localhost:8080"; export const REALTIME_API_URL = "https://backend-ws.xnfts.dev"; export const MESSAGING_COMMUNICATION_PUSH = "MESSAGING_COMMUNICATION_PUSH"; export const MESSAGING_COMMUNICATION_FETCH = "MESSAGING_COMMUNICATION_FETCH"; diff --git a/packages/recoil/src/context/OnboardingProvider.tsx b/packages/recoil/src/context/OnboardingProvider.tsx index e9499b6a8..be2350644 100644 --- a/packages/recoil/src/context/OnboardingProvider.tsx +++ b/packages/recoil/src/context/OnboardingProvider.tsx @@ -81,6 +81,8 @@ export type OnboardingData = { complete: boolean; inviteCode: string | undefined; username: string | null; + firstName: string | null; + lastName: string | null; action: string; keyringType: KeyringType | null; blockchain: Blockchain | null; @@ -102,6 +104,8 @@ const defaultState = { complete: false, inviteCode: undefined, username: null, + firstName: null, + lastName: null, action: "create", keyringType: null, blockchain: null, @@ -278,7 +282,7 @@ export function OnboardingProvider({ // const createUser = useCallback( async (data: Partial) => { - const { inviteCode, userId, username, keyringType } = data; + const { inviteCode, userId, username,firstName, lastName, keyringType } = data; // If userId is provided, then we are onboarding via the recover flow. if (userId) { @@ -312,6 +316,8 @@ export function OnboardingProvider({ // const body = JSON.stringify({ username, + firstName, + lastName, inviteCode, waitlistId: getWaitlistId?.(), blockchainPublicKeys,