Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

[Wallet] Add Add to ActionButton to jump to LP view with one click only #2513

Merged
merged 1 commit into from
Jan 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/renderer/components/wallet/assets/AssetsTableCollapsable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ export const AssetsTableCollapsable: React.FC<Props> = (props): JSX.Element => {
}
]
: [],
// 'add' LP RUNE
A.concatW<ActionButtonAction>(
isAssetRuneNative(asset) && deepestPoolAsset !== null
? [
{
label: intl.formatMessage({ id: 'common.add' }),
callback: () => {
navigate(
poolsRoutes.deposit.path({
asset: assetToString(deepestPoolAsset),
assetWalletType: DEFAULT_WALLET_TYPE,
runeWalletType: walletType
})
)
}
}
]
: []
),
// 'swap' for assets of active pools only
A.concatW<ActionButtonAction>(
hasActivePool
Expand All @@ -217,6 +236,25 @@ export const AssetsTableCollapsable: React.FC<Props> = (props): JSX.Element => {
]
: []
),
// 'add' LP for assets of active pools only
A.concatW<ActionButtonAction>(
hasActivePool
? [
{
label: intl.formatMessage({ id: 'common.add' }),
callback: () => {
navigate(
poolsRoutes.deposit.path({
asset: assetToString(asset),
assetWalletType: walletType,
runeWalletType: DEFAULT_WALLET_TYPE
})
)
}
}
]
: []
),
A.concat([
{
label: intl.formatMessage({ id: 'wallet.action.send' }),
Expand Down