fix: Snatch notifications and position history (#151)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f1893d50a0
commit
60d0859eb3
6 changed files with 509 additions and 16 deletions
|
|
@ -70,6 +70,9 @@
|
|||
</div>
|
||||
<div class="active-positions-wrapper">
|
||||
<h3>Active Positions</h3>
|
||||
<div v-if="myActivePositions.length === 0 && myClosedPositions.length > 0" class="no-active-positions">
|
||||
No active positions — your position history is below.
|
||||
</div>
|
||||
<div class="active-positions-list">
|
||||
<CollapseActive
|
||||
v-for="position in myActivePositions"
|
||||
|
|
@ -83,6 +86,21 @@
|
|||
></CollapseActive>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="myClosedPositions.length > 0" class="position-history-wrapper">
|
||||
<h3>Position History</h3>
|
||||
<div class="position-history-list">
|
||||
<CollapseHistory
|
||||
v-for="position in myClosedPositions"
|
||||
:key="position.id"
|
||||
:taxRate="position.taxRatePercentage"
|
||||
:taxPaid="position.taxPaid.toString()"
|
||||
:treshold="tresholdValue"
|
||||
:id="position.positionId"
|
||||
:amount="position.amount"
|
||||
:position="position"
|
||||
></CollapseHistory>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <f-button @click="getGraphData">graphql test</f-button>
|
||||
<div v-for="position in positions" :key="position.id">
|
||||
{{ position }}
|
||||
|
|
@ -95,6 +113,7 @@ import StakeHolder from '@/components/StakeHolder.vue';
|
|||
import ChartComplete from '@/components/chart/ChartComplete.vue';
|
||||
import StatsOutput from '@/components/StatsOutput.vue';
|
||||
import CollapseActive from '@/components/collapse/CollapseActive.vue';
|
||||
import CollapseHistory from '@/components/collapse/CollapseHistory.vue';
|
||||
import ProtocolStatsCard from '@/components/ProtocolStatsCard.vue';
|
||||
import { onMounted, computed, inject } from 'vue';
|
||||
import { useStatCollection } from '@/composables/useStatCollection';
|
||||
|
|
@ -113,7 +132,7 @@ const showPanel = inject('showPanel');
|
|||
import { InsertCommaNumber } from '@/utils/helper';
|
||||
const wallet = useWallet();
|
||||
const initialChainId = wallet.account.chainId ?? DEFAULT_CHAIN_ID;
|
||||
const { myActivePositions, tresholdValue, activePositions } = usePositions(initialChainId);
|
||||
const { myActivePositions, myClosedPositions, tresholdValue, activePositions } = usePositions(initialChainId);
|
||||
|
||||
const stats = useStatCollection(initialChainId);
|
||||
const chains = useChains();
|
||||
|
|
@ -249,8 +268,23 @@ onMounted(async () => {
|
|||
margin-right: auto
|
||||
@media (min-width: 768px)
|
||||
width: 580px
|
||||
.no-active-positions
|
||||
color: #9A9898
|
||||
font-size: 14px
|
||||
padding: 16px 0
|
||||
.active-positions-list
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 12px
|
||||
|
||||
.position-history-wrapper
|
||||
width: 100%
|
||||
margin-left: auto
|
||||
margin-right: auto
|
||||
@media (min-width: 768px)
|
||||
width: 580px
|
||||
.position-history-list
|
||||
display: flex
|
||||
flex-direction: column
|
||||
gap: 12px
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue