Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 MyOffer & OffersUserTable #6732

Merged
merged 4 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions components/bsx/Offer/MyOffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<NeoTableColumn
v-slot="props"
field="formatPrice"
:label="$t('myOffer.price')"
:label="`${$t(`offer.price`)} (${chainSymbol})`"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add that as param of translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh idk, it's used without chainSymbol in other components

sortable>
<Money :value="props.row.price" inline />
<Money :value="props.row.price" inline hide-unit :round="2" />
</NeoTableColumn>
<NeoTableColumn
v-slot="props"
Expand Down Expand Up @@ -109,6 +109,7 @@ const { howAboutToExecute, initTransactionLoader, isLoading, status } =
const { $apollo, $consola, $i18n } = useNuxtApp()
const { urlPrefix, client } = usePrefix()
const { accountId, isLogIn } = useAuth()
const { chainSymbol } = useChain()

const offers = ref<Offer[]>([])
const destinationAddress = ref('')
Expand Down
17 changes: 17 additions & 0 deletions components/bsx/Offer/OffersUserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ const getUniqType = () => {

return [{ type: AllOfferStatusType.ALL, value: 'All' }, ...singleEventList]
}

const currentBlock = ref(async () => {
const { apiInstance } = useApi()
const api = await apiInstance.value
const block = await api.rpc.chain.getHeader()
return block.number.toNumber()
})

const calcExpirationTime = (expirationBlock: number): string => {
if (currentBlock.value === 0) {
return 'computing'
}
if (currentBlock.value > expirationBlock) {
return 'expired'
}
return formatSecondsToDuration(calcSecondsToBlock(expirationBlock))
}
Comment on lines +175 to +190
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since I'm starting to duplicate this part of code

</script>

<style scoped>
Expand Down