@@ -21,14 +21,16 @@ import "dme-onboarding-modal/lib/index.css";
2121### 2. Use the Component in Your React App
2222
2323``` tsx
24- import { OnboardingModal } from " dme-onboarding-modal" ;
24+ import { Button } from " dme-onboarding-modal" ;
2525
2626function Navbar() {
2727 return (
2828 <nav >
29- <OnboardingModal
30- botUsername = " MyBot"
31- walletAddress = " 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
29+ <Button
30+ modal = { {
31+ bot: " MyBot" ,
32+ address: " 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ,
33+ }}
3234 />
3335 </nav >
3436 );
@@ -40,7 +42,7 @@ function Navbar() {
4042The wallet address can be obtained from your dApp's Web3 provider, such as ** MetaMask** or ** WalletConnect** :
4143
4244``` tsx
43- import { OnboardingModal } from " dme-onboarding-modal" ;
45+ import { Button } from " dme-onboarding-modal" ;
4446import { useAccount } from " wagmi" ; // or your Web3 library
4547
4648function Navbar() {
@@ -49,9 +51,11 @@ function Navbar() {
4951 return (
5052 <nav >
5153 { address && (
52- <OnboardingModal
53- botUsername = " MyBot"
54- walletAddress = { address }
54+ <Button
55+ modal = { {
56+ bot: " MyBot" ,
57+ address ,
58+ }}
5559 />
5660 )}
5761 </nav >
@@ -63,8 +67,12 @@ function Navbar() {
6367
6468| Prop | Type | Required | Description |
6569| ------| ------| ----------| -------------|
66- | ` botUsername ` | ` string ` | Yes | Your Telegram bot's username (without the ` @ ` symbol) |
67- | ` walletAddress ` | ` string ` | Yes | The Ethereum wallet address to link with the user's Telegram account |
70+ | ` modal ` | ` object ` | Yes | Configuration object for the modal |
71+ | ` modal.bot ` | ` string ` | Yes | Your Telegram bot's username (without the ` @ ` symbol) |
72+ | ` modal.address ` | ` string ` | Yes | The Ethereum wallet address to link with the user's Telegram account |
73+ | ` modal.title ` | ` string ` | No | Custom modal title (default: "DMe") |
74+ | ` modal.description ` | ` string ` | No | Custom modal description |
75+ | ` modal.cta ` | ` string ` | No | Custom call-to-action button text (default: "Open Telegram") |
6876
6977## How It Works
7078
@@ -78,17 +86,22 @@ The modal generates a deep link to your Telegram bot with the wallet address as
7886## Example
7987
8088``` tsx
81- import { OnboardingModal } from " dme-onboarding-modal" ;
89+ import { Button } from " dme-onboarding-modal" ;
8290import " dme-onboarding-modal/lib/index.css" ;
8391
8492function App() {
8593 return (
8694 <div className = " app" >
8795 <header >
8896 <h1 >My DeFi App</h1 >
89- <OnboardingModal
90- botUsername = " MyDeFiBot"
91- walletAddress = " 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
97+ <Button
98+ modal = { {
99+ bot: " MyDeFiBot" ,
100+ address: " 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ,
101+ title: " Get Notified" ,
102+ description: " Subscribe to receive important updates about your positions." ,
103+ cta: " Subscribe Now" ,
104+ }}
92105 />
93106 </header >
94107 </div >
0 commit comments