-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sync related ui alerts on pool page (#3542)
* feat: add gauge balancer helper contract * feat: add alerts in staking card * wip * feat: add check balances * feat: add alerts on pool page * wip * feat: add user checkpoint actions * remove logs * feat: add networks tooltips * feat: change sync process warning * feat: change unstake btn style * UI updates * feat: change unsynced arr * fix: unstake btn style * feat: fix trigger update fn * feat: open staking incentives card by default * feat: add sync tips * feat: opening staking incentives card * feat: change texts * feat: add info message * fixes after review --------- Co-authored-by: pkattera <[email protected]>
- Loading branch information
1 parent
57aa06e
commit 37e0d9d
Showing
29 changed files
with
598 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
src/components/contextual/pages/vebal/cross-chain-boost/CheckpointGaugeModal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<script setup lang="ts"> | ||
import { usePoolStaking } from '@/providers/local/pool-staking.provider'; | ||
import { useCrossChainSync } from '@/providers/cross-chain-sync.provider'; | ||
import useTransactions from '@/composables/useTransactions'; | ||
interface Props { | ||
isVisible?: boolean; | ||
} | ||
withDefaults(defineProps<Props>(), { | ||
isVisible: false, | ||
}); | ||
const emit = defineEmits(['close', 'success']); | ||
const { poolGauges } = usePoolStaking(); | ||
const { triggerGaugeUpdate } = useCrossChainSync(); | ||
const { addTransaction } = useTransactions(); | ||
const showCloseBtn = ref(false); | ||
async function triggerUpdate() { | ||
try { | ||
const id = poolGauges.value?.pool.preferentialGauge.id; | ||
if (!id) { | ||
throw new Error('No preferential gauge id'); | ||
} | ||
const tx = await triggerGaugeUpdate(id); | ||
addTransaction({ | ||
id: tx.hash, | ||
type: 'tx', | ||
action: 'userGaugeCheckpoint', | ||
summary: '', | ||
}); | ||
emit('success'); | ||
return tx; | ||
} catch (e) { | ||
console.error(e); | ||
return Promise.reject(e); | ||
} | ||
} | ||
const actions = [ | ||
{ | ||
label: 'Confirm pool gauge update', | ||
loadingLabel: 'Confirming pool gauge update', | ||
confirmingLabel: 'Confirming pool gauge update', | ||
action: async () => { | ||
return triggerUpdate(); | ||
}, | ||
stepTooltip: '', | ||
}, | ||
]; | ||
</script> | ||
|
||
<template> | ||
<BalModal | ||
:show="isVisible" | ||
title="Trigger pool gauge veBAL update" | ||
@close="emit('close')" | ||
> | ||
<div class="flex flex-col justify-between"> | ||
<span class="mb-12"> | ||
Even though you've synced new veBAL to this Layer 2, it isn’t | ||
contributing to your staking boost yet on this pool. This is because, | ||
pool gauges don't detect veBAL changes until you interact with them. | ||
This transaction is the most gas efficient way to update the gauge but | ||
you can also trigger the update by claiming any BAL incentives. | ||
</span> | ||
|
||
<BalActionSteps :actions="actions" @success="showCloseBtn = true" /> | ||
|
||
<BalBtn | ||
v-if="showCloseBtn" | ||
color="gray" | ||
outline | ||
block | ||
@click="$emit('close')" | ||
> | ||
{{ $t('close') }} | ||
</BalBtn> | ||
</div> | ||
</BalModal> | ||
</template> |
Oops, something went wrong.