Skip to content

Commit

Permalink
Merge pull request #60 from lum-network/improvement/lum-887
Browse files Browse the repository at this point in the history
[LUM-887] Millions WebApp -> Dynamic Swap card
  • Loading branch information
greedyboi authored Feb 21, 2024
2 parents b6dec4b + ba1f9c0 commit b68b7d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ export default {
'<a href="https://docs.cosmosmillions.com/cosmos-millions/draw-mechanism#time-weighted-balance-twb" rel="noreferrer" target="_blank">See why.</a>',
depositHint: 'No-loss for the win: you can’t lose your deposit! <a href="https://docs.cosmosmillions.com/welcome/faq" rel="noreferrer" target="_blank">See how it works</a>',
swapHint: {
content: "Don't have ATOM on Cosmos Hub, but on other chains ? Swap your ATOM to Cosmos Hub first",
content: "Don't have {{ denom }} on {{ chainName }}, but on other chains ? Swap your {{ denom }} to {{ chainName }} first",
cta: 'Swap',
},
swapModal: {
Expand Down
16 changes: 9 additions & 7 deletions src/pages/Deposit/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const Deposit = ({ isDrop }: { isDrop: boolean }) => {

const wcConfig: WalletClientContext = {
userAddress: lumWallet?.address,
connectWallet: async () => {
connectWallet: () => {
const modal = BootstrapModal.getOrCreateInstance(WalletProvidersUtils.isAnyWalletInstalled() ? '#choose-wallet-modal' : '#get-keplr-modal');

if (modal && leapSwapModalRef.current) {
Expand Down Expand Up @@ -987,7 +987,9 @@ const Deposit = ({ isDrop }: { isDrop: boolean }) => {
{showSwapCard ? (
<Card flat withoutPadding className='deposit-delta-card d-flex flex-column flex-sm-row align-items-center mt-5'>
<PurpleBackgroundImage src={Assets.images.questionMark} alt='' className='no-filter rounded-circle' width={42} height={42} />
<div className='text-center text-sm-start ms-0 ms-sm-4 mt-3 mt-sm-0'>{I18n.t('deposit.swapHint.content')}</div>
<div className='text-center text-sm-start ms-0 ms-sm-4 mt-3 mt-sm-0 me-0 me-sm-3 mb-3 mb-sm-0'>
{I18n.t('deposit.swapHint.content', { denom: denom?.toUpperCase(), chainName: pool.internalInfos?.chainName || 'Native Chain' })}
</div>
<LiquidityModal
renderLiquidityButton={({ onClick }) => <Button onClick={onClick}>{I18n.t('deposit.swapHint.cta')}</Button>}
walletClientConfig={wcConfig}
Expand All @@ -1001,22 +1003,22 @@ const Deposit = ({ isDrop }: { isDrop: boolean }) => {
title: 'Swaps',
defaults: {
sourceChainId: 'osmosis-1',
sourceAssetDenom: 'uatom',
sourceAssetDenom: pool.nativeDenom,
},
allowedDestinationChains: [
{
chainId: 'cosmoshub-4',
assetDenoms: ['uatom'],
chainId: pool.chainId,
assetDenoms: [pool.nativeDenom],
},
],
},
[Tabs.TRANSFER]: {
enabled: false,
},
[Tabs.KADO]: {
[Tabs.SQUID]: {
enabled: false,
},
[Tabs.SQUID]: {
[Tabs.KADO]: {
enabled: false,
},
},
Expand Down

0 comments on commit b68b7d4

Please sign in to comment.