Skip to content

Commit

Permalink
Update to new state component and switch to transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
aomafarag committed Sep 22, 2022
1 parent 766fcd0 commit b518805
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
11 changes: 3 additions & 8 deletions frontend/components/auction/surplus/SurplusAuction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@
<tr>
<td>Auction State</td>
<td>
<span v-if="isActive">Ends in </span>
<span v-else-if="requiresRestart">Requires restart</span>
<span v-else-if="auction.state === 'ready-for-collection'">Ended </span>
<span v-else>Collected </span>
<time-till
v-if="auction.earliestEndDate && !requiresRestart"
:date="auction.earliestEndDate"
/>
<SurplusAuctionState :state="auction.state" :end-date="auction.earliestEndDate" />
</td>
</tr>
<tr>
Expand Down Expand Up @@ -148,6 +141,7 @@
import Vue from 'vue';
import type { CompensationAuctionActionStates, SurplusAuctionTransaction } from 'auctions-core/src/types';
import { Alert, Tooltip } from 'ant-design-vue';
import SurplusAuctionState from '~/components/auction/surplus/SurplusAuctionState.vue';
import TextBlock from '~/components/common/other/TextBlock.vue';
import TimeTill from '~/components/common/formatters/TimeTill.vue';
import Button from '~/components/common/inputs/BaseButton.vue';
Expand All @@ -161,6 +155,7 @@ export default Vue.extend({
name: 'SurplusAuction',
components: {
AuctionRestartPanel,
SurplusAuctionState,
FormatCurrency,
TextBlock,
TimeTill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="flex justify-between">
<div>Price on Uniswap</div>
<div>
<format-currency
<FormatCurrency
v-if="auction.marketUnitPrice && isActive"
:value="auction.marketUnitPrice"
:decimal-places="6"
Expand All @@ -69,7 +69,7 @@
<div class="flex justify-between font-bold">
<div>Price after the bid</div>
<div>
<format-currency
<FormatCurrency
v-if="unitPriceAfterBid && isActive && !isBidAmountNaN"
:value="unitPriceAfterBid"
:decimal-places="6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<span v-if="state === 'collected'"> Collected </span>
<span v-else-if="state === 'requires-restart'"> Requires Restart </span>
<span v-else-if="state === 'ready-for-collection'"> Collectable since </span>
<span v-else> Expires in </span>
<span v-else> Ends in </span>
<TimeTill v-if="state !== 'requires-restart'" :date="endDate" />
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</template>

<script lang="ts">
import type { SurplusAuction } from 'auctions-core/src/types';
import type { SurplusAuctionTransaction } from 'auctions-core/src/types';
import Vue from 'vue';
import { Alert } from 'ant-design-vue';
import BigNumber from 'bignumber.js';
Expand Down Expand Up @@ -112,7 +112,7 @@ export default Vue.extend({
},
props: {
auction: {
type: Object as Vue.PropType<SurplusAuction>,
type: Object as Vue.PropType<SurplusAuctionTransaction>,
required: true,
},
auctionActionState: {
Expand Down

0 comments on commit b518805

Please sign in to comment.