diff --git a/apps/evm/src/app/[lang]/(bridge)/bridge/Bridge.tsx b/apps/evm/src/app/[lang]/(bridge)/bridge/Bridge.tsx index ccc13083a..7c7d42427 100644 --- a/apps/evm/src/app/[lang]/(bridge)/bridge/Bridge.tsx +++ b/apps/evm/src/app/[lang]/(bridge)/bridge/Bridge.tsx @@ -81,6 +81,8 @@ const Bridge = ({ searchParams }: Props) => { const [bridgeOrigin, setBridgeOrigin] = useState(getOrigin(type, chain, symbol)); const handleChangeTab = (key: Key) => { + if (type === key.toString()) return; + const newChain = L1_CHAIN; setChain(newChain); @@ -117,15 +119,36 @@ const Bridge = ({ searchParams }: Props) => { router.replace('?' + urlSearchParams); }, [type, chain, router, symbol, urlSearchParams]); + const isBobBridgeDisabled = !(chain === L1_CHAIN || chain === L2_CHAIN || chain === 'BTC'); + + const isExternalBridgeDisabled = chain === 'BTC' || !!(symbol && externalUnsupportedTokens.includes(symbol)); + + const isWithdrawTabDisabled = chain === 'BTC'; + + const tabsDisabledKeys = isWithdrawTabDisabled ? [Type.Withdraw] : undefined; + return ( - + Deposit}> <> - Withdraw}> + Withdraw} + tooltipProps={{ + isDisabled: !isWithdrawTabDisabled, + label: Withdrawals back to BTC are currently not supported + }} + > <> @@ -133,6 +156,8 @@ const Bridge = ({ searchParams }: Props) => { bridgeOrigin={bridgeOrigin} chain={chain} direction={direction} + isBobBridgeDisabled={isBobBridgeDisabled} + isExternalBridgeDisabled={isExternalBridgeDisabled} symbol={symbol} onChangeChain={handleChangeChain} onChangeOrigin={handleChangeOrigin} diff --git a/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx b/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx index 042d7b72f..ee716534e 100644 --- a/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx +++ b/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx @@ -137,7 +137,11 @@ const BobBridgeForm = ({ const handleSuccess = (data: BridgeTransaction) => { onBridgeSuccess?.(data); - handleReset(); + // Resetting form and defaulting ETH + form.resetForm({ values: { ...initialValues, [BRIDGE_ASSET]: initialToken.symbol } }); + + onChangeSymbol?.(initialToken.symbol); + setAmount(''); refetchBalances(); }; @@ -409,16 +413,10 @@ const BobBridgeForm = ({ hideErrors: 'untouched' }); - const handleReset = () => { - form.resetForm(); - - onChangeSymbol?.(initialValues[BRIDGE_ASSET]); - setAmount(''); - }; - + // Reseting form but keeping the symbol between Deposit and Withdraw useEffect(() => { - handleReset(); - + form.resetForm({ values: { ...initialValues, [BRIDGE_ASSET]: symbol } }); + setAmount(''); // eslint-disable-next-line react-hooks/exhaustive-deps }, [direction]); diff --git a/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx b/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx index e03642b17..658751f43 100644 --- a/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx +++ b/apps/evm/src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx @@ -42,6 +42,8 @@ type BridgeFormProps = { direction: TransactionDirection; symbol?: string; bridgeOrigin?: BridgeOrigin; + isBobBridgeDisabled?: boolean; + isExternalBridgeDisabled?: boolean; onChangeSymbol: (symbol: string) => void; onChangeOrigin?: (origin: BridgeOrigin) => void; onChangeChain?: (chain: ChainId | 'BTC') => void; @@ -65,6 +67,8 @@ const allNetworks = [ const BridgeForm = ({ direction = TransactionDirection.L1_TO_L2, bridgeOrigin, + isBobBridgeDisabled, + isExternalBridgeDisabled, chain, symbol, onChangeSymbol, @@ -181,12 +185,6 @@ const BridgeForm = ({ } : undefined; - const isBobBridgeDisabled = - (direction === TransactionDirection.L1_TO_L2 && chain !== L1_CHAIN && chain !== 'BTC') || - (direction === TransactionDirection.L2_TO_L1 && chain !== L1_CHAIN); - - const isExternalBridgeDisabled = chain === 'BTC'; - return ( <> diff --git a/apps/evm/src/locales/en.po b/apps/evm/src/locales/en.po index 327a3f8bf..d35ffd067 100644 --- a/apps/evm/src/locales/en.po +++ b/apps/evm/src/locales/en.po @@ -95,7 +95,7 @@ msgstr "<0>Stake your BTC with 1-click and receive BTC LSTs on BOB." msgid "2 hours" msgstr "2 hours" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:216 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:214 msgid "3rd Party" msgstr "3rd Party" @@ -146,7 +146,7 @@ msgstr "All Spice you harvest between 9 December 2024 and 12 January 2025 will r msgid "Already harvesting?" msgstr "Already harvesting?" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:473 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:471 #: src/app/[lang]/(bridge)/components/BtcTokenInput/BtcTokenInput.tsx:38 msgid "Amount" msgstr "Amount" @@ -167,7 +167,7 @@ msgstr "and that you have read and understood our" msgid "Apply" msgstr "Apply" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:457 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:455 msgid "Approve" msgstr "Approve" @@ -262,7 +262,7 @@ msgstr "Below is the Spice you've harvested from apps. Keep participating to inc msgid "BOB" msgstr "BOB" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:213 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:211 msgid "BOB Bridge" msgstr "BOB Bridge" @@ -335,7 +335,7 @@ msgstr "Book a call with the founders" msgid "Bridge" msgstr "Bridge" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:458 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:456 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:143 msgid "Bridge Asset" msgstr "Bridge Asset" @@ -349,11 +349,11 @@ msgstr "Bridge Assets" msgid "Bridge BTC LSTs to BOB" msgstr "Bridge BTC LSTs to BOB" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:453 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:451 msgid "Bridge Disabled" msgstr "Bridge Disabled" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:206 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:204 msgid "bridge network" msgstr "bridge network" @@ -402,7 +402,7 @@ msgstr "Cannot stake into {assetName} due to insufficient liquidity." #~ msgid "Category" #~ msgstr "Category" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:455 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:453 msgid "Checking Allowance" msgstr "Checking Allowance" @@ -533,7 +533,7 @@ msgstr "Current TVL:" msgid "Deploy high priority assets into high priority DeFi protocols to maximize your Spice harvest." msgstr "Deploy high priority assets into high priority DeFi protocols to maximize your Spice harvest." -#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:125 +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:141 #: src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx:41 msgid "Deposit" msgstr "Deposit" @@ -617,7 +617,7 @@ msgstr "enable ETH top-up for transaction fees on BOB network" #~ msgid "Enter Address" #~ msgstr "Enter Address" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:484 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:482 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:131 #: src/app/[lang]/(bridge)/stake/components/StakeForm/BtcStakeForm.tsx:95 msgid "Enter destination address" @@ -693,7 +693,7 @@ msgstr "Fee" msgid "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day." msgstr "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day." -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:95 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:102 msgid "Fetching bridging operations..." msgstr "Fetching bridging operations..." @@ -886,11 +886,11 @@ msgstr "Learn More" #~ msgid "Learn more about {0}" #~ msgstr "Learn more about {0}" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:106 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:104 msgid "Lend out tBTC on Segment." msgstr "Lend out tBTC on Segment." -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:121 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:119 msgid "Lend out wBTC on Segment." msgstr "Lend out wBTC on Segment." @@ -1084,7 +1084,7 @@ msgstr "new tickets drop in {timeToNextDraw}" #~ msgid "No assets shown" #~ msgstr "No assets shown" -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:122 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:130 msgid "No bridging operations found" msgstr "No bridging operations found" @@ -1256,7 +1256,7 @@ msgstr "Receive" #~ msgid "Receive {ticker}" #~ msgstr "Receive {ticker}" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:483 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:481 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:131 #: src/app/[lang]/(bridge)/stake/components/StakeForm/BtcStakeForm.tsx:94 msgid "Recipient" @@ -1351,11 +1351,11 @@ msgstr "select gas token" msgid "Select Network" msgstr "Select Network" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:170 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:174 msgid "select network to bridge from" msgstr "select network to bridge from" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:180 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:184 msgid "select network to bridge to" msgstr "select network to bridge to" @@ -1509,11 +1509,11 @@ msgstr "Stake" msgid "Stake BTC into Babylon via Bedrock and receive liquid staking token uniBTC." msgstr "Stake BTC into Babylon via Bedrock and receive liquid staking token uniBTC." -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:89 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:87 msgid "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and deposit into Pell restaking." msgstr "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and deposit into Pell restaking." -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:154 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:151 msgid "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and lend it out on Segment." msgstr "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and lend it out on Segment." @@ -1529,7 +1529,7 @@ msgstr "Stake BTC into Babylon via Solv Protocol and receive liquid staking toke #~ msgid "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and deposit into Pell." #~ msgstr "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and deposit into Pell." -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:71 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:70 msgid "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and deposit into Pell." msgstr "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and deposit into Pell." @@ -1537,7 +1537,7 @@ msgstr "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking #~ msgid "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and lend it out on Segment." #~ msgstr "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and lend it out on Segment." -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:136 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:134 msgid "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and lend it out on Segment." msgstr "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and lend it out on Segment." @@ -1963,7 +1963,7 @@ msgstr "User rejected the request." msgid "Username" msgstr "Username" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:221 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:219 msgid "Using the official bridge usually takes 7 days. For faster withdrawals we recommend using a 3rd party bridge for supported tokens (ETH, WBTC, USDT, USDC)." msgstr "Using the official bridge usually takes 7 days. For faster withdrawals we recommend using a 3rd party bridge for supported tokens (ETH, WBTC, USDT, USDC)." @@ -1979,7 +1979,7 @@ msgstr "Using the official bridge usually takes 7 days. For faster withdrawals w #~ msgid "View a summary of your wallet on the BOB network. DeFi positions may not be tracked." #~ msgstr "View a summary of your wallet on the BOB network. DeFi positions may not be tracked." -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:132 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:140 msgid "View All Transactions" msgstr "View All Transactions" @@ -2071,7 +2071,7 @@ msgstr "When you vote, you do not give away any of your harvest. Your Spice tota #~ msgid "Where total_qualified_spice is the total spice earned by all users that qualify for Babylon points, i.e., had LST in their wallet at some points and are registered in Fusion." #~ msgstr "Where total_qualified_spice is the total spice earned by all users that qualify for Babylon points, i.e., had LST in their wallet at some points and are registered in Fusion." -#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:128 +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:146 #: src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx:41 msgid "Withdraw" msgstr "Withdraw" @@ -2090,6 +2090,14 @@ msgstr "Withdraw Locked Assets" msgid "Withdraw to L1 failed. Please try again." msgstr "Withdraw to L1 failed. Please try again." +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:149 +msgid "Withdrawals back to BTC are currently not supported" +msgstr "Withdrawals back to BTC are currently not supported" + +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:149 +#~ msgid "Withdraws back to BTC are currently not supported" +#~ msgstr "Withdraws back to BTC are currently not supported" + #: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:209 msgid "Yield Assets" msgstr "Yield Assets" diff --git a/apps/evm/src/locales/zh.po b/apps/evm/src/locales/zh.po index b3ff8dd76..31edf110d 100644 --- a/apps/evm/src/locales/zh.po +++ b/apps/evm/src/locales/zh.po @@ -95,7 +95,7 @@ msgstr "<0>一键质押你的BTC 并在BOB上接收BTC LSTs。" msgid "2 hours" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:216 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:214 msgid "3rd Party" msgstr "" @@ -146,7 +146,7 @@ msgstr "" msgid "Already harvesting?" msgstr "已经在收获?" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:473 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:471 #: src/app/[lang]/(bridge)/components/BtcTokenInput/BtcTokenInput.tsx:38 msgid "Amount" msgstr "" @@ -167,7 +167,7 @@ msgstr "" msgid "Apply" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:457 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:455 msgid "Approve" msgstr "通过" @@ -262,7 +262,7 @@ msgstr "以下是你从各个应用中收获的Spice。继续参与以增加你 msgid "BOB" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:213 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:211 msgid "BOB Bridge" msgstr "" @@ -335,7 +335,7 @@ msgstr "" msgid "Bridge" msgstr "桥" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:458 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:456 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:143 msgid "Bridge Asset" msgstr "" @@ -349,11 +349,11 @@ msgstr "跨链资产" msgid "Bridge BTC LSTs to BOB" msgstr "将BTC LSTs跨链到BOB" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:453 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:451 msgid "Bridge Disabled" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:206 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:204 msgid "bridge network" msgstr "" @@ -402,7 +402,7 @@ msgstr "" #~ msgid "Category" #~ msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:455 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:453 msgid "Checking Allowance" msgstr "" @@ -533,7 +533,7 @@ msgstr "" msgid "Deploy high priority assets into high priority DeFi protocols to maximize your Spice harvest." msgstr "将高优先级资产部署到高优先级DeFi协议中,以最大化你的Spice收获。" -#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:125 +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:141 #: src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx:41 msgid "Deposit" msgstr "" @@ -617,7 +617,7 @@ msgstr "" #~ msgid "Enter Address" #~ msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:484 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:482 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:131 #: src/app/[lang]/(bridge)/stake/components/StakeForm/BtcStakeForm.tsx:95 msgid "Enter destination address" @@ -693,7 +693,7 @@ msgstr "" msgid "Feeling lucky? Try your luck with the daily lottery!<0/>Participate in Fusion voting to receive 3 lottery tickets each day." msgstr "" -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:95 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:102 msgid "Fetching bridging operations..." msgstr "" @@ -886,11 +886,11 @@ msgstr "了解更多" #~ msgid "Learn more about {0}" #~ msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:106 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:104 msgid "Lend out tBTC on Segment." msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:121 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:119 msgid "Lend out wBTC on Segment." msgstr "" @@ -1084,7 +1084,7 @@ msgstr "" #~ msgid "No assets shown" #~ msgstr "未显示的资产" -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:122 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:130 msgid "No bridging operations found" msgstr "" @@ -1256,7 +1256,7 @@ msgstr "接收" #~ msgid "Receive {ticker}" #~ msgstr "接收 {ticker}" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:483 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BobBridgeForm.tsx:481 #: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BtcBridgeForm.tsx:131 #: src/app/[lang]/(bridge)/stake/components/StakeForm/BtcStakeForm.tsx:94 msgid "Recipient" @@ -1351,11 +1351,11 @@ msgstr "" msgid "Select Network" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:170 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:174 msgid "select network to bridge from" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:180 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:184 msgid "select network to bridge to" msgstr "" @@ -1509,11 +1509,11 @@ msgstr "質押" msgid "Stake BTC into Babylon via Bedrock and receive liquid staking token uniBTC." msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:89 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:87 msgid "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and deposit into Pell restaking." msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:154 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:151 msgid "Stake BTC into Babylon via Bedrock, get uniBTC liquid staking token, and lend it out on Segment." msgstr "" @@ -1529,7 +1529,7 @@ msgstr "" #~ msgid "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and deposit into Pell." #~ msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:71 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:70 msgid "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and deposit into Pell." msgstr "" @@ -1537,7 +1537,7 @@ msgstr "" #~ msgid "Stake BTC into Babylon via Solv Protocol, get solvBTC.BBN liquid staking token, and lend it out on Segment." #~ msgstr "" -#: src/app/[lang]/(bridge)/utils/stakeData.tsx:136 +#: src/app/[lang]/(bridge)/utils/stakeData.tsx:134 msgid "Stake BTC into Babylon via Solv Protocol, get SolvBTC.BBN liquid staking token, and lend it out on Segment." msgstr "" @@ -1950,7 +1950,7 @@ msgstr "" msgid "Username" msgstr "" -#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:221 +#: src/app/[lang]/(bridge)/bridge/components/BridgeForm/BridgeForm.tsx:219 msgid "Using the official bridge usually takes 7 days. For faster withdrawals we recommend using a 3rd party bridge for supported tokens (ETH, WBTC, USDT, USDC)." msgstr "" @@ -1966,7 +1966,7 @@ msgstr "" #~ msgid "View a summary of your wallet on the BOB network. DeFi positions may not be tracked." #~ msgstr "查看您在 BOB 网络上的钱包概况。" -#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:132 +#: src/app/[lang]/(bridge)/components/TransactionList/TransactionList.tsx:140 msgid "View All Transactions" msgstr "" @@ -2058,7 +2058,7 @@ msgstr "投票时,你不会失去任何收获。你的Spice总数仅用于计 #~ msgid "Where total_qualified_spice is the total spice earned by all users that qualify for Babylon points, i.e., had LST in their wallet at some points and are registered in Fusion." #~ msgstr "" -#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:128 +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:146 #: src/app/[lang]/(bridge)/components/TransactionList/TransactionDetails.tsx:41 msgid "Withdraw" msgstr "" @@ -2077,6 +2077,14 @@ msgstr "提取锁定资产" msgid "Withdraw to L1 failed. Please try again." msgstr "" +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:149 +msgid "Withdrawals back to BTC are currently not supported" +msgstr "" + +#: src/app/[lang]/(bridge)/bridge/Bridge.tsx:149 +#~ msgid "Withdraws back to BTC are currently not supported" +#~ msgstr "" + #: src/app/[lang]/fusion/components/UserInfo/MultipliersModal.tsx:209 msgid "Yield Assets" msgstr "收益资产" diff --git a/packages/ui/src/components/Tabs/Tab.tsx b/packages/ui/src/components/Tabs/Tab.tsx index a86a2c1dc..60fc146ef 100644 --- a/packages/ui/src/components/Tabs/Tab.tsx +++ b/packages/ui/src/components/Tabs/Tab.tsx @@ -1,16 +1,23 @@ +import { useFocusRing } from '@react-aria/focus'; import { useTab } from '@react-aria/tabs'; +import { mergeProps } from '@react-aria/utils'; import { TabListState } from '@react-stately/tabs'; import { AriaTabProps } from '@react-types/tabs'; -import { HTMLAttributes, ReactNode, RefObject, useRef } from 'react'; -import { mergeProps } from '@react-aria/utils'; -import { useFocusRing } from '@react-aria/focus'; +import { ReactNode, RefObject, useRef } from 'react'; import scrollIntoView from 'scroll-into-view-if-needed'; import { TabsSize } from '../../theme'; +import { Tooltip, TooltipProps } from '../Tooltip'; import { StyledTab } from './Tabs.style'; type Props = { + tooltipProps?: TooltipProps; +}; + +type TabsItemProps = Props; + +type InternalProps = { fullWidth?: boolean; size: TabsSize; listRef: RefObject; @@ -21,9 +28,7 @@ type AriaProps = { state: TabListState; }; -type InheritAttrs = Omit, keyof (Props & AriaProps)>; - -type TabProps = Props & AriaProps & InheritAttrs; +type InternalTabProps = TabsItemProps & InternalProps & AriaProps; // @internal const Tab = >({ @@ -32,8 +37,9 @@ const Tab = >({ fullWidth = false, size = 'md', listRef, + tooltipProps, ...props -}: TabProps): JSX.Element => { +}: InternalTabProps): JSX.Element => { const ref = useRef(null); const { tabProps, isDisabled } = useTab(item, state, ref); @@ -50,7 +56,7 @@ const Tab = >({ }); }; - return ( + const tab = ( >({ {item.rendered} ); + + if (tooltipProps) { + return {tab}; + } + + return tab; }; export { Tab }; +export type { TabsItemProps }; diff --git a/packages/ui/src/components/Tabs/Tabs.stories.tsx b/packages/ui/src/components/Tabs/Tabs.stories.tsx index 171570f5e..2a9100547 100644 --- a/packages/ui/src/components/Tabs/Tabs.stories.tsx +++ b/packages/ui/src/components/Tabs/Tabs.stories.tsx @@ -64,3 +64,22 @@ export const ControlledSelected: StoryFn = (args) => { ); }; + +export const TabWithTooltip: StoryFn = (args) => { + return ( + + +

All

+
+ +

Pending

+
+ +

Completed

+
+ +

Failed

+
+
+ ); +}; diff --git a/packages/ui/src/components/Tabs/Tabs.tsx b/packages/ui/src/components/Tabs/Tabs.tsx index 057c33e1e..8e919c377 100644 --- a/packages/ui/src/components/Tabs/Tabs.tsx +++ b/packages/ui/src/components/Tabs/Tabs.tsx @@ -104,6 +104,7 @@ const Tabs = forwardRef( listRef={tabsListRef} size={size} state={state} + tooltipProps={item.props.tooltipProps} {...(item.key === state.selectedKey ? hoverProps : undefined)} /> ))} diff --git a/packages/ui/src/components/Tabs/index.tsx b/packages/ui/src/components/Tabs/index.tsx index a67870c49..b62573a60 100644 --- a/packages/ui/src/components/Tabs/index.tsx +++ b/packages/ui/src/components/Tabs/index.tsx @@ -1,7 +1,11 @@ -import { Item as TabsItem } from '@react-stately/collections'; -import { ItemProps as TabsItemProps } from '@react-types/shared'; +import { Item } from '@react-stately/collections'; +import { ItemProps } from '@react-types/shared'; + +import { TabsItemProps } from './Tab'; + +const TabsItem = Item as (props: ItemProps & TabsItemProps) => JSX.Element; -export type { TabsProps } from './Tabs'; export { Tabs } from './Tabs'; -export type { TabsItemProps }; +export type { TabsProps } from './Tabs'; export { TabsItem }; +export type { TabsItemProps };