@n1xyz/wallet-widget 0.0.12 → 0.0.15
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/sessionManager.d.ts +0 -36
- package/dist/Logic/sessionManager.js +1 -146
- package/dist/Logic/sessionManager.js.map +1 -1
- package/dist/Modal/LoadingFallback.js +1 -1
- package/dist/Modal/LoadingFallback.js.map +1 -1
- package/dist/Modal/N1WalletModal.js +6 -5
- package/dist/Modal/N1WalletModal.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 +1 -1
- 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 +2 -2
- 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.js +1 -1
- package/dist/Modal/NordFlow/components/Header.js.map +1 -1
- 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 +6 -6
- 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/context/DepositContext.js +1 -4
- package/dist/Modal/NordFlow/context/DepositContext.js.map +1 -1
- package/dist/Modal/NordFlow/context/WalletConnectContext.js +0 -2
- package/dist/Modal/NordFlow/context/WalletConnectContext.js.map +1 -1
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js +1 -1
- package/dist/Modal/NordFlow/screens/00-IdleScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js +3 -3
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js +4 -4
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js +4 -22
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js +1 -1
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js +4 -5
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js +3 -3
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js.map +1 -1
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js +2 -2
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.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 +3 -3
- package/dist/Provider/LazyWalletProvider.js.map +1 -1
- package/dist/Provider/N1WalletProvider.js +11 -21
- package/dist/Provider/N1WalletProvider.js.map +1 -1
- package/dist/Provider/hooks/useNordUserInitialization.d.ts +1 -20
- package/dist/Provider/hooks/useNordUserInitialization.js +5 -5
- package/dist/Provider/hooks/useNordUserInitialization.js.map +1 -1
- package/dist/WidgetButton/N1ConnectButton.js +1 -1
- package/dist/WidgetButton/N1ConnectButton.js.map +1 -1
- package/dist/components/Logo.js.map +1 -1
- 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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.css +2 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"04-AmountInputScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/04-AmountInputScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,UAAU,iBAAiB;IAAjC,iBA8TC;IA7TS,IAAA,OAAO,GAAK,mBAAmB,EAAE,QAA1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vC,SAAS,EAAE,+KAEqB,cAAc,8CAC1C,aAAa;4BACb,CAAC,CAAC,+GAA+G;4BACjH,CAAC,CAAC,0EAA0E,iBAE/E,EACD,KAAK,EAAE;4BACL,SAAS,EAAE,SAAS,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;4BAClE,cAAc,EAAE,MAAM;yBACvB,YAED,eACE,SAAS,EAAE,6FAC4D,cAAc,6BACjF,aAAa;gCACb,CAAC,CAAC,iGAAiG;gCACnG,CAAC,CAAC,wCAAwC,mBAE7C,yBAGI,GACA,IACL,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { ImageWithFallback } from '../components';\nimport { ANIMATION_EASE } from '../constants';\nimport { formatAmount, isNordConfigured } from '../utils/nordUtils';\nimport { useDepositContext } from '../context/DepositContext';\nimport { useFlowStateContext } from '../context/FlowContext';\nimport { LoadingSquares } from '../components/LoadingSquares';\n\nexport function AmountInputScreen() {\n const { context } = useFlowStateContext();\n const { updateAmount, startDeposit } = useDepositContext();\n const { address, nord } = useN1WalletContext();\n const { faucetUrl: contextFaucetUrl } = useN1WalletInternalContext();\n\n // Hard code amount to 100\n const amount = '100';\n // Hard code balance to 0 to allow faucet to trigger\n const balance = 100;\n\n // Force the amount to be 100 on component mount only, not on every render\n useEffect(() => {\n updateAmount('100');\n // Empty dependency array ensures this only runs once on mount\n }, [updateAmount]);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFaucetLoading, setIsFaucetLoading] = useState(false);\n const [faucetError, setFaucetError] = useState<string | null>(null);\n const [tokensObtained, setTokensObtained] = useState(false);\n const [showFaucetSuccess, setShowFaucetSuccess] = useState(false);\n const prevBalanceRef = useRef(balance);\n\n const faucetUrl = contextFaucetUrl;\n\n // Get token information from Nord if available\n const [tokenSymbol, setTokenSymbol] = useState('USDC');\n const [tokenLogo, setTokenLogo] = useState('/images/tokens/usdc.svg');\n const [tokenDecimals, setTokenDecimals] = useState(6);\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: any) => t.symbol === 'USDC') || nord.tokens[0];\n if (usdcToken) {\n setTokenSymbol(usdcToken.symbol);\n // Use a default logo if not available\n setTokenLogo(`/images/tokens/${usdcToken.symbol.toLowerCase()}.svg`);\n setTokenDecimals(usdcToken.decimals);\n }\n } catch (error) {\n console.warn('Error getting token information from Nord:', error);\n }\n }\n }, [nord]);\n\n // Removed handleAmountChange since we don't want user to edit the amount\n\n // todo:fix\n const isValidAmount = true;\n\n const hardcodedMinDeposit = 100;\n\n // Check if faucet is enabled and balance is low\n const shouldShowFaucet = faucetUrl && !tokensObtained;\n\n // Determine if we should show the faucet overlay\n const showFaucetOverlay =\n (shouldShowFaucet && (isFaucetLoading || faucetError)) || showFaucetSuccess;\n\n // Function to refresh balances\n const refreshBalance = useCallback(async () => {\n try {\n console.log('Refreshing balance...');\n // Implementation would depend on your actual data structure\n // If we have a nordUser, try to refresh balances using Nord-TS\n if (nord && isNordConfigured(nord)) {\n try {\n // This is a placeholder - in a real implementation, you would use the correct method\n console.log('Refreshing balances using Nord-TS');\n } catch (error) {\n console.warn(\n 'Error refreshing balances using Nord-TS, falling back to default method:',\n error\n );\n }\n }\n } catch (error) {\n console.error('Error refreshing balance:', error);\n }\n }, [nord]);\n\n // Function to request tokens from faucet\n const requestTestnetTokens = useCallback(async () => {\n console.log('requestTestnetTokens', faucetUrl, address);\n if (!faucetUrl || !address) return;\n\n try {\n setIsFaucetLoading(true);\n setFaucetError(null);\n setShowFaucetSuccess(false);\n\n const response = await fetch(faucetUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ address }),\n });\n\n if (!response.ok) {\n const errorData = await response\n .json()\n .catch(() => ({ error: 'Failed to request tokens' }));\n throw new Error(errorData.error || 'Failed to request tokens');\n }\n\n await response.json();\n\n // Mark tokens as obtained to prevent further requests\n setTokensObtained(true);\n\n // Show success message\n setShowFaucetSuccess(true);\n\n // Refresh balance\n await refreshBalance();\n\n setShowFaucetSuccess(false);\n } catch (error) {\n console.error('Faucet error:', error);\n setFaucetError(\n error instanceof Error ? error.message : 'Failed to request tokens'\n );\n } finally {\n setIsFaucetLoading(false);\n }\n }, [faucetUrl, address, refreshBalance]);\n\n // Request tokens automatically when faucet is enabled and balance is low\n useEffect(() => {\n if (\n shouldShowFaucet &&\n !isFaucetLoading &&\n !faucetError &&\n !showFaucetSuccess &&\n context.depositError == null\n ) {\n requestTestnetTokens();\n }\n }, [\n shouldShowFaucet,\n isFaucetLoading,\n faucetError,\n showFaucetSuccess,\n requestTestnetTokens,\n context.depositError\n ]);\n\n // Reset tokensObtained state if balance changes to a higher value\n useEffect(() => {\n // If balance has increased and is now sufficient, reset the tokensObtained flag\n if (balance > prevBalanceRef.current && balance >= hardcodedMinDeposit) {\n setTokensObtained(false);\n setShowFaucetSuccess(false);\n }\n\n // Update the previous balance reference\n prevBalanceRef.current = balance;\n }, [balance, hardcodedMinDeposit]);\n\n // Format the balance with the appropriate number of decimal places\n const formattedBalance = formatAmount(balance, tokenDecimals);\n\n return (\n <div className=\"overflow-hidden relative\">\n {/* Faucet Overlay */}\n {showFaucetOverlay && (\n <div className=\"absolute inset-0 z-10 bg-white/70 dark:bg-neutral-900/80 backdrop-blur-md flex flex-col items-center justify-center p-6\">\n {isFaucetLoading ? (\n <>\n <LoadingSquares />\n <div className=\"space-y-2 text-center mt-4\">\n <h3 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold\">\n Obtaining Testnet Tokens\n </h3>\n <p className=\"text-sm text-n1-gray-500 dark:text-neutral-400\">\n Please wait while we request testnet tokens for your wallet...\n </p>\n </div>\n </>\n ) : showFaucetSuccess ? (\n <>\n <div className=\"text-green-500 text-5xl mb-4 n1-animate-fade-up\">✓</div>\n <div className=\"space-y-2 text-center\">\n <h3 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold\">\n Tokens Obtained Successfully\n </h3>\n <p className=\"text-sm text-green-500 dark:text-green-400\">\n Your wallet has been funded with testnet tokens.\n </p>\n <p className=\"text-sm text-n1-gray-500 dark:text-neutral-400 mt-2\">\n Please wait while your balance updates...\n </p>\n </div>\n </>\n ) : faucetError ? (\n <>\n <div className=\"text-red-500 text-5xl mb-4 n1-animate-fade-up\">⚠️</div>\n <div className=\"space-y-2 text-center\">\n <h3 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold\">\n Failed to Get Tokens\n </h3>\n <p className=\"text-sm text-red-500 dark:text-red-400\">\n {faucetError}\n </p>\n <button\n onClick={requestTestnetTokens}\n className=\"mt-4 px-4 py-2 bg-n1-main text-white rounded-sm hover:bg-n1-main/90 transition-colors\"\n >\n Try Again\n </button>\n </div>\n </>\n ) : null}\n </div>\n )}\n\n <h2 className=\"text-xl text-n1-gray-800 dark:text-white font-semibold mb-6 text-center\">\n Enter Amount\n </h2>\n\n {/* Amount Input */}\n <div className=\"space-y-6\">\n {/* Token Selection and Amount Input */}\n <div className=\"relative border-2 border-n1-gray-200 dark:border-n1-gray-800 bg-n1-gray-100 dark:bg-n1-gray-900 rounded-sm p-0 overflow-hidden n1-animate-fade-up\" style={{ animationDelay: '0.1s' }}>\n {/* Token Selection Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-n1-gray-200 dark:border-n1-gray-800 bg-white/30 dark:bg-black/10\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 rounded-full overflow-hidden bg-white dark:bg-n1-gray-800 flex items-center justify-center shadow-sm\">\n <ImageWithFallback\n src={tokenLogo}\n alt={tokenSymbol}\n width={24}\n height={24}\n fallbackText={tokenSymbol.charAt(0)}\n fallbackClassName=\"w-6 h-6 rounded-full flex items-center justify-center\"\n fallbackBgColor=\"bg-blue-100 dark:bg-blue-900\"\n fallbackTextColor=\"text-blue-500 dark:text-blue-300\"\n />\n </div>\n <span className=\"text-n1-gray-800 dark:text-white font-medium\">\n {tokenSymbol}\n </span>\n </div>\n <div className=\"text-xs rounded-sm bg-n1-gray-200 dark:bg-n1-gray-800 px-2 py-1 text-n1-gray-600 dark:text-n1-gray-300\">\n Fixed Amount\n </div>\n </div>\n\n {/* Amount Input - Hardcoded to 100 */}\n <div className=\"relative p-6 flex flex-col items-center\">\n <div className=\"relative flex items-baseline justify-center w-full\">\n <span className=\"text-4xl font-bold text-n1-gray-800 dark:text-white mr-1 n1-animate-fade-up\" style={{ animationDelay: '0.2s' }}>\n {amount}\n </span>\n <span className=\"text-xl text-n1-gray-500 dark:text-neutral-400 ml-1 n1-animate-fade-up\" style={{ animationDelay: '0.3s' }}>\n {tokenSymbol}\n </span>\n </div>\n\n {/* Decorative element */}\n <div className=\"w-16 h-1 bg-n1-gray-200 dark:bg-n1-gray-800 rounded-full mt-4 mb-2\"></div>\n\n {/* Balance Display */}\n <div className=\"flex justify-center items-center text-sm mt-2 w-full n1-animate-fade-up\" style={{ animationDelay: '0.4s' }}>\n <span className=\"text-n1-gray-500 dark:text-neutral-400\">\n Balance: {formattedBalance} {tokenSymbol}\n </span>\n </div>\n </div>\n </div>\n\n {/* Error Message */}\n {context.depositError && (\n <div className=\"bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 p-3 rounded-sm text-sm border border-red-200 dark:border-red-800 n1-animate-fade-up\" style={{ animationDelay: '0.5s' }}>\n {context.depositError}\n </div>\n )}\n\n {/* Continue Button */}\n <button\n onClick={startDeposit}\n disabled={!isValidAmount}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-sm border-2 bg-n1-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE} n1-animate-fade-up\n ${isValidAmount\n ? 'cursor-pointer border-n1-gray-200 dark:border-n1-gray-800 hover:border-n1-gray-400 dark:hover:border-white/60'\n : 'cursor-not-allowed border-n1-gray-200 dark:border-n1-gray-800 opacity-50'\n }\n `}\n style={{\n transform: isHovered && isValidAmount ? 'scale(0.99)' : 'scale(1)',\n animationDelay: '0.6s'\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n ${isValidAmount\n ? 'text-n1-gray-700 dark:text-n1-gray-300 group-hover:text-n1-gray-900 dark:group-hover:text-white'\n : 'text-n1-gray-400 dark:text-n1-gray-600'\n }\n `}\n >\n Continue\n </span>\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"04-AmountInputScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/04-AmountInputScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,UAAU,iBAAiB;IAAjC,iBA4SC;IA3SS,IAAA,OAAO,GAAK,mBAAmB,EAAE,QAA1B,CAA2B;IACpC,IAAA,KAAiC,iBAAiB,EAAE,EAAlD,YAAY,kBAAA,EAAE,YAAY,kBAAwB,CAAC;IACrD,IAAA,KAAoB,kBAAkB,EAAE,EAAtC,OAAO,aAAA,EAA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AO,EAGhG,cAAK,SAAS,EAAC,4EAA4E,EAAC,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,YAC3H,gBAAM,SAAS,EAAC,2CAA2C,0BAC/C,gBAAgB,OAAG,WAAW,IACnC,GACH,IACF,IACF,EAGL,OAAO,CAAC,YAAY,IAAI,CACvB,cAAK,SAAS,EAAC,qJAAqJ,EAAC,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,YACnM,OAAO,CAAC,YAAY,GACjB,CACP,EAGD,iBACE,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,CAAC,aAAa,EACxB,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,kLAEqB,cAAc,iDAC1C,aAAa;4BACb,CAAC,CAAC,wHAAwH;4BAC1H,CAAC,CAAC,0EAA0E,iBAE/E,EACD,KAAK,EAAE;4BACL,SAAS,EAAE,SAAS,IAAI,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;4BAClE,cAAc,EAAE,MAAM;yBACvB,YAED,eACE,SAAS,EAAE,6FAC4D,cAAc,6BACjF,aAAa;gCACb,CAAC,CAAC,0GAA0G;gCAC5G,CAAC,CAAC,8CAA8C,mBAEnD,yBAGI,GACA,IACL,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n useN1WalletContext,\n useN1WalletInternalContext,\n} from '../../../Provider/hooks';\nimport { ImageWithFallback } from '../components';\nimport { ANIMATION_EASE } from '../constants';\nimport { formatAmount, isNordConfigured } from '../utils/nordUtils';\nimport { useDepositContext } from '../context/DepositContext';\nimport { useFlowStateContext } from '../context/FlowContext';\nimport { LoadingSquares } from '../components/LoadingSquares';\n\nexport function AmountInputScreen() {\n const { context } = useFlowStateContext();\n const { updateAmount, startDeposit } = useDepositContext();\n const { address, nord } = useN1WalletContext();\n const { faucetUrl: contextFaucetUrl } = useN1WalletInternalContext();\n\n // Hard code amount to 100\n const amount = '100';\n // Hard code balance to 0 to allow faucet to trigger\n const balance = 100;\n\n // Force the amount to be 100 on component mount only, not on every render\n useEffect(() => {\n updateAmount('100');\n // Empty dependency array ensures this only runs once on mount\n }, [updateAmount]);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFaucetLoading, setIsFaucetLoading] = useState(false);\n const [faucetError, setFaucetError] = useState<string | null>(null);\n const [tokensObtained, setTokensObtained] = useState(false);\n const [showFaucetSuccess, setShowFaucetSuccess] = useState(false);\n const prevBalanceRef = useRef(balance);\n\n const faucetUrl = contextFaucetUrl;\n\n // Get token information from Nord if available\n const [tokenSymbol, setTokenSymbol] = useState('USDC');\n const [tokenLogo, setTokenLogo] = useState('/images/tokens/usdc.svg');\n const [tokenDecimals, setTokenDecimals] = useState(6);\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: any) => t.symbol === 'USDC') || nord.tokens[0];\n if (usdcToken) {\n setTokenSymbol(usdcToken.symbol);\n // Use a default logo if not available\n setTokenLogo(`/images/tokens/${usdcToken.symbol.toLowerCase()}.svg`);\n setTokenDecimals(usdcToken.decimals);\n }\n } catch (error) {\n console.warn('Error getting token information from Nord:', error);\n }\n }\n }, [nord]);\n\n // Removed handleAmountChange since we don't want user to edit the amount\n\n // todo:fix\n const isValidAmount = true;\n\n const hardcodedMinDeposit = 100;\n\n // Check if faucet is enabled and balance is low\n const shouldShowFaucet = faucetUrl && !tokensObtained;\n\n // Determine if we should show the faucet overlay\n const showFaucetOverlay =\n (shouldShowFaucet && (isFaucetLoading || faucetError)) || showFaucetSuccess;\n\n // Function to refresh balances\n const refreshBalance = useCallback(async () => {\n // \n }, [nord]);\n\n // Function to request tokens from faucet\n const requestTestnetTokens = useCallback(async () => {\n if (!faucetUrl || !address) return;\n\n try {\n setIsFaucetLoading(true);\n setFaucetError(null);\n setShowFaucetSuccess(false);\n\n const response = await fetch(faucetUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({ address }),\n });\n\n if (!response.ok) {\n const errorData = await response\n .json()\n .catch(() => ({ error: 'Failed to request tokens' }));\n throw new Error(errorData.error || 'Failed to request tokens');\n }\n\n await response.json();\n\n // Mark tokens as obtained to prevent further requests\n setTokensObtained(true);\n\n // Show success message\n setShowFaucetSuccess(true);\n\n // Refresh balance\n await refreshBalance();\n\n setShowFaucetSuccess(false);\n } catch (error) {\n console.error('Faucet error:', error);\n setFaucetError(\n error instanceof Error ? error.message : 'Failed to request tokens'\n );\n } finally {\n setIsFaucetLoading(false);\n }\n }, [faucetUrl, address, refreshBalance]);\n\n // Request tokens automatically when faucet is enabled and balance is low\n useEffect(() => {\n if (\n shouldShowFaucet &&\n !isFaucetLoading &&\n !faucetError &&\n !showFaucetSuccess &&\n context.depositError == null\n ) {\n requestTestnetTokens();\n }\n }, [\n shouldShowFaucet,\n isFaucetLoading,\n faucetError,\n showFaucetSuccess,\n requestTestnetTokens,\n context.depositError\n ]);\n\n // Reset tokensObtained state if balance changes to a higher value\n useEffect(() => {\n // If balance has increased and is now sufficient, reset the tokensObtained flag\n if (balance > prevBalanceRef.current && balance >= hardcodedMinDeposit) {\n setTokensObtained(false);\n setShowFaucetSuccess(false);\n }\n\n // Update the previous balance reference\n prevBalanceRef.current = balance;\n }, [balance, hardcodedMinDeposit]);\n\n // Format the balance with the appropriate number of decimal places\n const formattedBalance = formatAmount(balance, tokenDecimals);\n\n return (\n <div className=\"overflow-hidden relative\">\n {/* Faucet Overlay */}\n {showFaucetOverlay && (\n <div className=\"absolute inset-0 z-10 bg-white/70 dark:bg-neutral-900/80 backdrop-blur-md flex flex-col items-center justify-center p-6\">\n {isFaucetLoading ? (\n <>\n <LoadingSquares />\n <div className=\"space-y-2 text-center mt-4\">\n <h3 className=\"text-xl text-n1-ww-gray-800 dark:text-white font-semibold\">\n Obtaining Testnet Tokens\n </h3>\n <p className=\"text-sm text-n1-ww-gray-500 dark:text-neutral-400\">\n Please wait while we request testnet tokens for your wallet...\n </p>\n </div>\n </>\n ) : showFaucetSuccess ? (\n <>\n <div className=\"text-green-500 text-5xl mb-4 n1-ww-animate-fade-up\">✓</div>\n <div className=\"space-y-2 text-center\">\n <h3 className=\"text-xl text-n1-ww-gray-800 dark:text-white font-semibold\">\n Tokens Obtained Successfully\n </h3>\n <p className=\"text-sm text-green-500 dark:text-green-400\">\n Your wallet has been funded with testnet tokens.\n </p>\n <p className=\"text-sm text-n1-ww-gray-500 dark:text-neutral-400 mt-2\">\n Please wait while your balance updates...\n </p>\n </div>\n </>\n ) : faucetError ? (\n <>\n <div className=\"text-red-500 text-5xl mb-4 n1-ww-animate-fade-up\">⚠️</div>\n <div className=\"space-y-2 text-center\">\n <h3 className=\"text-xl text-n1-ww-gray-800 dark:text-white font-semibold\">\n Failed to Get Tokens\n </h3>\n <p className=\"text-sm text-red-500 dark:text-red-400\">\n {faucetError}\n </p>\n <button\n onClick={requestTestnetTokens}\n className=\"mt-4 px-4 py-2 bg-n1-ww-main text-white rounded-sm hover:bg-n1-ww-main/90 transition-colors\"\n >\n Try Again\n </button>\n </div>\n </>\n ) : null}\n </div>\n )}\n\n <h2 className=\"text-xl text-n1-ww-gray-800 dark:text-white font-semibold mb-6 text-center\">\n Enter Amount\n </h2>\n\n {/* Amount Input */}\n <div className=\"space-y-6\">\n {/* Token Selection and Amount Input */}\n <div className=\"relative border-2 border-n1-ww-gray-200 dark:border-n1-ww-gray-800 bg-n1-ww-gray-100 dark:bg-n1-ww-gray-900 rounded-sm p-0 overflow-hidden n1-ww-animate-fade-up\" style={{ animationDelay: '0.1s' }}>\n {/* Token Selection Header */}\n <div className=\"flex items-center justify-between p-4 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800 bg-white/30 dark:bg-black/10\">\n <div className=\"flex items-center space-x-3\">\n <div className=\"w-8 h-8 rounded-full overflow-hidden bg-white dark:bg-n1-ww-gray-800 flex items-center justify-center shadow-sm\">\n <ImageWithFallback\n src={tokenLogo}\n alt={tokenSymbol}\n width={24}\n height={24}\n fallbackText={tokenSymbol.charAt(0)}\n fallbackClassName=\"w-6 h-6 rounded-full flex items-center justify-center\"\n fallbackBgColor=\"bg-blue-100 dark:bg-blue-900\"\n fallbackTextColor=\"text-blue-500 dark:text-blue-300\"\n />\n </div>\n <span className=\"text-n1-ww-gray-800 dark:text-white font-medium\">\n {tokenSymbol}\n </span>\n </div>\n <div className=\"text-xs rounded-sm bg-n1-ww-gray-200 dark:bg-n1-ww-gray-800 px-2 py-1 text-n1-ww-gray-600 dark:text-n1-ww-gray-300\">\n Fixed Amount\n </div>\n </div>\n\n {/* Amount Input - Hardcoded to 100 */}\n <div className=\"relative p-6 flex flex-col items-center\">\n <div className=\"relative flex items-baseline justify-center w-full\">\n <span className=\"text-4xl font-bold text-n1-ww-gray-800 dark:text-white mr-1 n1-ww-animate-fade-up\" style={{ animationDelay: '0.2s' }}>\n {amount}\n </span>\n <span className=\"text-xl text-n1-ww-gray-500 dark:text-neutral-400 ml-1 n1-ww-animate-fade-up\" style={{ animationDelay: '0.3s' }}>\n {tokenSymbol}\n </span>\n </div>\n\n {/* Decorative element */}\n <div className=\"w-16 h-1 bg-n1-ww-gray-200 dark:bg-n1-ww-gray-800 rounded-full mt-4 mb-2\"></div>\n\n {/* Balance Display */}\n <div className=\"flex justify-center items-center text-sm mt-2 w-full n1-ww-animate-fade-up\" style={{ animationDelay: '0.4s' }}>\n <span className=\"text-n1-ww-gray-500 dark:text-neutral-400\">\n Balance: {formattedBalance} {tokenSymbol}\n </span>\n </div>\n </div>\n </div>\n\n {/* Error Message */}\n {context.depositError && (\n <div className=\"bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 p-3 rounded-sm text-sm border border-red-200 dark:border-red-800 n1-ww-animate-fade-up\" style={{ animationDelay: '0.5s' }}>\n {context.depositError}\n </div>\n )}\n\n {/* Continue Button */}\n <button\n onClick={startDeposit}\n disabled={!isValidAmount}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n className={`\n group relative w-full overflow-hidden rounded-sm border-2 bg-n1-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE} n1-ww-animate-fade-up\n ${isValidAmount\n ? 'cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60'\n : 'cursor-not-allowed border-n1-gray-200 dark:border-n1-gray-800 opacity-50'\n }\n `}\n style={{\n transform: isHovered && isValidAmount ? 'scale(0.99)' : 'scale(1)',\n animationDelay: '0.6s'\n }}\n >\n <span\n className={`\n text-base font-medium tracking-wide transition-colors duration-300 ${ANIMATION_EASE}\n ${isValidAmount\n ? 'text-n1-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white'\n : 'text-n1-ww-gray-400 dark:text-n1-ww-gray-600'\n }\n `}\n >\n Continue\n </span>\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -46,6 +46,6 @@ export function DepositProgressScreen() {
|
|
|
46
46
|
"Please wait while we process your ".concat(accountType, " deposit") });
|
|
47
47
|
};
|
|
48
48
|
var sessionMessage = getSessionSpecificMessage();
|
|
49
|
-
return (_jsxs("div", { className: "overflow-hidden relative", children: [_jsx(WaitingMessage, { message: sessionMessage }), _jsxs("div", { className: "text-center mt-4 text-sm text-n1-gray-500", children: ["Time elapsed: ", elapsedTime, "s / ", maxTime, "s"] })] }));
|
|
49
|
+
return (_jsxs("div", { className: "overflow-hidden relative", children: [_jsx(WaitingMessage, { message: sessionMessage }), _jsxs("div", { className: "text-center mt-4 text-sm text-n1-ww-gray-500", children: ["Time elapsed: ", elapsedTime, "s / ", maxTime, "s"] })] }));
|
|
50
50
|
}
|
|
51
51
|
//# sourceMappingURL=05-DepositProgressScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"05-DepositProgressScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/05-DepositProgressScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,UAAU,qBAAqB;IAC3B,IAAA,WAAW,GAAK,0BAA0B,EAAE,YAAjC,CAAkC;IAC/C,IAAA,KAAgC,QAAQ,CAAC,CAAC,CAAC,EAA1C,WAAW,QAAA,EAAE,cAAc,QAAe,CAAC;IAClD,IAAM,OAAO,GAAG,GAAG,CAAC,CAAC,0BAA0B;IAE/C,IAAM,OAAO,GAAG;QACd,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,oBAAoB;QAC3B,QAAQ,EAAE,2CAA2C;QACrD,QAAQ,EAAE,KAAK;KAChB,CAAA;IAED,oCAAoC;IACpC,SAAS,CAAC;QACR,IAAM,KAAK,GAAG,WAAW,CAAC;YACxB,cAAc,CAAC,UAAC,QAAQ;gBACtB,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;oBACxB,aAAa,CAAC,KAAK,CAAC,CAAC;oBACrB,OAAO,OAAO,CAAC;gBACjB,CAAC;gBACD,OAAO,QAAQ,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,4BAA4B;QAC5B,OAAO,cAAM,OAAA,aAAa,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,0DAA0D;IAC1D,IAAM,yBAAyB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AChB,CAAA;IAED,oCAAoC;IACpC,SAAS,CAAC;QACR,IAAM,KAAK,GAAG,WAAW,CAAC;YACxB,cAAc,CAAC,UAAC,QAAQ;gBACtB,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;oBACxB,aAAa,CAAC,KAAK,CAAC,CAAC;oBACrB,OAAO,OAAO,CAAC;gBACjB,CAAC;gBACD,OAAO,QAAQ,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,4BAA4B;QAC5B,OAAO,cAAM,OAAA,aAAa,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC;IACpC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,0DAA0D;IAC1D,IAAM,yBAAyB,GAAG;QAChC,IAAM,kBAAkB,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,aAAa,CAAC,GAAG,CAAC;QAC5D,IAAM,WAAW,GACf,kBAAkB,KAAK,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAE7D,6BACK,OAAO,KACV,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,qBAAc,WAAW,aAAU,EAC3D,QAAQ,EACN,OAAO,CAAC,QAAQ;gBAChB,4CAAqC,WAAW,aAAU,IAC5D;IACJ,CAAC,CAAC;IAEF,IAAM,cAAc,GAAG,yBAAyB,EAAE,CAAC;IAEnD,OAAO,CACL,eAAK,SAAS,EAAC,0BAA0B,aACvC,KAAC,cAAc,IAAC,OAAO,EAAE,cAAc,GAAI,EAC3C,eAAK,SAAS,EAAC,8CAA8C,+BAC5C,WAAW,UAAM,OAAO,SACnC,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { WaitingMessage } from '../components/WaitingMessage';\nimport { WaitingMessageState } from '../types';\nimport { useN1WalletInternalContext } from '../../../Provider/hooks';\nimport { N1SessionMode } from '../../../Provider/types';\nimport { useState, useEffect } from 'react';\n\n\nexport function DepositProgressScreen() {\n const { sessionMode } = useN1WalletInternalContext();\n const [elapsedTime, setElapsedTime] = useState(0);\n const maxTime = 300; // Maximum time in seconds\n\n const message = {\n visible: true,\n title: 'Processing Deposit',\n subtitle: 'Please wait while we process your deposit',\n isTyping: false,\n }\n\n // Start timer when component mounts\n useEffect(() => {\n const timer = setInterval(() => {\n setElapsedTime((prevTime) => {\n if (prevTime >= maxTime) {\n clearInterval(timer);\n return maxTime;\n }\n return prevTime + 1;\n });\n }, 1000);\n\n // Clean up timer on unmount\n return () => clearInterval(timer);\n }, []);\n\n // Determine the appropriate message based on session mode\n const getSessionSpecificMessage = () => {\n const currentSessionMode = sessionMode ?? N1SessionMode.NTS;\n const accountType =\n currentSessionMode === N1SessionMode.Nord ? 'Nord' : 'NTS';\n\n return {\n ...message,\n title: message.title || `Processing ${accountType} Deposit`,\n subtitle:\n message.subtitle ||\n `Please wait while we process your ${accountType} deposit`,\n };\n };\n\n const sessionMessage = getSessionSpecificMessage();\n\n return (\n <div className=\"overflow-hidden relative\">\n <WaitingMessage message={sessionMessage} />\n <div className=\"text-center mt-4 text-sm text-n1-ww-gray-500\">\n Time elapsed: {elapsedTime}s / {maxTime}s\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -61,7 +61,6 @@ export function DepositSuccessScreen() {
|
|
|
61
61
|
}, [nord]);
|
|
62
62
|
// Add animation to table values
|
|
63
63
|
useEffect(function () {
|
|
64
|
-
console.log('adasdasdasd');
|
|
65
64
|
if (!showDetails)
|
|
66
65
|
return;
|
|
67
66
|
// Extract the text values from the tableValues
|
|
@@ -122,12 +121,12 @@ export function DepositSuccessScreen() {
|
|
|
122
121
|
var toggleDetails = function () {
|
|
123
122
|
setShowDetails(function (prev) { return !prev; });
|
|
124
123
|
};
|
|
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
|
|
124
|
+
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-ww-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
|
|
126
125
|
? 'text-green-600 dark:text-emerald-400 hover:text-green-700 dark:hover:text-emerald-300'
|
|
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
|
|
126
|
+
: 'text-n1-ww-gray-500 dark:text-n1-ww-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
|
|
128
127
|
? 'max-h-[500px] opacity-100 -mt-4'
|
|
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: {
|
|
128
|
+
: '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-ww-gray-600 dark:text-neutral-400 text-center mb-2 n1-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60\n ").concat(!isContinueEnabled ? 'opacity-50 cursor-not-allowed' : '', "\n "), style: {
|
|
130
129
|
transform: isHovered && isContinueEnabled ? 'scale(0.99)' : 'scale(1)',
|
|
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" }) })] })] }) }) }));
|
|
130
|
+
}, disabled: !isContinueEnabled, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n "), children: "Continue" }) })] })] }) }) }));
|
|
132
131
|
}
|
|
133
132
|
//# 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;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,MAAM,UAAU,oBAAoB;IAC5B,IAAA,KAAiD,iBAAiB,EAAE,EAAlE,MAAM,YAAA,EAAE,eAAe,qBAAA,EAAE,iBAAiB,uBAAwB,CAAC;IACnE,IAAA,IAAI,GAAK,kBAAkB,EAAE,KAAzB,CAA0B;IAChC,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SA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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
|
+
{"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,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AAa,GACtB,GACE,EAGN,eAAK,SAAS,EAAC,MAAM,aAClB,kBAAkB,IAAI,CACrB,YAAG,SAAS,EAAC,wFAAwF,wCAEjG,CACL,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,0LAEqB,cAAc,uKAE1C,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,+IAEpF,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 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-ww-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-ww-gray-500 dark:text-n1-ww-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-ww-gray-600 dark:text-neutral-400 text-center mb-2 n1-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-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-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-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"]}
|
|
@@ -19,12 +19,12 @@ export function AuthLoadingScreen() {
|
|
|
19
19
|
authInitiatedRef.current = false;
|
|
20
20
|
performAuth();
|
|
21
21
|
};
|
|
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
|
|
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-ww-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-ww-gray-600 dark:text-neutral-400", children: [authStatus === 'loading' && authStatusMessage
|
|
23
23
|
? authStatusMessage
|
|
24
24
|
: 'Please wait while we create your Nord account', authStatus === 'success' && 'You have been logged in successfully', authStatus === 'error' &&
|
|
25
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: {
|
|
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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60\n "), style: {
|
|
27
27
|
transform: isHovered ? 'scale(0.99)' : 'scale(1)',
|
|
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" }) }) }))] })] }));
|
|
28
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n "), children: "Try Again" }) }) }))] })] }));
|
|
29
29
|
}
|
|
30
30
|
//# sourceMappingURL=07-AuthLoadingScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"07-AuthLoadingScreen.js","sourceRoot":"","sources":["../../../../src/Modal/NordFlow/screens/07-A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,2DAA2D,aACtE,UAAU,KAAK,SAAS,IAAI,gBAAgB,EAC5C,UAAU,KAAK,SAAS,IAAI,2BAA2B,EACvD,UAAU,KAAK,OAAO,IAAI,uBAAuB,IAC/C,EACL,aAAG,SAAS,EAAC,mDAAmD,aAC7D,UAAU,KAAK,SAAS,IAAI,iBAAiB;gCAC5C,CAAC,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,0LAEqB,cAAc,6JAE7C,EACD,KAAK,EAAE;gCACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;6BAClD,YAED,eACE,SAAS,EAAE,+FAC0D,cAAc,+IAEpF,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-ww-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-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-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-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-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"]}
|
|
@@ -35,8 +35,8 @@ export function FinalSuccessScreen(_a) {
|
|
|
35
35
|
return 'Your wallet has been successfully connected';
|
|
36
36
|
}
|
|
37
37
|
};
|
|
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: {
|
|
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-ww-gray-800 dark:text-white font-semibold mb-2 text-center", children: getTitle() }), _jsx("p", { className: "text-lg text-n1-ww-gray-700 dark:text-neutral-300 text-center", children: getMessage() }), address && (_jsxs("p", { className: "text-sm text-n1-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-gray-400 dark:hover:border-white/60\n "), style: {
|
|
39
39
|
transform: isHovered ? 'scale(0.99)' : 'scale(1)',
|
|
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" }) })] }) }));
|
|
40
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n "), children: "Open App" }) })] }) }));
|
|
41
41
|
}
|
|
42
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,EACL,kBAAkB,EAClB,0BAA0B,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AAK,SAAS,EAAC,MAAM,YAEnB,cAAK,SAAS,EAAC,2FAA2F,YACxG,cACE,SAAS,EAAC,8CAA8C,EACxD,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,YAElC,eACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAC,GAAG,EACf,CAAC,EAAC,gBAAgB,GAClB,GACE,GACF,GACF,EAEN,aAAI,SAAS,EAAC,
|
|
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,IAAI,MAAM,EAAE,CAAC;YAC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AAI,CAAC,EAAlB,CAAkB,EACtC,YAAY,EAAE,cAAM,OAAA,YAAY,CAAC,KAAK,CAAC,EAAnB,CAAmB,EACvC,SAAS,EAAE,kLAEqB,cAAc,qJAE7C,EACD,KAAK,EAAE;wBACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU;qBAClD,YAED,eACE,SAAS,EAAE,2FAC0D,cAAc,uIAEpF,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-ww-gray-800 dark:text-white font-semibold mb-2 text-center\">\n {getTitle()}\n </h2>\n\n <p className=\"text-lg text-n1-ww-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-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-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-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-gray-900 dark:group-hover:text-white\n `}\n >\n Open App\n </span>\n </button>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -61,8 +61,8 @@ export function ErrorScreen() {
|
|
|
61
61
|
}
|
|
62
62
|
return 'Please try again or try a different wallet.';
|
|
63
63
|
};
|
|
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: {
|
|
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-ww-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-ww-gray-600 dark:text-neutral-400 text-center mb-2 max-w-xs", children: errorMessage }), _jsx("p", { className: "text-xs text-n1-ww-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-ww-gray-200 dark:border-n1-ww-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-ww-gray-50 dark:hover:bg-neutral-950\n "), style: {
|
|
65
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" }) }) })] }) }));
|
|
66
|
+
}, children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n text-n1-ww-gray-500 dark:text-n1-ww-gray-400 group-hover:text-n1-ww-gray-700 dark:group-hover:text-n1-ww-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,SAAS,EA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kGAE7C,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,oJAEpF,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-ww-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-ww-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-ww-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-ww-gray-100 dark:bg-neutral-950 py-4 text-center\n transition-all duration-300 ${ANIMATION_EASE}\n cursor-pointer border-n1-ww-gray-200 dark:border-n1-ww-gray-800 hover:border-n1-ww-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-ww-gray-700 dark:text-n1-ww-gray-300 group-hover:text-n1-ww-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-ww-gray-200 dark:border-n1-ww-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-ww-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-ww-gray-500 dark:text-n1-ww-gray-400 group-hover:text-n1-ww-gray-700 dark:group-hover:text-n1-ww-gray-300\n `}\n >\n Cancel\n </span>\n </button>\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -165,10 +165,10 @@ export function N1Sidebar(_) {
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
}); };
|
|
168
|
-
return (_jsxs("div", { className: "fixed inset-0 bg-white/45 dark:bg-black/45 h-screen w-screen duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] z-[9999] flex items-stretch justify-end backdrop-blur-sm ".concat(!showSidebar ? 'hidden pointer-events-none' : '', " ").concat(closing ? 'opacity-0' : 'opacity-100'), children: [showSidebar && (_jsx("div", { className: "w-screen h-screen fixed top-0 left-0", onClick: function () { return setClosing(true); } })), showSidebar && (_jsxs("div", { className: "relative h-screen bg-n1-gray-50 dark:bg-n1-gray-950 shadow-xl border-l border-n1-gray-200 dark:border-n1-gray-800 duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] overflow-hidden ".concat(closing ? 'translate-x-full' : 'translate-x-0', " ").concat(isFullscreen ? 'w-screen' : 'w-[420px]'), children: [_jsxs("div", { className: "flex justify-between items-center px-6 py-4 border-b border-n1-gray-200 dark:border-n1-gray-800", children: [_jsxs("div", { className: "flex items-center gap-4", children: [currentView !== 'balances' && (_jsx("button", { onClick: function () {
|
|
168
|
+
return (_jsxs("div", { className: "fixed inset-0 bg-white/45 dark:bg-black/45 h-screen w-screen duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] z-[9999] flex items-stretch justify-end backdrop-blur-sm ".concat(!showSidebar ? 'hidden pointer-events-none' : '', " ").concat(closing ? 'opacity-0' : 'opacity-100'), children: [showSidebar && (_jsx("div", { className: "w-screen h-screen fixed top-0 left-0", onClick: function () { return setClosing(true); } })), showSidebar && (_jsxs("div", { className: "relative h-screen bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950 shadow-xl border-l border-n1-ww-gray-200 dark:border-n1-ww-gray-800 duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] overflow-hidden ".concat(closing ? 'translate-x-full' : 'translate-x-0', " ").concat(isFullscreen ? 'w-screen' : 'w-[420px]'), children: [_jsxs("div", { className: "flex justify-between items-center px-6 py-4 border-b border-n1-ww-gray-200 dark:border-n1-ww-gray-800", children: [_jsxs("div", { className: "flex items-center gap-4", children: [currentView !== 'balances' && (_jsx("button", { onClick: function () {
|
|
169
169
|
setCurrentView('balances');
|
|
170
170
|
clearSendingForm();
|
|
171
|
-
}, className: "text-n1-gray-500 hover:text-red-500 dark:text-n1-gray-400 dark:hover:text-red-500 transition-colors duration-200", children: _jsx(ArrowLeft, { size: 20 }) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(BlockiesSvg, { address: address, className: "w-10 h-10 rounded-full" }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium text-n1-gray-900 dark:text-n1-gray-50", children: username }), _jsx("span", { className: "text-sm text-n1-gray-500 dark:text-n1-gray-400", children: shortenAddress(address) })] })] })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("button", { onClick: toggleFullscreen, className: "text-n1-gray-400 hover:text-red-500 transition-colors duration-200 h-6 flex items-center", "aria-label": isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen', children: isFullscreen ? (_jsx(Minimize2, { size: 20 })) : (_jsx(Maximize2, { size: 20 })) }), _jsx("button", { onClick: handleClose, className: "text-n1-gray-400 hover:text-red-500 transition-colors duration-200 h-6 flex items-center", children: _jsx(X, { size: 20 }) })] })] }), _jsx("div", { className: "p-6 overflow-y-auto h-[calc(100vh-144px)]", children: _jsx("div", { className: "space-y-4", children: sessionMode === N1SessionMode.Nord ? (_jsx(NordTradingView, {})) : (_jsxs(_Fragment, { children: [currentView === 'balances' && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h2", { className: "text-xl font-semibold text-n1-gray-900 dark:text-n1-gray-50", children: "Balances" }), _jsxs("div", { className: "flex space-x-2", children: [_jsxs("button", { onClick: function () {
|
|
171
|
+
}, className: "text-n1-ww-gray-500 hover:text-red-500 dark:text-n1-ww-gray-400 dark:hover:text-red-500 transition-colors duration-200", children: _jsx(ArrowLeft, { size: 20 }) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx(BlockiesSvg, { address: address, className: "w-10 h-10 rounded-full" }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "font-medium text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: username }), _jsx("span", { className: "text-sm text-n1-ww-gray-500 dark:text-n1-ww-gray-400", children: shortenAddress(address) })] })] })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("button", { onClick: toggleFullscreen, className: "text-n1-ww-gray-400 hover:text-red-500 transition-colors duration-200 h-6 flex items-center", "aria-label": isFullscreen ? 'Exit fullscreen' : 'Enter fullscreen', children: isFullscreen ? (_jsx(Minimize2, { size: 20 })) : (_jsx(Maximize2, { size: 20 })) }), _jsx("button", { onClick: handleClose, className: "text-n1-ww-gray-400 hover:text-red-500 transition-colors duration-200 h-6 flex items-center", children: _jsx(X, { size: 20 }) })] })] }), _jsx("div", { className: "p-6 overflow-y-auto h-[calc(100vh-144px)]", children: _jsx("div", { className: "space-y-4", children: sessionMode === N1SessionMode.Nord ? (_jsx(NordTradingView, {})) : (_jsxs(_Fragment, { children: [currentView === 'balances' && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex justify-between items-center", children: [_jsx("h2", { className: "text-xl font-semibold text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: "Balances" }), _jsxs("div", { className: "flex space-x-2", children: [_jsxs("button", { onClick: function () {
|
|
172
172
|
setReceiving(true);
|
|
173
173
|
setSending(false);
|
|
174
174
|
setCurrentView('receive');
|
|
@@ -176,24 +176,24 @@ export function N1Sidebar(_) {
|
|
|
176
176
|
setSending(true);
|
|
177
177
|
setReceiving(false);
|
|
178
178
|
setCurrentView('send');
|
|
179
|
-
}, className: "px-3 py-1.5 bg-blue-100 dark:bg-blue-900/20 hover:bg-blue-200 dark:hover:bg-blue-900/30 text-blue-600 dark:text-blue-400 rounded-lg transition-colors duration-200 flex items-center", children: [_jsx(ArrowUp, { size: 16, className: "mr-1.5" }), "Send"] })] })] }), balances && balances.length > 0 ? (_jsx("div", { className: "space-y-3", children: balances.map(function (balance, index) { return (_jsxs("div", { className: "p-4 bg-white dark:bg-n1-gray-900 rounded-xl shadow-sm border border-n1-gray-200 dark:border-n1-gray-800 flex justify-between items-center", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium text-n1-gray-900 dark:text-n1-gray-50", children: balance.appType }), _jsx("div", { className: "text-sm text-n1-gray-500 dark:text-n1-gray-400", children: balance.appId })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "font-medium text-n1-gray-900 dark:text-n1-gray-50", children: balance.balance.toString() }), _jsx("div", { className: "text-sm text-n1-gray-500 dark:text-n1-gray-400", children: "Available" })] })] }, index)); }) })) : (_jsx("div", { className: "p-4 bg-n1-gray-50 dark:bg-n1-gray-800 rounded-xl text-n1-gray-500 dark:text-n1-gray-400 text-center", children: "No balances found" }))] })), currentView === 'send' && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: function () {
|
|
179
|
+
}, className: "px-3 py-1.5 bg-blue-100 dark:bg-blue-900/20 hover:bg-blue-200 dark:hover:bg-blue-900/30 text-blue-600 dark:text-blue-400 rounded-lg transition-colors duration-200 flex items-center", children: [_jsx(ArrowUp, { size: 16, className: "mr-1.5" }), "Send"] })] })] }), balances && balances.length > 0 ? (_jsx("div", { className: "space-y-3", children: balances.map(function (balance, index) { return (_jsxs("div", { className: "p-4 bg-white dark:bg-n1-ww-gray-900 rounded-xl shadow-sm border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 flex justify-between items-center", children: [_jsxs("div", { children: [_jsx("div", { className: "font-medium text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: balance.appType }), _jsx("div", { className: "text-sm text-n1-ww-gray-500 dark:text-n1-ww-gray-400", children: balance.appId })] }), _jsxs("div", { className: "text-right", children: [_jsx("div", { className: "font-medium text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: balance.balance.toString() }), _jsx("div", { className: "text-sm text-n1-ww-gray-500 dark:text-n1-ww-gray-400", children: "Available" })] })] }, index)); }) })) : (_jsx("div", { className: "p-4 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-800 rounded-xl text-n1-ww-gray-500 dark:text-n1-ww-gray-400 text-center", children: "No balances found" }))] })), currentView === 'send' && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: function () {
|
|
180
180
|
setCurrentView('balances');
|
|
181
181
|
clearSendingForm();
|
|
182
|
-
}, className: "mr-3 text-n1-gray-500 hover:text-n1-gray-700 dark:text-n1-gray-400 dark:hover:text-n1-gray-200", children: _jsx(ArrowLeft, { size: 20 }) }), _jsx("h2", { className: "text-xl font-semibold text-n1-gray-900 dark:text-n1-gray-50", children: "Send Tokens" })] }), error && (_jsx("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 rounded-xl text-red-600 dark:text-red-400 text-sm", children: error })), success && (_jsx("div", { className: "p-4 bg-green-50 dark:bg-green-900/20 rounded-xl text-green-600 dark:text-green-400 text-sm", children: success })), _jsxs("form", { onSubmit: handleSend, className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-gray-700 dark:text-n1-gray-300 mb-1", children: "Token" }), _jsxs("select", { value: tokenToSend, onChange: function (e) { return setTokenToSend(e.target.value); }, className: "w-full px-3 py-2 bg-n1-gray-100 dark:bg-n1-gray-800 rounded-lg text-n1-gray-900 dark:text-n1-gray-100 border border-n1-gray-200 dark:border-n1-gray-800", required: true, children: [_jsx("option", { value: "", children: "Select Token" }), balances &&
|
|
183
|
-
balances.map(function (balance, index) { return (_jsxs("option", { value: balance.mint, children: [balance.appType, " (", balance.balance.toString(), ")"] }, index)); })] })] }), tokenToSend && (_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-gray-700 dark:text-n1-gray-300 mb-1", children: "App ID" }), _jsxs("select", { value: appIdAction, onChange: function (e) { return setAppIdAction(e.target.value); }, className: "w-full px-3 py-2 bg-n1-gray-100 dark:bg-n1-gray-800 rounded-lg text-n1-gray-900 dark:text-n1-gray-100 border border-n1-gray-200 dark:border-n1-gray-800", required: true, children: [_jsx("option", { value: "", children: "Select App ID" }), balances &&
|
|
182
|
+
}, className: "mr-3 text-n1-ww-gray-500 hover:text-n1-ww-gray-700 dark:text-n1-ww-gray-400 dark:hover:text-n1-ww-gray-200", children: _jsx(ArrowLeft, { size: 20 }) }), _jsx("h2", { className: "text-xl font-semibold text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: "Send Tokens" })] }), error && (_jsx("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 rounded-xl text-red-600 dark:text-red-400 text-sm", children: error })), success && (_jsx("div", { className: "p-4 bg-green-50 dark:bg-green-900/20 rounded-xl text-green-600 dark:text-green-400 text-sm", children: success })), _jsxs("form", { onSubmit: handleSend, className: "space-y-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-ww-gray-700 dark:text-n1-ww-gray-300 mb-1", children: "Token" }), _jsxs("select", { value: tokenToSend, onChange: function (e) { return setTokenToSend(e.target.value); }, className: "w-full px-3 py-2 bg-n1-ww-gray-100 dark:bg-n1-ww-gray-800 rounded-lg text-n1-ww-gray-900 dark:text-n1-ww-gray-100 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800", required: true, children: [_jsx("option", { value: "", children: "Select Token" }), balances &&
|
|
183
|
+
balances.map(function (balance, index) { return (_jsxs("option", { value: balance.mint, children: [balance.appType, " (", balance.balance.toString(), ")"] }, index)); })] })] }), tokenToSend && (_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-ww-gray-700 dark:text-n1-ww-gray-300 mb-1", children: "App ID" }), _jsxs("select", { value: appIdAction, onChange: function (e) { return setAppIdAction(e.target.value); }, className: "w-full px-3 py-2 bg-n1-ww-gray-100 dark:bg-n1-ww-gray-800 rounded-lg text-n1-ww-gray-900 dark:text-n1-ww-gray-100 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800", required: true, children: [_jsx("option", { value: "", children: "Select App ID" }), balances &&
|
|
184
184
|
balances
|
|
185
185
|
.filter(function (balance) {
|
|
186
186
|
return balance.mint === tokenToSend;
|
|
187
187
|
})
|
|
188
|
-
.map(function (balance, index) { return (_jsx("option", { value: balance.appId, children: balance.appId }, index)); })] })] })), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-gray-700 dark:text-n1-gray-300 mb-1", children: "Amount" }), _jsx("input", { type: "text", value: amount, onChange: function (e) { return setAmount(e.target.value); }, className: "w-full px-3 py-2 bg-n1-gray-100 dark:bg-n1-gray-800 rounded-lg text-n1-gray-900 dark:text-n1-gray-100 border border-n1-gray-200 dark:border-n1-gray-800", placeholder: "Enter amount", required: true })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-gray-700 dark:text-n1-gray-300 mb-1", children: "Recipient Address" }), _jsx("input", { type: "text", value: recipientAddress, onChange: function (e) {
|
|
188
|
+
.map(function (balance, index) { return (_jsx("option", { value: balance.appId, children: balance.appId }, index)); })] })] })), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-ww-gray-700 dark:text-n1-ww-gray-300 mb-1", children: "Amount" }), _jsx("input", { type: "text", value: amount, onChange: function (e) { return setAmount(e.target.value); }, className: "w-full px-3 py-2 bg-n1-ww-gray-100 dark:bg-n1-ww-gray-800 rounded-lg text-n1-ww-gray-900 dark:text-n1-ww-gray-100 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800", placeholder: "Enter amount", required: true })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-n1-ww-gray-700 dark:text-n1-ww-gray-300 mb-1", children: "Recipient Address" }), _jsx("input", { type: "text", value: recipientAddress, onChange: function (e) {
|
|
189
189
|
return setRecipientAddress(e.target.value);
|
|
190
|
-
}, className: "w-full px-3 py-2 bg-n1-gray-100 dark:bg-n1-gray-800 rounded-lg text-n1-gray-900 dark:text-n1-gray-100 border border-n1-gray-200 dark:border-n1-gray-800", placeholder: "Enter recipient address", required: true })] }), _jsx("button", { type: "submit", disabled: activeSending, className: "w-full py-3 rounded-xl font-medium transition-colors duration-200 ".concat(activeSending
|
|
191
|
-
? 'bg-n1-gray-300 dark:bg-n1-gray-700 text-n1-gray-500 dark:text-n1-gray-400 cursor-not-allowed'
|
|
190
|
+
}, className: "w-full px-3 py-2 bg-n1-ww-gray-100 dark:bg-n1-ww-gray-800 rounded-lg text-n1-ww-gray-900 dark:text-n1-ww-gray-100 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800", placeholder: "Enter recipient address", required: true })] }), _jsx("button", { type: "submit", disabled: activeSending, className: "w-full py-3 rounded-xl font-medium transition-colors duration-200 ".concat(activeSending
|
|
191
|
+
? 'bg-n1-ww-gray-300 dark:bg-n1-ww-gray-700 text-n1-ww-gray-500 dark:text-n1-ww-gray-400 cursor-not-allowed'
|
|
192
192
|
: 'bg-blue-600 hover:bg-blue-700 text-white'), children: activeSending ? 'Sending...' : 'Send Tokens' })] })] })), currentView === 'receive' && (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: function () {
|
|
193
193
|
setCurrentView('balances');
|
|
194
194
|
setReceiving(false);
|
|
195
|
-
}, className: "mr-3 text-n1-gray-500 hover:text-n1-gray-700 dark:text-n1-gray-400 dark:hover:text-n1-gray-200", children: _jsx(ArrowLeft, { size: 20 }) }), _jsx("h2", { className: "text-xl font-semibold text-n1-gray-900 dark:text-n1-gray-50", children: "Receive Tokens" })] }), _jsxs("div", { className: "p-4 bg-white dark:bg-n1-gray-900 rounded-xl shadow-sm border border-n1-gray-200 dark:border-n1-gray-800 flex flex-col items-center", children: [_jsx("div", { className: "mb-4 bg-white p-2 rounded-lg", children: _jsx(QRCodeLoader, { address: address }) }), _jsx("div", { className: "text-sm text-n1-gray-500 dark:text-n1-gray-400 mb-2", children: "Your wallet address:" }), _jsx("div", { className: "font-mono text-sm text-n1-gray-900 dark:text-n1-gray-100 mb-4 break-all text-center", children: address }), _jsx("button", { onClick: function () {
|
|
195
|
+
}, className: "mr-3 text-n1-ww-gray-500 hover:text-n1-ww-gray-700 dark:text-n1-ww-gray-400 dark:hover:text-n1-ww-gray-200", children: _jsx(ArrowLeft, { size: 20 }) }), _jsx("h2", { className: "text-xl font-semibold text-n1-ww-gray-900 dark:text-n1-ww-gray-50", children: "Receive Tokens" })] }), _jsxs("div", { className: "p-4 bg-white dark:bg-n1-ww-gray-900 rounded-xl shadow-sm border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 flex flex-col items-center", children: [_jsx("div", { className: "mb-4 bg-white p-2 rounded-lg", children: _jsx(QRCodeLoader, { address: address }) }), _jsx("div", { className: "text-sm text-n1-ww-gray-500 dark:text-n1-ww-gray-400 mb-2", children: "Your wallet address:" }), _jsx("div", { className: "font-mono text-sm text-n1-ww-gray-900 dark:text-n1-ww-gray-100 mb-4 break-all text-center", children: address }), _jsx("button", { onClick: function () {
|
|
196
196
|
navigator.clipboard.writeText(address);
|
|
197
|
-
}, className: "px-4 py-2 bg-blue-100 dark:bg-blue-900/20 hover:bg-blue-200 dark:hover:bg-blue-900/30 text-blue-600 dark:text-blue-400 rounded-lg transition-colors duration-200", children: "Copy Address" })] })] }))] })) }) }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 p-6 border-t border-n1-gray-200 dark:border-n1-gray-800 bg-n1-gray-50 dark:bg-n1-gray-950", children: _jsxs("button", { onClick: disconnect, className: "group relative w-full px-6 py-3 rounded-sm bg-white dark:bg-n1-gray-900 border border-n1-gray-200 dark:border-n1-gray-800 font-medium transition-all duration-300 ease-in-out overflow-hidden", children: [_jsx("div", { className: "relative z-10 flex items-center justify-center", children: _jsx("span", { className: "text-n1-gray-900 dark:text-n1-gray-100 group-hover:text-white dark:group-hover:text-white transition-colors duration-300 ease-in-out", children: "Disconnect" }) }), _jsx("div", { className: "absolute inset-0 bg-red-700 transform scale-x-0 group-hover:scale-x-100 transition-transform duration-300 ease-in-out origin-left" })] }) })] }))] }));
|
|
197
|
+
}, className: "px-4 py-2 bg-blue-100 dark:bg-blue-900/20 hover:bg-blue-200 dark:hover:bg-blue-900/30 text-blue-600 dark:text-blue-400 rounded-lg transition-colors duration-200", children: "Copy Address" })] })] }))] })) }) }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 p-6 border-t border-n1-ww-gray-200 dark:border-n1-ww-gray-800 bg-n1-ww-gray-50 dark:bg-n1-ww-gray-950", children: _jsxs("button", { onClick: disconnect, className: "group relative w-full px-6 py-3 rounded-sm bg-white dark:bg-n1-ww-gray-900 border border-n1-ww-gray-200 dark:border-n1-ww-gray-800 font-medium transition-all duration-300 ease-in-out overflow-hidden", children: [_jsx("div", { className: "relative z-10 flex items-center justify-center", children: _jsx("span", { className: "text-n1-ww-gray-900 dark:text-n1-ww-gray-100 group-hover:text-white dark:group-hover:text-white transition-colors duration-300 ease-in-out", children: "Disconnect" }) }), _jsx("div", { className: "absolute inset-0 bg-red-700 transform scale-x-0 group-hover:scale-x-100 transition-transform duration-300 ease-in-out origin-left" })] }) })] }))] }));
|
|
198
198
|
}
|
|
199
199
|
//# sourceMappingURL=N1Sidebar.js.map
|