-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Seedless Onboarding] Account center redesign (#2607)
* feat: Implement account center redesign * fix: Continue as button spacing * fix: Failing e2e tests * refactor: useConnectWallet hook, explicit onLogin handling * fix: Failing test * fix: Show social login in overview header * fix: Move import data e2e test to global preference page
- Loading branch information
1 parent
6db3390
commit cc7398b
Showing
18 changed files
with
202 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,17 @@ | ||
import { useMPCWallet, MPCWalletState } from '@/hooks/wallets/mpc/useMPCWallet' | ||
import { type UserInfo } from '@web3auth/mpc-core-kit' | ||
import { useMPCWallet, MPCWalletState, type MPCWalletHook } from '@/hooks/wallets/mpc/useMPCWallet' | ||
import { createContext, type ReactElement } from 'react' | ||
|
||
type MPCWalletContext = { | ||
loginPending: boolean | ||
triggerLogin: () => Promise<void> | ||
resetAccount: () => Promise<void> | ||
upsertPasswordBackup: (password: string) => Promise<void> | ||
recoverFactorWithPassword: (password: string, storeDeviceFactor: boolean) => Promise<void> | ||
walletState: MPCWalletState | ||
userInfo: UserInfo | undefined | ||
} | ||
|
||
export const MpcWalletContext = createContext<MPCWalletContext>({ | ||
loginPending: false, | ||
export const MpcWalletContext = createContext<MPCWalletHook>({ | ||
walletState: MPCWalletState.NOT_INITIALIZED, | ||
triggerLogin: () => Promise.resolve(), | ||
triggerLogin: () => Promise.resolve(false), | ||
resetAccount: () => Promise.resolve(), | ||
upsertPasswordBackup: () => Promise.resolve(), | ||
recoverFactorWithPassword: () => Promise.resolve(), | ||
recoverFactorWithPassword: () => Promise.resolve(false), | ||
userInfo: undefined, | ||
}) | ||
|
||
export const MpcWalletProvider = ({ children }: { children: ReactElement }) => { | ||
const mpcValue = useMPCWallet() | ||
|
||
return ( | ||
<MpcWalletContext.Provider | ||
value={{ ...mpcValue, loginPending: mpcValue.walletState === MPCWalletState.AUTHENTICATING }} | ||
> | ||
{children} | ||
</MpcWalletContext.Provider> | ||
) | ||
return <MpcWalletContext.Provider value={mpcValue}>{children}</MpcWalletContext.Provider> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.