cosmos-social-login-capsule-provider-ui
/
0.0.48-beta.10
cosmos-social-login-capsule-provider-ui 0.0.48-beta.10
Install from the command line:
Learn more about npm packages
$ npm install @leapwallet/cosmos-social-login-capsule-provider-ui@0.0.48-beta.10
Install via package.json:
"@leapwallet/cosmos-social-login-capsule-provider-ui": "0.0.48-beta.10"
About this version
The CustomCapsuleModalView
component is a customizable modal view for integrating the Capsule authentication and wallet creation flow into your React application. This component is built using Chakra UI for styling and incorporates various steps such as email verification, biometric verification, and wallet creation.
To use the CustomCapsuleModalView
component in your project, you need to install the required dependencies. Run the following command:
npm install @leapwallet/cosmos-social-login-provider-ui @leapwallet/cosmos-social-login-capsule-provider
import CustomCapsuleModalView, { lightTheme, defaultTheme } from '@leapwallet/cosmos-social-login-provider-ui';
<CustomCapsuleModalView
capsule={capsuleInstance}
showCapsuleModal={showModal}
setShowCapsuleModal={setShowModal}
onAfterLoginSuccessful={handleAfterLogin}
onLoginFailure={handleLoginFailure}
theme="light" // Optional: Specify 'light' or 'dark' theme
/>
-
capsule
: An instance of the Capsule object. -
showCapsuleModal
: A boolean indicating whether to show the Capsule modal. -
setShowCapsuleModal
: A function to control the visibility of the Capsule modal. -
onAfterLoginSuccessful
: A callback function to execute after successful login. -
onLoginFailure
: A callback function to handle login failure. -
theme
: (Optional) Specify the theme for the modal ('light' or 'dark').
The component supports light and dark themes, which can be specified using the theme
prop. The default theme is dark, and the lightTheme
and defaultTheme
themes are provided for customization.
import CustomCapsuleModalView from '@leapwallet/cosmos-social-login-provider-ui';
import { CapsuleProvider } from '@leapwallet/cosmos-social-login-capsule-provider'
const MyComponent = () => {
const [showModal, setShowModal] = useState(false);
const capsuleInstance = new Capsule(); // Replace with your Capsule instance
const handleAfterLogin = () => {
// Handle actions after successful login
};
const handleLoginFailure = () => {
// Handle actions on login failure
};
return (
<CustomCapsuleModalView
capsule={capsuleProvider?.getClient()}
showCapsuleModal={showModal}
setShowCapsuleModal={setShowModal}
onAfterLoginSuccessful={handleAfterLogin}
onLoginFailure={handleLoginFailure}
/>
);
};
Details
- cosmos-social-login-capsule-provider-ui
- leapwallet
- 6 months ago
- MIT
- 31 dependencies
Assets
- cosmos-social-login-capsule-provider-ui-0.0.48-beta.10.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0