Skip to content

Commit

Permalink
chore: Add sol warning message into multi-language settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Halibao-Lala committed Jan 2, 2025
1 parent 619bce9 commit cc5c7ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/canonical-bridge-widget/src/core/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export const en = {
'transfer.button.wallet-connect': 'Connect Wallet',
'transfer.button.switch-wallet': 'Switch Wallet',

'transfer.warning.sol.balance':
'At least {min} SOL is required to proceed with this transaction.',

'modal.approve.title': 'Approve Token',
'modal.approve.desc.1': 'Please approve at least ',
'modal.approve.desc.2': ' and initiate the transfer',
Expand All @@ -81,6 +84,8 @@ export const en = {
'modal.confirm.title': 'Waiting for Confirmation',
'modal.confirm.desc': 'Confirm this transaction in your wallet',

'modal.summary.title': 'Confirm Transaction',

'select-modal.tag.incompatible': 'Incompatible',
'select-modal.search.no-result.title': 'No result found',
'select-modal.search.no-result.warning':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, theme, useColorMode } from '@bnb-chain/space';
import { Flex, theme, useColorMode, useIntl } from '@bnb-chain/space';
import { rgba } from 'polished';

import { MIN_SOL_TO_ENABLED_TX } from '@/core/constants';
Expand All @@ -12,6 +12,8 @@ export const TransferWarningMessage = () => {
const solBalance = Number(data?.formatted);
const fromChain = useAppSelector((state) => state.transfer.fromChain);

const { formatMessage } = useIntl();

if (fromChain?.chainType === 'solana' && solBalance < MIN_SOL_TO_ENABLED_TX) {
return (
<Flex
Expand All @@ -30,7 +32,7 @@ export const TransferWarningMessage = () => {
fontSize={'12px'}
fontWeight={400}
/>
{`At least ${MIN_SOL_TO_ENABLED_TX} SOL is required to proceed with this transaction.`}
{formatMessage({ id: 'transfer.warning.sol.balance' }, { min: MIN_SOL_TO_ENABLED_TX })}
</Flex>
);
}
Expand Down

0 comments on commit cc5c7ed

Please sign in to comment.