Skip to content

Commit

Permalink
feat: deeplinks on detail pages for swap & add liquidity now work
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodressel authored and mmpetarpeshev committed Jun 25, 2024
1 parent d9d6e09 commit 188bb86
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/views/PoolDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@
<ButtonDefault
fill="light"
class="w-full"
@click="$router.push({ name: 'swap', query: { from: 'AE', to: undefined } })"
@click="
$router.push({
name: 'swap',
query: {
from: pair?.token0.isAe ? 'AE' : pair?.token0.address,
to: pair?.token1.isAe ? 'AE' : pair?.token1.address,
},
})
"
>
{{ $t('poolDetail.swap') }}
</ButtonDefault>
<ButtonDefault
fill="light"
class="whitespace-nowrap"
@click="$router.push({ name: 'pool', params: { id: undefined } })"
@click="
$router.push({
name: 'add-pool',
query: {
from: pair?.token0.isAe ? 'AE' : pair?.token0.address,
to: pair?.token1.isAe ? 'AE' : pair?.token1.address,
},
})
"
>
{{ $t('poolDetail.addLiquidity') }}
</ButtonDefault>
Expand Down
10 changes: 9 additions & 1 deletion src/views/TokenDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@
<ButtonDefault
fill="light"
class="whitespace-nowrap"
@click="$router.push({ name: 'pool', params: { id: tokenId } })"
@click="
$router.push({
name: 'add-pool',
query: {
from: 'AE',
to: tokenId,
},
})
"
>
{{ $t('poolDetail.addLiquidity') }}
</ButtonDefault>
Expand Down

0 comments on commit 188bb86

Please sign in to comment.