@mojito-inc/connect-wallet
Version:
Connecting wallet via metamask, wallet connect, email
14 lines (11 loc) • 565 B
JavaScript
import * as React from 'react';
import { createContext, useMemo, useContext } from 'react';
const AuthenticationContext = createContext({});
const AuthenticationProvider = ({ children, onAuthenticated }) => {
const value = useMemo(() => {
return { onAuthenticated };
}, [onAuthenticated]);
return React.createElement(AuthenticationContext.Provider, { value: value }, children);
};
const useAuthentication = () => useContext(AuthenticationContext);
export { AuthenticationContext, AuthenticationProvider as default, useAuthentication };