fare-privy-core 1.8.1 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/components/WalletOverview.js +1 -1
- package/dist/src/components/WalletOverview.js.map +1 -1
- package/dist/src/modals/FundWalletModal/index.d.ts +5 -1
- package/dist/src/modals/FundWalletModal/index.d.ts.map +1 -1
- package/dist/src/modals/FundWalletModal/index.js +7 -11
- package/dist/src/modals/FundWalletModal/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/modals/FundWalletModal/FundWalletModalState.d.ts +0 -5
- package/dist/src/modals/FundWalletModal/FundWalletModalState.d.ts.map +0 -1
- package/dist/src/modals/FundWalletModal/FundWalletModalState.js +0 -6
- package/dist/src/modals/FundWalletModal/FundWalletModalState.js.map +0 -1
package/README.md
CHANGED
|
@@ -161,7 +161,29 @@ A ready-to-use modal for funding your wallet, with animated carousel and exchang
|
|
|
161
161
|
- Uses `useWalletBalance` for live balances
|
|
162
162
|
- Minimal required props, npm-friendly defaults
|
|
163
163
|
|
|
164
|
-
**
|
|
164
|
+
**Props:**
|
|
165
|
+
| Prop | Type | Description |
|
|
166
|
+
|-----------|--------------|-----------------------------------|
|
|
167
|
+
| `isOpen` | `boolean` | Controls modal visibility |
|
|
168
|
+
| `onClose` | `() => void` | Function to close the modal |
|
|
169
|
+
|
|
170
|
+
**Usage Example:**
|
|
171
|
+
```tsx
|
|
172
|
+
import React, { useState } from "react";
|
|
173
|
+
import { FundWalletModal } from "fare-privy-core";
|
|
174
|
+
|
|
175
|
+
export function FundWalletModalDemo() {
|
|
176
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
177
|
+
return (
|
|
178
|
+
<>
|
|
179
|
+
<button onClick={() => setIsOpen(true)}>Open Fund Wallet Modal</button>
|
|
180
|
+
<FundWalletModal isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
|
181
|
+
</>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
You must manage the open/close state in your app. The modal will call `onClose` when the user closes it.
|
|
165
187
|
---
|
|
166
188
|
|
|
167
189
|
## 🪝 Hooks Overview
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* fare-privy-core - v1.8.
|
|
2
|
+
* fare-privy-core - v1.8.3 - Reliable Micro Hooks
|
|
3
3
|
* Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
|
|
4
4
|
*/
|
|
5
5
|
export { PrivyProvider, type PrivyProviderProps } from "./PrivyProviderTest";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletOverview.js","sourceRoot":"","sources":["../../../src/components/WalletOverview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,
|
|
1
|
+
{"version":3,"file":"WalletOverview.js","sourceRoot":"","sources":["../../../src/components/WalletOverview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAQ,MAAM,MAAO,mBAAmB,CAAC;AAczC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCjC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,YAAY,EACZ,OAAO,EACP,YAAY,GACQ,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC;IACjD,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IAEjC,OAAO,CACL,MAAC,eAAe,IAAC,OAAO,EAAE,OAAO,aAC9B,UAAU,IAAI,CACb,cAAK,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,EAAE,UAAU,GAAI,CACnE,EACD,yBAAO,YAAY,EAAE,IAAI,CAAC,IAAI,GAAQ,IACtB,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface FundWalletModalProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const FundWalletModal: React.FC<FundWalletModalProps>;
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA+C1D,CAAC"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef } from "react";
|
|
2
|
+
import { useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useActiveWallet } from "../../hooks/useActiveWallet";
|
|
4
4
|
import { CardCarousel } from "./CardCarousel";
|
|
5
|
-
import { useSnapshot } from "valtio";
|
|
6
5
|
import ModalCard from "../../components/shared/Modal/Card";
|
|
7
6
|
import { AnimatePresence } from "framer-motion";
|
|
8
|
-
|
|
9
|
-
export const FundWalletModal = () => {
|
|
7
|
+
export const FundWalletModal = ({ isOpen, onClose, }) => {
|
|
10
8
|
const modalRef = useRef(null);
|
|
11
9
|
const { activeWallet } = useActiveWallet();
|
|
12
|
-
const
|
|
10
|
+
const [stepIdx, setStepIdx] = useState(0);
|
|
13
11
|
const setIsVisible = (isVisible) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const setStepIdx = (idx) => {
|
|
18
|
-
fundWalletModalState.stepIdx = idx;
|
|
12
|
+
setStepIdx(0);
|
|
13
|
+
if (!isVisible)
|
|
14
|
+
onClose();
|
|
19
15
|
};
|
|
20
16
|
const maxHeight = useMemo(() => {
|
|
21
17
|
if (stepIdx === 2)
|
|
@@ -25,6 +21,6 @@ export const FundWalletModal = () => {
|
|
|
25
21
|
if (!activeWallet) {
|
|
26
22
|
return null;
|
|
27
23
|
}
|
|
28
|
-
return (_jsx(AnimatePresence, { children:
|
|
24
|
+
return (_jsx(AnimatePresence, { children: isOpen && (_jsx(ModalCard, { maxHeight: maxHeight, stepIdx: stepIdx, setStepIdx: setStepIdx, isVisible: isOpen, setIsVisible: setIsVisible, ref: modalRef, title: "Deposit Funds", description: _jsxs(_Fragment, { children: ["There are 2 fast and easy ways to deposit funds.", _jsx("br", {}), "No KYC. You'll be ready to play in just a few minutes!"] }), className: "fund-modal-content", children: _jsx(CardCarousel, { stepIndex: stepIdx }) })) }));
|
|
29
25
|
};
|
|
30
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9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6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fare-privy-core",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "A comprehensive React library for Privy authentication and wallet management with casino gaming features, featuring reliable micro-hooks based on proven patterns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"privy",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FundWalletModalState.d.ts","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/FundWalletModalState.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB;;;CAG/B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FundWalletModalState.js","sourceRoot":"","sources":["../../../../src/modals/FundWalletModal/FundWalletModalState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACxC,kBAAkB,EAAE,KAAK;IACzB,OAAO,EAAE,CAAC;CACX,CAAC,CAAA"}
|