@n1xyz/wallet-widget 0.0.9 → 0.0.11
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/dist/Logic/transactionManager.d.ts +1 -1
- package/dist/Logic/transactionManager.js +1 -1
- package/dist/Logic/transactionManager.js.map +1 -1
- package/dist/Modal/LoadingFallback.js +1 -1
- package/dist/Modal/LoadingFallback.js.map +1 -1
- package/dist/Modal/NTSFlow/LoadingFallback.js +1 -1
- package/dist/Modal/NTSFlow/LoadingFallback.js.map +1 -1
- package/dist/Modal/NTSFlow/components/BackButton.js +2 -2
- package/dist/Modal/NTSFlow/components/BackButton.js.map +1 -1
- package/dist/Modal/NTSFlow/components/ModalHeader.js +1 -1
- package/dist/Modal/NTSFlow/components/ModalHeader.js.map +1 -1
- package/dist/Modal/NTSFlow/views/ConnectView.js +2 -2
- package/dist/Modal/NTSFlow/views/ConnectView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/CreateSessionView.js +5 -5
- package/dist/Modal/NTSFlow/views/CreateSessionView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/CreateUserView.js +1 -1
- package/dist/Modal/NTSFlow/views/CreateUserView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/NoWhitelistView.js +3 -3
- package/dist/Modal/NTSFlow/views/NoWhitelistView.js.map +1 -1
- package/dist/Modal/NTSFlow/views/SigningView.js +1 -1
- package/dist/Modal/NTSFlow/views/SigningView.js.map +1 -1
- package/dist/Modal/NordFlow/NordFlow.js +22 -228
- package/dist/Modal/NordFlow/NordFlow.js.map +1 -1
- package/dist/Modal/NordFlow/components/ChainButton.js +5 -5
- package/dist/Modal/NordFlow/components/ChainButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/EVMChainsButton.js +4 -4
- package/dist/Modal/NordFlow/components/EVMChainsButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/Header.d.ts +10 -0
- package/dist/Modal/NordFlow/components/Header.js +11 -0
- package/dist/Modal/NordFlow/components/Header.js.map +1 -0
- package/dist/Modal/NordFlow/components/ImageWithFallback.js +1 -1
- package/dist/Modal/NordFlow/components/ImageWithFallback.js.map +1 -1
- package/dist/Modal/NordFlow/components/LoadingSquares.js +1 -1
- package/dist/Modal/NordFlow/components/LoadingSquares.js.map +1 -1
- package/dist/Modal/NordFlow/components/MoreButton.js +4 -4
- package/dist/Modal/NordFlow/components/MoreButton.js.map +1 -1
- package/dist/Modal/NordFlow/components/TransactionTable.js +7 -10
- package/dist/Modal/NordFlow/components/TransactionTable.js.map +1 -1
- package/dist/Modal/NordFlow/components/WaitingMessage.js +1 -1
- package/dist/Modal/NordFlow/components/WaitingMessage.js.map +1 -1
- package/dist/Modal/NordFlow/components/index.d.ts +1 -0
- package/dist/Modal/NordFlow/components/index.js +1 -0
- package/dist/Modal/NordFlow/components/index.js.map +1 -1
- package/dist/Modal/NordFlow/constants.js +116 -95
- package/dist/Modal/NordFlow/constants.js.map +1 -1
- package/dist/Modal/NordFlow/context/DepositContext.d.ts +27 -0
- package/dist/Modal/NordFlow/context/DepositContext.js +308 -0
- package/dist/Modal/NordFlow/context/DepositContext.js.map +1 -0
- package/dist/Modal/NordFlow/context/FlowContext.d.ts +23 -0
- package/dist/Modal/NordFlow/context/FlowContext.js +125 -0
- package/dist/Modal/NordFlow/context/FlowContext.js.map +1 -0
- package/dist/Modal/NordFlow/context/NordProvider.d.ts +10 -0
- package/dist/Modal/NordFlow/context/NordProvider.js +14 -0
- package/dist/Modal/NordFlow/context/NordProvider.js.map +1 -0
- package/dist/Modal/NordFlow/context/WalletConnectContext.d.ts +20 -0
- package/dist/Modal/NordFlow/context/WalletConnectContext.js +214 -0
- package/dist/Modal/NordFlow/context/WalletConnectContext.js.map +1 -0
- package/dist/Modal/NordFlow/context/deposit/types.d.ts +26 -0
- package/dist/Modal/NordFlow/context/deposit/types.js +2 -0
- package/dist/Modal/NordFlow/context/deposit/types.js.map +1 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositAuth.d.ts +7 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositAuth.js +113 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositAuth.js.map +1 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositTransaction.d.ts +20 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositTransaction.js +235 -0
- package/dist/Modal/NordFlow/context/deposit/useDepositTransaction.js.map +1 -0
- package/dist/Modal/NordFlow/context/index.d.ts +5 -0
- package/dist/Modal/NordFlow/context/index.js +8 -0
- package/dist/Modal/NordFlow/context/index.js.map +1 -0
- package/dist/Modal/NordFlow/hooks/index.d.ts +3 -5
- package/dist/Modal/NordFlow/hooks/index.js +3 -5
- package/dist/Modal/NordFlow/hooks/index.js.map +1 -1
- package/dist/Modal/NordFlow/hooks/useDepositFlow.js +2 -4
- package/dist/Modal/NordFlow/hooks/useDepositFlow.js.map +1 -1
- package/dist/Modal/NordFlow/hooks/useNordInstance.d.ts +0 -6
- package/dist/Modal/NordFlow/hooks/useNordInstance.js +2 -358
- package/dist/Modal/NordFlow/hooks/useNordInstance.js.map +1 -1
- package/dist/Modal/NordFlow/hooks/useNordWalletConnect.d.ts +0 -1
- package/dist/Modal/NordFlow/hooks/useNordWalletConnect.js +0 -1
- package/dist/Modal/NordFlow/hooks/useNordWalletConnect.js.map +1 -1
- package/dist/Modal/NordFlow/screens/00-IdleScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js +9 -0
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js.map +1 -0
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.d.ts +1 -6
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js +12 -6
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.d.ts +1 -5
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js +13 -16
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.d.ts +1 -7
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js +11 -9
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.d.ts +1 -13
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js +59 -31
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.d.ts +1 -6
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js +9 -4
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.d.ts +1 -8
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js +18 -7
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.d.ts +1 -6
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js +15 -121
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.d.ts +1 -1
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js +10 -5
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.d.ts +1 -7
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js +9 -9
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/index.d.ts +1 -0
- package/dist/Modal/NordFlow/screens/index.js +1 -0
- package/dist/Modal/NordFlow/screens/index.js.map +1 -1
- package/dist/Modal/NordFlow/types.d.ts +0 -5
- package/dist/Modal/NordFlow/types.js +0 -1
- package/dist/Modal/NordFlow/types.js.map +1 -1
- package/dist/Modal/NordFlow/utils/index.d.ts +0 -1
- package/dist/Modal/NordFlow/utils/index.js +0 -1
- package/dist/Modal/NordFlow/utils/index.js.map +1 -1
- package/dist/Modal/Sidebar/N1Sidebar.js +10 -10
- package/dist/Modal/Sidebar/N1Sidebar.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.js +3 -3
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.js +4 -4
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.js +6 -6
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.js +3 -3
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.js +7 -7
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.js +13 -13
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.js +2 -2
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.js +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.js +5 -5
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.js.map +1 -1
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.js +4 -4
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.js.map +1 -1
- package/dist/Provider/LazyWalletProvider.js +2 -0
- package/dist/Provider/LazyWalletProvider.js.map +1 -1
- package/dist/Provider/N1WalletProvider.js +48 -63
- package/dist/Provider/N1WalletProvider.js.map +1 -1
- package/dist/Provider/WalletErrorBoundary.d.ts +10 -0
- package/dist/Provider/WalletErrorBoundary.js +39 -0
- package/dist/Provider/WalletErrorBoundary.js.map +1 -0
- package/dist/Provider/hooks/useNordUserInitialization.d.ts +20 -0
- package/dist/Provider/hooks/useNordUserInitialization.js +293 -0
- package/dist/Provider/hooks/useNordUserInitialization.js.map +1 -0
- package/dist/Provider/types.d.ts +2 -0
- package/dist/Provider/types.js.map +1 -1
- package/dist/Provider/useN1WalletProvider.d.ts +37 -0
- package/dist/Provider/useN1WalletProvider.js +398 -0
- package/dist/Provider/useN1WalletProvider.js.map +1 -0
- package/dist/components/QRCodeLoader.js +1 -1
- package/dist/components/QRCodeLoader.js.map +1 -1
- package/dist/components/logos/EVMChainsGroup.js +1 -1
- package/dist/components/logos/EVMChainsGroup.js.map +1 -1
- package/dist/components/logos/MoreChainsGroup.js +1 -1
- package/dist/components/logos/MoreChainsGroup.js.map +1 -1
- package/dist/main.css +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface DepositSuccessScreenProps {
|
|
3
|
-
amount: string;
|
|
4
|
-
tableValues: TableValues;
|
|
5
|
-
onContinue: () => void;
|
|
6
|
-
}
|
|
7
|
-
export declare function DepositSuccessScreen({ amount, tableValues, onContinue, }: DepositSuccessScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
1
|
+
export declare function DepositSuccessScreen(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,8 +15,9 @@ import { TransactionTable } from '../components/TransactionTable';
|
|
|
15
15
|
import { ANIMATION_EASE, TYPING_INTERVAL } from '../constants';
|
|
16
16
|
import { useN1WalletContext } from '../../../Provider/hooks';
|
|
17
17
|
import { isNordConfigured } from '../utils/nordUtils';
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import { useDepositContext } from '../context/DepositContext';
|
|
19
|
+
export function DepositSuccessScreen() {
|
|
20
|
+
var _a = useDepositContext(), amount = _a.amount, completeDeposit = _a.completeDeposit, transactionResult = _a.transactionResult;
|
|
20
21
|
var nord = useN1WalletContext().nord;
|
|
21
22
|
var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
|
|
22
23
|
var _c = useState(false), showDetails = _c[0], setShowDetails = _c[1];
|
|
@@ -32,6 +33,15 @@ export function DepositSuccessScreen(_a) {
|
|
|
32
33
|
var _e = useState(false), isContinueEnabled = _e[0], setIsContinueEnabled = _e[1];
|
|
33
34
|
// Add state to show a message about waiting
|
|
34
35
|
var _f = useState(true), showWaitingMessage = _f[0], setShowWaitingMessage = _f[1];
|
|
36
|
+
// Create table values from transaction details
|
|
37
|
+
var tableValues = {
|
|
38
|
+
amount: { text: transactionResult.amount, visible: true, typing: false },
|
|
39
|
+
tx: { text: transactionResult.transactionId, visible: true, typing: false },
|
|
40
|
+
from: { text: transactionResult.fromAddress, visible: true, typing: false },
|
|
41
|
+
to: { text: transactionResult.toAddress, visible: true, typing: false },
|
|
42
|
+
network: { text: transactionResult.networkName, visible: true, typing: false },
|
|
43
|
+
status: { text: transactionResult.status, visible: true, typing: false },
|
|
44
|
+
};
|
|
35
45
|
// Get token information from Nord if available
|
|
36
46
|
var _g = useState('USDC'), tokenSymbol = _g[0], setTokenSymbol = _g[1];
|
|
37
47
|
// Try to get token information from Nord
|
|
@@ -51,6 +61,7 @@ export function DepositSuccessScreen(_a) {
|
|
|
51
61
|
}, [nord]);
|
|
52
62
|
// Add animation to table values
|
|
53
63
|
useEffect(function () {
|
|
64
|
+
console.log('adasdasdasd');
|
|
54
65
|
if (!showDetails)
|
|
55
66
|
return;
|
|
56
67
|
// Extract the text values from the tableValues
|
|
@@ -99,7 +110,7 @@ export function DepositSuccessScreen(_a) {
|
|
|
99
110
|
}, TYPING_INTERVAL);
|
|
100
111
|
}, index * 300); // Slightly faster staggering for better UX
|
|
101
112
|
});
|
|
102
|
-
}, [
|
|
113
|
+
}, [showDetails]);
|
|
103
114
|
// Enable the continue button after a minimum viewing time
|
|
104
115
|
useEffect(function () {
|
|
105
116
|
var enableTimer = setTimeout(function () {
|
|
@@ -111,12 +122,12 @@ export function DepositSuccessScreen(_a) {
|
|
|
111
122
|
var toggleDetails = function () {
|
|
112
123
|
setShowDetails(function (prev) { return !prev; });
|
|
113
124
|
};
|
|
114
|
-
return (_jsx("div", { className: "relative w-full px-4", children: _jsx("div", { className: "flex flex-col space-y-6", children: _jsxs("div", { className: "w-full", children: [_jsx("div", { className: "relative w-full px-3 py-3 flex items-center justify-center transition-all duration-300 ".concat(ANIMATION_EASE, " ").concat(showDetails ? 'opacity-0 max-h-0' : 'opacity-100 max-h-[200px]'), children: _jsxs("div", { className: "relative w-full px-5 py-8 transition-all duration-300 ".concat(ANIMATION_EASE, " ").concat(showDetails ? 'max-h-0 overflow-hidden' : 'max-h-[200px]'), children: [_jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -left-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -right-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -left-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -right-2 rounded-sm" }), _jsxs("p", { className: "text-5xl md:text-7xl tracking-tight text-green-500/80 dark:text-emerald-500/80 font-medium pt-4 underline text-center animate-fade-up", style: { animationDelay: '0.3s' }, children: ["+", Number(amount).toLocaleString(), _jsx("span", { className: "text-xl md:text-2xl text-green-500/50 dark:text-emerald-500/50 ml-2", children: tokenSymbol })] }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 flex justify-center -mb-3", children: _jsxs("button", { onClick: toggleDetails, className: "\n group flex items-center space-x-1 px-3 py-1 text-xs font-medium \n transition-colors duration-200 focus:outline-none\n ".concat(showDetails
|
|
125
|
+
return (_jsx("div", { className: "relative w-full px-4", children: _jsx("div", { className: "flex flex-col space-y-6", children: _jsxs("div", { className: "w-full", children: [_jsx("div", { className: "relative w-full px-3 py-3 flex items-center justify-center transition-all duration-300 ".concat(ANIMATION_EASE, " ").concat(showDetails ? 'opacity-0 max-h-0' : 'opacity-100 max-h-[200px]'), children: _jsxs("div", { className: "relative w-full px-5 py-8 transition-all duration-300 ".concat(ANIMATION_EASE, " ").concat(showDetails ? 'max-h-0 overflow-hidden' : 'max-h-[200px]'), children: [_jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -left-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -right-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -left-2 rounded-sm" }), _jsx("div", { className: "w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -right-2 rounded-sm" }), _jsxs("p", { className: "text-5xl md:text-7xl tracking-tight text-green-500/80 dark:text-emerald-500/80 font-medium pt-4 underline text-center n1-animate-fade-up", style: { animationDelay: '0.3s' }, children: ["+", Number(amount).toLocaleString(), _jsx("span", { className: "text-xl md:text-2xl text-green-500/50 dark:text-emerald-500/50 ml-2", children: tokenSymbol })] }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 flex justify-center -mb-3", children: _jsxs("button", { onClick: toggleDetails, className: "\n group flex items-center space-x-1 px-3 py-1 text-xs font-medium \n transition-colors duration-200 focus:outline-none\n ".concat(showDetails
|
|
115
126
|
? 'text-green-600 dark:text-emerald-400 hover:text-green-700 dark:hover:text-emerald-300'
|
|
116
|
-
: 'text-gray-500 dark:text-gray-400 hover:text-green-600 dark:hover:text-emerald-400', "\n "), children: [_jsx("span", { children: "View details" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3 w-3 transition-transform duration-200", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })] }) })] }) }), _jsx("div", { className: "transition-all duration-300 ease-in-out overflow-hidden ".concat(showDetails
|
|
127
|
+
: 'text-n1-gray-500 dark:text-n1-gray-400 hover:text-green-600 dark:hover:text-emerald-400', "\n "), children: [_jsx("span", { children: "View details" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-3 w-3 transition-transform duration-200", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })] }) })] }) }), _jsx("div", { className: "transition-all duration-300 ease-in-out overflow-hidden ".concat(showDetails
|
|
117
128
|
? 'max-h-[500px] opacity-100 -mt-4'
|
|
118
|
-
: 'max-h-0 opacity-0'), children: _jsx(TransactionTable, { tableValues: animatedTableValues, onClose: toggleDetails }) }), _jsxs("div", { className: "mt-6", children: [showWaitingMessage && (_jsx("p", { className: "text-sm text-gray-600 dark:text-neutral-400 text-center mb-2 animate-pulse", children: "Please wait a moment..." })), _jsx("button", { onClick: isContinueEnabled ?
|
|
129
|
+
: 'max-h-0 opacity-0'), children: _jsx(TransactionTable, { tableValues: animatedTableValues, onClose: toggleDetails }) }), _jsxs("div", { className: "mt-6", children: [showWaitingMessage && (_jsx("p", { className: "text-sm text-n1-gray-600 dark:text-neutral-400 text-center mb-2 n1-animate-pulse", children: "Please wait a moment..." })), _jsx("button", { onClick: isContinueEnabled ? completeDeposit : undefined, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n ").concat(!isContinueEnabled ? 'opacity-50 cursor-not-allowed' : '', "\n "), style: {
|
|
119
130
|
transform: isHovered && isContinueEnabled ? 'scale(0.99)' : 'scale(1)',
|
|
120
|
-
}, disabled: !isContinueEnabled, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-white\n "), children: "Continue" }) })] })] }) }) }));
|
|
131
|
+
}, disabled: !isContinueEnabled, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n "), children: "Continue" }) })] })] }) }) }));
|
|
121
132
|
}
|
|
122
133
|
//# sourceMappingURL=06-DepositSuccessScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"06-DepositSuccessScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/06-DepositSuccessScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQtD,MAAM,UAAU,oBAAoB,CAAC,EAIT;QAH1B,MAAM,YAAA,EACN,WAAW,iBAAA,EACX,UAAU,gBAAA;IAEF,IAAA,IAAI,GAAK,kBAAkB,EAAE,KAAzB,CAA0B;IAChC,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAC5C,IAAA,KAAgC,QAAQ,CAAC,KAAK,CAAC,EAA9C,WAAW,QAAA,EAAE,cAAc,QAAmB,CAAC;IAChD,IAAA,KAAgD,QAAQ,CAAc;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QACnD,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QAC/C,IAAI,EAAE,EAAE,IAAI,EAA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C,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,oLAEqB,cAAc,qJAE1C,CAAC,iBAAiB,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,qBAC5D,EACD,KAAK,EAAE;oCACL,SAAS,EACP,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;iCAC9D,EACD,QAAQ,EAAE,CAAC,iBAAiB,YAE5B,eACE,SAAS,EAAE,+FAC0D,cAAc,6HAEpF,yBAGM,GACA,IACL,IACF,GACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { TransactionTable } from '../components/TransactionTable';\nimport { ANIMATION_EASE, TYPING_INTERVAL } from '../constants';\nimport { TableValues } from '../types';\nimport { useN1WalletContext } from '../../../Provider/hooks';\nimport { isNordConfigured } from '../utils/nordUtils';\n\ninterface DepositSuccessScreenProps {\n amount: string;\n tableValues: TableValues;\n onContinue: () => void;\n}\n\nexport function DepositSuccessScreen({\n amount,\n tableValues,\n onContinue,\n}: DepositSuccessScreenProps) {\n const { nord } = useN1WalletContext();\n const [isHovered, setIsHovered] = useState(false);\n const [showDetails, setShowDetails] = useState(false);\n const [animatedTableValues, setAnimatedTableValues] = useState<TableValues>({\n amount: { text: '', visible: false, typing: false },\n tx: { text: '', visible: false, typing: false },\n from: { text: '', visible: false, typing: false },\n to: { text: '', visible: false, typing: false },\n network: { text: '', visible: false, typing: false },\n status: { text: '', visible: false, typing: false },\n });\n // Add state to track if the button should be enabled\n const [isContinueEnabled, setIsContinueEnabled] = useState(false);\n // Add state to show a message about waiting\n const [showWaitingMessage, setShowWaitingMessage] = useState(true);\n\n // Get token information from Nord if available\n const [tokenSymbol, setTokenSymbol] = useState('USDC');\n\n // Try to get token information from Nord\n useEffect(() => {\n if (nord && isNordConfigured(nord)) {\n try {\n // Find the USDC token or the first token\n const usdcToken =\n nord.tokens.find((t) => t.symbol === 'USDC') || nord.tokens[0];\n if (usdcToken) {\n setTokenSymbol(usdcToken.symbol);\n }\n } catch (error) {\n console.warn('Error getting token information from Nord:', error);\n }\n }\n }, [nord]);\n\n // Add animation to table values\n useEffect(() => {\n if (!showDetails) return;\n\n // Extract the text values from the tableValues\n const values = {\n amount: `${Number(amount).toLocaleString()} ${tokenSymbol}`,\n tx: tableValues.tx.text,\n from: tableValues.from.text,\n to: tableValues.to.text,\n network: tableValues.network.text,\n status: tableValues.status.text,\n };\n\n // Animate each field with typing effect\n Object.entries(values).forEach(([key, value], index) => {\n setTimeout(() => {\n // Make the field visible first\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n ...prev[key as keyof typeof prev],\n visible: true,\n typing: true,\n },\n }));\n\n let textIndex = 0;\n // Type out each character with the typing animation\n const interval = setInterval(() => {\n if (textIndex <= value.length) {\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n text: value.slice(0, textIndex),\n visible: true,\n typing: textIndex < value.length,\n },\n }));\n textIndex++;\n } else {\n clearInterval(interval);\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n text: value,\n visible: true,\n typing: false,\n },\n }));\n }\n }, TYPING_INTERVAL);\n }, index * 300); // Slightly faster staggering for better UX\n });\n }, [tableValues, showDetails, amount, tokenSymbol]);\n\n // Enable the continue button after a minimum viewing time\n useEffect(() => {\n const enableTimer = setTimeout(() => {\n setIsContinueEnabled(true);\n setShowWaitingMessage(false);\n }, 4000);\n\n return () => clearTimeout(enableTimer);\n }, []);\n\n const toggleDetails = () => {\n setShowDetails((prev) => !prev);\n };\n\n return (\n <div className=\"relative w-full px-4\">\n <div className=\"flex flex-col space-y-6\">\n {/* Amount display */}\n <div className=\"w-full\">\n <div\n className={`relative w-full px-3 py-3 flex items-center justify-center transition-all duration-300 ${ANIMATION_EASE} ${showDetails ? 'opacity-0 max-h-0' : 'opacity-100 max-h-[200px]'}`}\n >\n <div\n className={`relative w-full px-5 py-8 transition-all duration-300 ${ANIMATION_EASE} ${\n showDetails ? 'max-h-0 overflow-hidden' : 'max-h-[200px]'\n }`}\n >\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -left-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -right-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -left-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -right-2 rounded-sm\"></div>\n <p\n className=\"text-5xl md:text-7xl tracking-tight text-green-500/80 dark:text-emerald-500/80 font-medium pt-4 underline text-center animate-fade-up\"\n style={{ animationDelay: '0.3s' }}\n >\n +{Number(amount).toLocaleString()}\n <span className=\"text-xl md:text-2xl text-green-500/50 dark:text-emerald-500/50 ml-2\">\n {tokenSymbol}\n </span>\n </p>\n\n {/* Subtle transaction details toggle positioned at the bottom of amount display */}\n <div className=\"absolute bottom-0 left-0 right-0 flex justify-center -mb-3\">\n <button\n onClick={toggleDetails}\n className={`\n group flex items-center space-x-1 px-3 py-1 text-xs font-medium \n transition-colors duration-200 focus:outline-none\n ${\n showDetails\n ? 'text-green-600 dark:text-emerald-400 hover:text-green-700 dark:hover:text-emerald-300'\n : 'text-gray-500 dark:text-gray-400 hover:text-green-600 dark:hover:text-emerald-400'\n }\n `}\n >\n <span>View details</span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3 transition-transform duration-200\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n <div\n className={`transition-all duration-300 ease-in-out overflow-hidden ${\n showDetails\n ? 'max-h-[500px] opacity-100 -mt-4'\n : 'max-h-0 opacity-0'\n }`}\n >\n <TransactionTable\n tableValues={animatedTableValues}\n onClose={toggleDetails}\n />\n </div>\n\n {/* Continue button */}\n <div className=\"mt-6\">\n {showWaitingMessage && (\n <p className=\"text-sm text-gray-600 dark:text-neutral-400 text-center mb-2 animate-pulse\">\n Please wait a moment...\n </p>\n )}\n <button\n onClick={isContinueEnabled ? onContinue : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-gray-200 dark:border-gray-800 hover:border-gray-400 dark:hover:border-white/60\n ${!isContinueEnabled ? 'opacity-50 cursor-not-allowed' : ''}\n `}\n style={{\n transform:\n isHovered && isContinueEnabled ? 'scale(0.99)' : 'scale(1)',\n }}\n disabled={!isContinueEnabled}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-white\n `}\n >\n Continue\n </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"06-DepositSuccessScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/06-DepositSuccessScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA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ACL,EACD,iBACE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EACxD,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,uLAEqB,cAAc,8JAE1C,CAAC,iBAAiB,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,qBAC5D,EACD,KAAK,EAAE;oCACL,SAAS,EACP,SAAS,IAAI,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;iCAC9D,EACD,QAAQ,EAAE,CAAC,iBAAiB,YAE5B,eACE,SAAS,EAAE,+FAC0D,cAAc,sIAEpF,yBAGM,GACA,IACL,IACF,GACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { TransactionTable } from '../components/TransactionTable';\nimport { ANIMATION_EASE, TYPING_INTERVAL } from '../constants';\nimport { TableValues } from '../types';\nimport { useN1WalletContext } from '../../../Provider/hooks';\nimport { isNordConfigured } from '../utils/nordUtils';\nimport { useDepositContext } from '../context/DepositContext';\nimport { getExplorerUrl } from '../../../Logic/transactionManager';\n\nexport function DepositSuccessScreen() {\n const { amount, completeDeposit, transactionResult } = useDepositContext();\n const { nord } = useN1WalletContext();\n const [isHovered, setIsHovered] = useState(false);\n const [showDetails, setShowDetails] = useState(false);\n const [animatedTableValues, setAnimatedTableValues] = useState<TableValues>({\n amount: { text: '', visible: false, typing: false },\n tx: { text: '', visible: false, typing: false },\n from: { text: '', visible: false, typing: false },\n to: { text: '', visible: false, typing: false },\n network: { text: '', visible: false, typing: false },\n status: { text: '', visible: false, typing: false },\n });\n // Add state to track if the button should be enabled\n const [isContinueEnabled, setIsContinueEnabled] = useState(false);\n // Add state to show a message about waiting\n const [showWaitingMessage, setShowWaitingMessage] = useState(true);\n \n // Create table values from transaction details\n const tableValues = {\n amount: { text: transactionResult!.amount, visible: true, typing: false },\n tx: { text: transactionResult!.transactionId, visible: true, typing: false },\n from: { text: transactionResult!.fromAddress, visible: true, typing: false },\n to: { text: transactionResult!.toAddress, visible: true, typing: false },\n network: { text: transactionResult!.networkName, visible: true, typing: false },\n status: { text: transactionResult!.status, visible: true, typing: false },\n };\n\n // Get token information from Nord if available\n const [tokenSymbol, setTokenSymbol] = useState('USDC');\n\n // Try to get token information from Nord\n useEffect(() => {\n if (nord && isNordConfigured(nord)) {\n try {\n // Find the USDC token or the first token\n const usdcToken =\n nord.tokens.find((t) => t.symbol === 'USDC') || nord.tokens[0];\n if (usdcToken) {\n setTokenSymbol(usdcToken.symbol);\n }\n } catch (error) {\n console.warn('Error getting token information from Nord:', error);\n }\n }\n }, [nord]);\n\n // Add animation to table values\n useEffect(() => {\n console.log('adasdasdasd')\n if (!showDetails) return;\n\n // Extract the text values from the tableValues\n const values = {\n amount: `${Number(amount).toLocaleString()} ${tokenSymbol}`,\n tx: tableValues.tx.text,\n from: tableValues.from.text,\n to: tableValues.to.text,\n network: tableValues.network.text,\n status: tableValues.status.text,\n };\n\n // Animate each field with typing effect\n Object.entries(values).forEach(([key, value], index) => {\n setTimeout(() => {\n // Make the field visible first\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n ...prev[key as keyof typeof prev],\n visible: true,\n typing: true,\n },\n }));\n\n let textIndex = 0;\n // Type out each character with the typing animation\n const interval = setInterval(() => {\n if (textIndex <= value.length) {\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n text: value.slice(0, textIndex),\n visible: true,\n typing: textIndex < value.length,\n },\n }));\n textIndex++;\n } else {\n clearInterval(interval);\n setAnimatedTableValues((prev) => ({\n ...prev,\n [key]: {\n text: value,\n visible: true,\n typing: false,\n },\n }));\n }\n }, TYPING_INTERVAL);\n }, index * 300); // Slightly faster staggering for better UX\n });\n }, [showDetails]);\n\n // Enable the continue button after a minimum viewing time\n useEffect(() => {\n const enableTimer = setTimeout(() => {\n setIsContinueEnabled(true);\n setShowWaitingMessage(false);\n }, 4000);\n\n return () => clearTimeout(enableTimer);\n }, []);\n\n const toggleDetails = () => {\n setShowDetails((prev) => !prev);\n };\n\n return (\n <div className=\"relative w-full px-4\">\n <div className=\"flex flex-col space-y-6\">\n {/* Amount display */}\n <div className=\"w-full\">\n <div\n className={`relative w-full px-3 py-3 flex items-center justify-center transition-all duration-300 ${ANIMATION_EASE} ${showDetails ? 'opacity-0 max-h-0' : 'opacity-100 max-h-[200px]'}`}\n >\n <div\n className={`relative w-full px-5 py-8 transition-all duration-300 ${ANIMATION_EASE} ${\n showDetails ? 'max-h-0 overflow-hidden' : 'max-h-[200px]'\n }`}\n >\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -left-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -top-2 -right-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -left-2 rounded-sm\"></div>\n <div className=\"w-2 h-2 bg-green-200 dark:bg-emerald-800 absolute -bottom-2 -right-2 rounded-sm\"></div>\n <p\n className=\"text-5xl md:text-7xl tracking-tight text-green-500/80 dark:text-emerald-500/80 font-medium pt-4 underline text-center n1-animate-fade-up\"\n style={{ animationDelay: '0.3s' }}\n >\n +{Number(amount).toLocaleString()}\n <span className=\"text-xl md:text-2xl text-green-500/50 dark:text-emerald-500/50 ml-2\">\n {tokenSymbol}\n </span>\n </p>\n\n {/* Subtle transaction details toggle positioned at the bottom of amount display */}\n <div className=\"absolute bottom-0 left-0 right-0 flex justify-center -mb-3\">\n <button\n onClick={toggleDetails}\n className={`\n group flex items-center space-x-1 px-3 py-1 text-xs font-medium \n transition-colors duration-200 focus:outline-none\n ${\n showDetails\n ? 'text-green-600 dark:text-emerald-400 hover:text-green-700 dark:hover:text-emerald-300'\n : 'text-n1-gray-500 dark:text-n1-gray-400 hover:text-green-600 dark:hover:text-emerald-400'\n }\n `}\n >\n <span>View details</span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3 transition-transform duration-200\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n </button>\n </div>\n </div>\n </div>\n <div\n className={`transition-all duration-300 ease-in-out overflow-hidden ${\n showDetails\n ? 'max-h-[500px] opacity-100 -mt-4'\n : 'max-h-0 opacity-0'\n }`}\n >\n <TransactionTable\n tableValues={animatedTableValues}\n onClose={toggleDetails}\n />\n </div>\n\n {/* Continue button */}\n <div className=\"mt-6\">\n {showWaitingMessage && (\n <p className=\"text-sm text-n1-gray-600 dark:text-neutral-400 text-center mb-2 n1-animate-pulse\">\n Please wait a moment...\n </p>\n )}\n <button\n onClick={isContinueEnabled ? completeDeposit : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n ${!isContinueEnabled ? 'opacity-50 cursor-not-allowed' : ''}\n `}\n style={{\n transform:\n isHovered && isContinueEnabled ? 'scale(0.99)' : 'scale(1)',\n }}\n disabled={!isContinueEnabled}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n `}\n >\n Continue\n </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
isCreatingAccount?: boolean;
|
|
3
|
-
onAuthComplete?: (success: boolean) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare function AuthLoadingScreen({ isCreatingAccount, onAuthComplete, }: AuthLoadingScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
1
|
+
export declare function AuthLoadingScreen(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,136 +1,30 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
-
import { useEffect,
|
|
39
|
-
import { useN1WalletContext, useN1WalletInternalContext, } from '../../../Provider/hooks';
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
40
3
|
import { LoadingSquares } from '../components/LoadingSquares';
|
|
41
|
-
import { logger } from '../../../utils/logger';
|
|
42
4
|
import { ANIMATION_EASE } from '../constants';
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
var _c = useN1WalletInternalContext(), sessionMode = _c.sessionMode, setNordUser = _c.setNordUser;
|
|
47
|
-
var _d = useN1WalletContext(), address = _d.address, nord = _d.nord, nordUser = _d.nordUser;
|
|
48
|
-
var _e = useState('loading'), authStatus = _e[0], setAuthStatus = _e[1];
|
|
49
|
-
var _f = useState(null), errorMessage = _f[0], setErrorMessage = _f[1];
|
|
50
|
-
var _g = useState(null), statusMessage = _g[0], setStatusMessage = _g[1];
|
|
51
|
-
var _h = useState(false), isHovered = _h[0], setIsHovered = _h[1];
|
|
5
|
+
import { useDepositContext } from '../context/DepositContext';
|
|
6
|
+
export function AuthLoadingScreen() {
|
|
7
|
+
var _a = useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
52
8
|
var authInitiatedRef = useRef(false);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return __generator(this, function (_a) {
|
|
56
|
-
switch (_a.label) {
|
|
57
|
-
case 0:
|
|
58
|
-
_a.trys.push([0, 3, , 4]);
|
|
59
|
-
// Step 1: Tell user to sign transaction
|
|
60
|
-
setStatusMessage('Please sign the transaction to authenticate your session');
|
|
61
|
-
if (!nordUser) {
|
|
62
|
-
throw new Error('Nord user is not initialized');
|
|
63
|
-
}
|
|
64
|
-
// Step 2: Call nordUser.refreshSession and get sessionId
|
|
65
|
-
setStatusMessage('Session is being authenticated...');
|
|
66
|
-
sessionPubKey = nordUser.sessionPubKey;
|
|
67
|
-
if (!sessionPubKey) {
|
|
68
|
-
throw new Error('Session public key is not available');
|
|
69
|
-
}
|
|
70
|
-
// Refresh the session
|
|
71
|
-
return [4 /*yield*/, nordUser.refreshSession(sessionPubKey)];
|
|
72
|
-
case 1:
|
|
73
|
-
// Refresh the session
|
|
74
|
-
_a.sent();
|
|
75
|
-
return [4 /*yield*/, nordUser.updateAccountId()];
|
|
76
|
-
case 2:
|
|
77
|
-
_a.sent();
|
|
78
|
-
sessionId = nordUser.sessionId;
|
|
79
|
-
if (!sessionId) {
|
|
80
|
-
throw new Error('Failed to get session ID after refresh');
|
|
81
|
-
}
|
|
82
|
-
logger.debug('Session refreshed successfully', {
|
|
83
|
-
sessionId: sessionId.toString(),
|
|
84
|
-
});
|
|
85
|
-
// Step 3: Store sessionId in localStorage
|
|
86
|
-
if (address) {
|
|
87
|
-
sessionIdKey = "n1_sessionId_".concat(address);
|
|
88
|
-
localStorage.setItem(sessionIdKey, sessionId.toString());
|
|
89
|
-
logger.debug('Stored sessionId in localStorage', { key: sessionIdKey });
|
|
90
|
-
}
|
|
91
|
-
// Step 4: Update status to success
|
|
92
|
-
setAuthStatus('success');
|
|
93
|
-
// Step 5: Call onAuthComplete callback with success=true
|
|
94
|
-
if (onAuthComplete) {
|
|
95
|
-
onAuthComplete(true);
|
|
96
|
-
}
|
|
97
|
-
setNordUser(nordUser);
|
|
98
|
-
return [3 /*break*/, 4];
|
|
99
|
-
case 3:
|
|
100
|
-
error_1 = _a.sent();
|
|
101
|
-
console.error('Authentication error:', error_1);
|
|
102
|
-
setAuthStatus('error');
|
|
103
|
-
setErrorMessage(error_1 instanceof Error ? error_1.message : 'Unknown error occurred');
|
|
104
|
-
return [3 /*break*/, 4];
|
|
105
|
-
case 4: return [2 /*return*/];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}); }, [onAuthComplete, isCreatingAccount, sessionMode, address, nord]);
|
|
9
|
+
// Get auth-related state and functions from DepositContext
|
|
10
|
+
var _b = useDepositContext(), performAuth = _b.performAuth, authStatus = _b.authStatus, authErrorMessage = _b.authErrorMessage, authStatusMessage = _b.authStatusMessage;
|
|
109
11
|
useEffect(function () {
|
|
110
12
|
if (!authInitiatedRef.current) {
|
|
111
13
|
authInitiatedRef.current = true;
|
|
112
14
|
performAuth();
|
|
113
15
|
}
|
|
114
|
-
}, []);
|
|
16
|
+
}, [performAuth]);
|
|
115
17
|
var handleRetry = function () {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
setStatusMessage(null);
|
|
18
|
+
// Reset and retry authentication
|
|
19
|
+
authInitiatedRef.current = false;
|
|
119
20
|
performAuth();
|
|
120
21
|
};
|
|
121
|
-
return (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [authStatus === 'loading' && _jsx(LoadingSquares, {}), authStatus === 'success' && (_jsx("div", { className: "text-green-500 text-4xl mb-4", children: "\u2713" })), authStatus === 'error' && (_jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" })), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-gray-800 dark:text-white font-semibold", children: [authStatus === 'loading' &&
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
? statusMessage
|
|
127
|
-
: 'Please wait while we create your Nord account', authStatus === 'success' &&
|
|
128
|
-
(isCreatingAccount
|
|
129
|
-
? 'Your account has been created successfully'
|
|
130
|
-
: 'You have been logged in successfully'), authStatus === 'error' &&
|
|
131
|
-
(errorMessage ||
|
|
132
|
-
'There was an error during authentication. Please try again.')] }), authStatus === 'error' && (_jsx("div", { className: "mt-6", children: _jsx("button", { onClick: handleRetry, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-gray-200 dark:border-gray-800 hover:border-gray-400 dark:hover:border-white/60\n "), style: {
|
|
22
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [authStatus === 'loading' && _jsx(LoadingSquares, {}), authStatus === 'success' && (_jsx("div", { className: "text-green-500 text-4xl mb-4", children: "\u2713" })), authStatus === 'error' && (_jsx("div", { className: "text-red-500 text-4xl mb-4", children: "\u26A0\uFE0F" })), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-n1-gray-800 dark:text-white font-semibold", children: [authStatus === 'loading' && 'Authenticating', authStatus === 'success' && 'Authentication Successful', authStatus === 'error' && 'Authentication Failed'] }), _jsxs("p", { className: "text-sm text-n1-gray-600 dark:text-neutral-400", children: [authStatus === 'loading' && authStatusMessage
|
|
23
|
+
? authStatusMessage
|
|
24
|
+
: 'Please wait while we create your Nord account', authStatus === 'success' && 'You have been logged in successfully', authStatus === 'error' &&
|
|
25
|
+
(authErrorMessage ||
|
|
26
|
+
'There was an error during authentication. Please try again.')] }), authStatus === 'error' && (_jsx("div", { className: "mt-6 space-y-3", children: _jsx("button", { onClick: handleRetry, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n "), style: {
|
|
133
27
|
transform: isHovered ? 'scale(0.99)' : 'scale(1)',
|
|
134
|
-
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-white\n "), children: "Try Again" }) }) }))] })] }));
|
|
28
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n "), children: "Try Again" }) }) }))] })] }));
|
|
135
29
|
}
|
|
136
30
|
//# sourceMappingURL=07-AuthLoadingScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"07-AuthLoadingScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/07-AuthLoadingScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"07-AuthLoadingScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/07-AuthLoadingScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAA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AC,CAAC,iBAAiB;gCACnB,CAAC,CAAC,+CAA+C,EAClD,UAAU,KAAK,SAAS,IAAI,sCAAsC,EAClE,UAAU,KAAK,OAAO;gCACrB,CAAC,gBAAgB;oCACf,6DAA6D,CAAC,IAChE,EAEH,UAAU,KAAK,OAAO,IAAI,CACzB,cAAK,SAAS,EAAC,gBAAgB,YAC7B,iBACE,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,uLAEqB,cAAc,oJAE7C,EACD,KAAK,EAAE;gCACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;6BAClD,YAED,eACE,SAAS,EAAE,+FAC0D,cAAc,sIAEpF,0BAGM,GACA,GACL,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { LoadingSquares } from '../components/LoadingSquares';\nimport { ANIMATION_EASE } from '../constants';\nimport { useDepositContext } from '../context/DepositContext';\n\nexport function AuthLoadingScreen() {\n const [isHovered, setIsHovered] = useState<boolean>(false);\n const authInitiatedRef = useRef(false);\n \n // Get auth-related state and functions from DepositContext\n const { \n performAuth,\n authStatus, \n authErrorMessage, \n authStatusMessage\n } = useDepositContext();\n\n useEffect(() => {\n if (!authInitiatedRef.current) {\n authInitiatedRef.current = true;\n performAuth();\n }\n }, [performAuth]);\n\n const handleRetry = () => {\n // Reset and retry authentication\n authInitiatedRef.current = false;\n performAuth();\n };\n\n return (\n <div className=\"flex flex-col items-center justify-center py-12 space-y-6\">\n {authStatus === 'loading' && <LoadingSquares />}\n {authStatus === 'success' && (\n <div className=\"text-green-500 text-4xl mb-4\">✓</div>\n )}\n {authStatus === 'error' && (\n <div className=\"text-red-500 text-4xl mb-4\">⚠️</div>\n )}\n\n <div className=\"space-y-2 text-center w-[300px]\">\n <h3 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold\">\n {authStatus === 'loading' && 'Authenticating'}\n {authStatus === 'success' && 'Authentication Successful'}\n {authStatus === 'error' && 'Authentication Failed'}\n </h3>\n <p className=\"text-sm text-n1-gray-600 dark:text-neutral-400\">\n {authStatus === 'loading' && authStatusMessage\n ? authStatusMessage\n : 'Please wait while we create your Nord account'}\n {authStatus === 'success' && 'You have been logged in successfully'}\n {authStatus === 'error' &&\n (authErrorMessage ||\n 'There was an error during authentication. Please try again.')}\n </p>\n\n {authStatus === 'error' && (\n <div className=\"mt-6 space-y-3\">\n <button\n onClick={handleRetry}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n `}\n style={{\n transform: isHovered ? 'scale(0.99)' : 'scale(1)',\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n `}\n >\n Try Again\n </span>\n </button>\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { ANIMATION_EASE } from '../constants';
|
|
4
3
|
import { useN1WalletContext, useN1WalletInternalContext, } from '../../../Provider/hooks';
|
|
5
4
|
import { N1SessionMode } from '../../../Provider/types';
|
|
5
|
+
import { ANIMATION_EASE } from '../constants';
|
|
6
6
|
import { isNordConfigured } from '../utils/nordUtils';
|
|
7
7
|
export function FinalSuccessScreen(_a) {
|
|
8
8
|
var onDone = _a.onDone;
|
|
9
9
|
var _b = useState(false), isHovered = _b[0], setIsHovered = _b[1];
|
|
10
|
-
var _c = useN1WalletContext(), nord = _c.nord, address = _c.address;
|
|
10
|
+
var _c = useN1WalletContext(), nord = _c.nord, address = _c.address, nordUser = _c.nordUser;
|
|
11
11
|
var _d = useN1WalletInternalContext(), sessionMode = _d.sessionMode, setIsConnected = _d.setIsConnected;
|
|
12
12
|
// Add a minimum viewing time before enabling the button
|
|
13
13
|
useEffect(function () {
|
|
14
14
|
setIsConnected(true);
|
|
15
|
-
}, []);
|
|
15
|
+
}, [setIsConnected]);
|
|
16
|
+
var handleDone = function () {
|
|
17
|
+
if (onDone) {
|
|
18
|
+
onDone();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
16
21
|
// Get the appropriate title and message based on Nord configuration
|
|
17
22
|
var getTitle = function () {
|
|
18
23
|
if (nord && isNordConfigured(nord)) {
|
|
@@ -30,8 +35,8 @@ export function FinalSuccessScreen(_a) {
|
|
|
30
35
|
return 'Your wallet has been successfully connected';
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
|
-
return (_jsx("div", { className: "overflow-hidden relative", children: _jsxs("div", { className: "space-y-8", children: [_jsxs("div", { className: "flex flex-col items-center justify-center pt-4", children: [_jsx("div", { className: "mb-6", children: _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center", children: _jsx("svg", { className: "w-10 h-10 text-green-500 dark:text-green-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }) }) }), _jsx("h2", { className: "text-2xl text-gray-800 dark:text-white font-semibold mb-2 text-center", children: getTitle() }), _jsx("p", { className: "text-lg text-gray-700 dark:text-neutral-300 text-center", children: getMessage() }), address && (_jsxs("p", { className: "text-sm text-gray-500 dark:text-neutral-400 text-center mt-2", children: ["Wallet: ", address.substring(0, 6), "...", address.substring(address.length - 4)] }))] }), _jsx("button", { onClick:
|
|
38
|
+
return (_jsx("div", { className: "overflow-hidden relative", children: _jsxs("div", { className: "space-y-8", children: [_jsxs("div", { className: "flex flex-col items-center justify-center pt-4", children: [_jsx("div", { className: "mb-6", children: _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center", children: _jsx("svg", { className: "w-10 h-10 text-green-500 dark:text-green-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }) }) }), _jsx("h2", { className: "text-2xl text-n1-gray-800 dark:text-white font-semibold mb-2 text-center", children: getTitle() }), _jsx("p", { className: "text-lg text-n1-gray-700 dark:text-neutral-300 text-center", children: getMessage() }), address && (_jsxs("p", { className: "text-sm text-n1-gray-500 dark:text-neutral-400 text-center mt-2", children: ["Wallet: ", address.substring(0, 6), "...", address.substring(address.length - 4)] }))] }), _jsx("button", { onClick: handleDone, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n "), style: {
|
|
34
39
|
transform: isHovered ? 'scale(0.99)' : 'scale(1)',
|
|
35
|
-
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-white\n "), children: "Open App" }) })] }) }));
|
|
40
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n "), children: "Open App" }) })] }) }));
|
|
36
41
|
}
|
|
37
42
|
//# sourceMappingURL=08-FinalSuccessScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"08-FinalSuccessScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/08-FinalSuccessScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"08-FinalSuccessScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/08-FinalSuccessScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,MAAM,UAAU,kBAAkB,CAAC,EAAmC;QAAjC,MAAM,YAAA;IACnC,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAC5C,IAAA,KAA8B,kBAAkB,EAAE,EAAhD,IAAI,UAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAyB,CAAC;IACnD,IAAA,KAAkC,0BAA0B,EAAE,EAA5D,WAAW,iBAAA,EAAE,cAAc,oBAAiC,CAAC;IAErE,wDAAwD;IACxD,SAAS,CAAC;QACR,cAAc,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,IAAM,UAAU,GAAG;QACjB,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,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,+KAEqB,cAAc,4IAE7C,EACD,KAAK,EAAE;wBACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;qBAClD,YAED,eACE,SAAS,EAAE,2FAC0D,cAAc,8HAEpF,yBAGM,GACA,IACL,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { N1SessionMode } from '../../../Provider/types';\nimport { ANIMATION_EASE } from '../constants';\nimport { isNordConfigured } from '../utils/nordUtils';\n\ninterface FinalSuccessScreenProps {\n onDone?: () => void;\n}\n\nexport function FinalSuccessScreen({ onDone }: FinalSuccessScreenProps) {\n const [isHovered, setIsHovered] = useState(false);\n const { nord, address, nordUser } = useN1WalletContext();\n const { sessionMode, setIsConnected } = useN1WalletInternalContext();\n \n // Add a minimum viewing time before enabling the button\n useEffect(() => {\n setIsConnected(true);\n }, [setIsConnected]);\n\n const handleDone = () => {\n if (onDone) {\n onDone();\n }\n };\n\n // Get the appropriate title and message based on Nord configuration\n const getTitle = () => {\n if (nord && isNordConfigured(nord)) {\n return 'Authentication Successful!';\n } else {\n return 'Authentication Successful!';\n }\n };\n\n const getMessage = () => {\n if (sessionMode === N1SessionMode.Nord) {\n return 'Your wallet has been successfully connected';\n } else {\n return 'Your wallet has been successfully connected';\n }\n };\n\n return (\n <div className=\"overflow-hidden relative\">\n <div className=\"space-y-8\">\n <div className=\"flex flex-col items-center justify-center pt-4\">\n <div className=\"mb-6\">\n {/* Success icon/animation */}\n <div className=\"w-20 h-20 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center\">\n <svg\n className=\"w-10 h-10 text-green-500 dark:text-green-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M5 13l4 4L19 7\"\n />\n </svg>\n </div>\n </div>\n\n <h2 className=\"text-2xl text-n1-gray-800 dark:text-white font-semibold mb-2 text-center\">\n {getTitle()}\n </h2>\n\n <p className=\"text-lg text-n1-gray-700 dark:text-neutral-300 text-center\">\n {getMessage()}\n </p>\n\n {/* Display wallet address if available */}\n {address && (\n <p className=\"text-sm text-n1-gray-500 dark:text-neutral-400 text-center mt-2\">\n Wallet: {address.substring(0, 6)}...\n {address.substring(address.length - 4)}\n </p>\n )}\n </div>\n\n <button\n onClick={handleDone}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n `}\n style={{\n transform: isHovered ? 'scale(0.99)' : 'scale(1)',\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n `}\n >\n Open App\n </span>\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
onRetry: () => void;
|
|
3
|
-
onCancel: () => void;
|
|
4
|
-
error: Error | null;
|
|
5
|
-
}
|
|
6
|
-
export declare function ErrorScreen({ onRetry, onCancel, error }: ErrorScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
export declare function ErrorScreen(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { ANIMATION_EASE } from '../constants';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
4
3
|
import { useN1WalletContext } from '../../../Provider/hooks';
|
|
4
|
+
import { ANIMATION_EASE } from '../constants';
|
|
5
|
+
import { useFlowStateContext } from '../context/FlowContext';
|
|
5
6
|
import { isNordConfigured } from '../utils/nordUtils';
|
|
6
|
-
export function ErrorScreen(
|
|
7
|
-
var
|
|
7
|
+
export function ErrorScreen() {
|
|
8
|
+
var _a = useFlowStateContext(), context = _a.context, transition = _a.transition;
|
|
8
9
|
var _b = useState(null), isHovered = _b[0], setIsHovered = _b[1];
|
|
9
10
|
var nord = useN1WalletContext().nord;
|
|
10
11
|
var _c = useState(false), isNordError = _c[0], setIsNordError = _c[1];
|
|
12
|
+
var error = context.error;
|
|
11
13
|
// Check if the error is related to Nord
|
|
12
14
|
useEffect(function () {
|
|
13
15
|
if (error &&
|
|
@@ -59,10 +61,8 @@ export function ErrorScreen(_a) {
|
|
|
59
61
|
}
|
|
60
62
|
return 'Please try again or try a different wallet.';
|
|
61
63
|
};
|
|
62
|
-
return (_jsx("div", { className: "overflow-hidden relative", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex flex-col items-center justify-center py-4", children: [_jsx("div", { className: "mb-6", children: _jsx("div", { className: "w-20 h-20 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", children: _jsx("svg", { className: "w-10 h-10 text-red-500 dark:text-red-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }) }), _jsx("h2", { className: "text-xl text-gray-800 dark:text-white font-semibold mb-2 text-center", children: isNordError ? 'Nord Error' : 'Something went wrong' }), _jsx("p", { className: "text-sm text-gray-600 dark:text-neutral-400 text-center mb-2 max-w-xs", children: errorMessage }), _jsx("p", { className: "text-xs text-gray-500 dark:text-neutral-500 text-center mb-6 max-w-xs", children: getSuggestion() })] }),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
transform: isHovered === 'cancel' ? 'scale(0.99)' : 'scale(1)',
|
|
66
|
-
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-300\n "), children: "Cancel" }) })] })] }) }));
|
|
64
|
+
return (_jsx("div", { className: "overflow-hidden relative", children: _jsxs("div", { className: "space-y-6", children: [_jsxs("div", { className: "flex flex-col items-center justify-center py-4", children: [_jsx("div", { className: "mb-6", children: _jsx("div", { className: "w-20 h-20 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", children: _jsx("svg", { className: "w-10 h-10 text-red-500 dark:text-red-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }) }) }), _jsx("h2", { className: "text-xl text-n1-gray-800 dark:text-white font-semibold mb-2 text-center", children: isNordError ? 'Nord Error' : 'Something went wrong' }), _jsx("p", { className: "text-sm text-n1-gray-600 dark:text-neutral-400 text-center mb-2 max-w-xs", children: errorMessage }), _jsx("p", { className: "text-xs text-n1-gray-500 dark:text-neutral-500 text-center mb-6 max-w-xs", children: getSuggestion() })] }), _jsx("div", { className: "space-y-3", children: _jsx("button", { onClick: function () { }, onMouseEnter: function () { return setIsHovered('cancel'); }, onMouseLeave: function () { return setIsHovered(null); }, className: "\n group relative w-full overflow-hidden rounded-md border-2 border-n1-gray-200 dark:border-n1-gray-800 bg-white dark:bg-neutral-900 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer hover:bg-n1-gray-50 dark:hover:bg-neutral-950\n "), style: {
|
|
65
|
+
transform: isHovered === 'cancel' ? 'scale(0.99)' : 'scale(1)',
|
|
66
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-gray-500 dark:text-n1-gray-400 group-hover:text-n1-gray-700 dark:group-hover:text-n1-gray-300\n "), children: "Cancel" }) }) })] }) }));
|
|
67
67
|
}
|
|
68
68
|
//# sourceMappingURL=09-ErrorScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"09-ErrorScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/09-ErrorScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"09-ErrorScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/09-ErrorScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,UAAU,WAAW;IACnB,IAAA,KAA0B,mBAAmB,EAAE,EAA7C,OAAO,aAAA,EAAE,UAAU,gBAA0B,CAAC;IAChD,IAAA,KAA4B,QAAQ,CAA4B,IAAI,CAAC,EAApE,SAAS,QAAA,EAAE,YAAY,QAA6C,CAAC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0E,YACpF,YAAY,GACX,EAEJ,YAAG,SAAS,EAAC,0EAA0E,YACpF,aAAa,EAAE,GACd,IACA,EAEN,cAAK,SAAS,EAAC,WAAW,YAwBxB,iBACE,OAAO,EAAE,cAAQ,CAAC,EAClB,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,QAAQ,CAAC,EAAtB,CAAsB,EAC1C,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACtC,SAAS,EAAE,wNAEqB,cAAc,+FAE7C,EACD,KAAK,EAAE;4BACL,SAAS,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;yBAC/D,YAED,eACE,SAAS,EAAE,6FAC0D,cAAc,wIAEpF,uBAGM,GACA,GACL,IACF,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { useN1WalletContext } from '../../../Provider/hooks';\nimport { ANIMATION_EASE } from '../constants';\nimport { useFlowStateContext } from '../context/FlowContext';\nimport { isNordConfigured } from '../utils/nordUtils';\n\nexport function ErrorScreen() {\n const { context, transition } = useFlowStateContext();\n const [isHovered, setIsHovered] = useState<'retry' | 'cancel' | null>(null);\n const { nord } = useN1WalletContext();\n const [isNordError, setIsNordError] = useState(false);\n const error = context.error;\n\n // Check if the error is related to Nord\n useEffect(() => {\n if (\n error &&\n error.message &&\n (error.message.includes('Nord') ||\n error.message.includes('nord') ||\n (error.name && error.name.includes('Nord')))\n ) {\n setIsNordError(true);\n } else {\n setIsNordError(false);\n }\n }, [error]);\n\n // Get a user-friendly error message\n const getErrorMessage = () => {\n if (!error) return 'An unexpected error occurred';\n\n // Check for specific Nord-related errors\n if (isNordError) {\n if (\n error.message.includes('connection') ||\n error.message.includes('network')\n ) {\n return 'Failed to connect to Nord. Please check your network connection and try again.';\n }\n\n if (\n error.message.includes('authentication') ||\n error.message.includes('auth')\n ) {\n return 'Authentication with Nord failed. Please try again.';\n }\n\n if (\n error.message.includes('deposit') ||\n error.message.includes('transaction')\n ) {\n return 'Failed to process your deposit. Please try again.';\n }\n\n return `Nord error: ${error.message}`;\n }\n\n // Generic wallet errors\n if (error.message.includes('wallet') || error.message.includes('Wallet')) {\n return 'There was an issue with your wallet connection. Please try again.';\n }\n\n // Default error message\n return error.message;\n };\n\n const errorMessage = getErrorMessage();\n\n // Get a suggestion based on the error\n const getSuggestion = () => {\n if (isNordError && nord && !isNordConfigured(nord)) {\n return 'Nord is not properly configured. Please check your settings.';\n }\n\n if (isNordError) {\n return 'You can try again or contact support if the issue persists.';\n }\n\n return 'Please try again or try a different wallet.';\n };\n\n\n return (\n <div className=\"overflow-hidden relative\">\n <div className=\"space-y-6\">\n <div className=\"flex flex-col items-center justify-center py-4\">\n <div className=\"mb-6\">\n {/* Error icon */}\n <div className=\"w-20 h-20 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center\">\n <svg\n className=\"w-10 h-10 text-red-500 dark:text-red-400\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\"\n />\n </svg>\n </div>\n </div>\n\n <h2 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold mb-2 text-center\">\n {isNordError ? 'Nord Error' : 'Something went wrong'}\n </h2>\n\n <p className=\"text-sm text-n1-gray-600 dark:text-neutral-400 text-center mb-2 max-w-xs\">\n {errorMessage}\n </p>\n\n <p className=\"text-xs text-n1-gray-500 dark:text-neutral-500 text-center mb-6 max-w-xs\">\n {getSuggestion()}\n </p>\n </div>\n\n <div className=\"space-y-3\">\n {/* <button\n onClick={handleRetry}\n onMouseEnter={() => setIsHovered('retry')}\n onMouseLeave={() => setIsHovered(null)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60\n `}\n style={{\n transform: isHovered === 'retry' ? 'scale(0.99)' : 'scale(1)',\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white\n `}\n >\n Try Again\n </span>\n </button> */}\n\n <button\n onClick={() => { }}\n onMouseEnter={() => setIsHovered('cancel')}\n onMouseLeave={() => setIsHovered(null)}\n className={`\n group relative w-full overflow-hidden rounded-md border-2 border-n1-gray-200 dark:border-n1-gray-800 bg-white dark:bg-neutral-900 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer hover:bg-n1-gray-50 dark:hover:bg-neutral-950\n `}\n style={{\n transform: isHovered === 'cancel' ? 'scale(0.99)' : 'scale(1)',\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n text-n1-gray-500 dark:text-n1-gray-400 group-hover:text-n1-gray-700 dark:group-hover:text-n1-gray-300\n `}\n >\n Cancel\n </span>\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
|