-
Notifications
You must be signed in to change notification settings - Fork 4
[TAS-5315] ✨ Add LikeRank display and remove staking stats from book cards #889
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,8 +128,6 @@ | |
| :class="getGridItemClassesByIndex(index)" | ||
| :nft-class-id="item.nftClassId" | ||
| :nft-ids="item.nftIds" | ||
| :staked-amount="item.stakedAmount" | ||
| :pending-rewards="item.pendingRewards" | ||
| :is-owned="item.isOwned" | ||
| :progress="item.progress" | ||
| :lazy="index >= columnMax" | ||
|
Comment on lines
128
to
133
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ | |
| <ExpandableContent> | ||
| <div | ||
| class="markdown" | ||
| v-html="bookInfoDescriptionHTML" | ||
| /> | ||
| </ExpandableContent> | ||
| <template v-if="bookInfo.descriptionSummary?.value"> | ||
|
|
@@ -129,7 +129,7 @@ | |
| <ExpandableContent> | ||
| <div | ||
| class="markdown" | ||
| v-html="bookInfoDescriptionSummaryHTML" | ||
| /> | ||
| </ExpandableContent> | ||
| </template> | ||
|
|
@@ -209,7 +209,7 @@ | |
| <ExpandableContent> | ||
| <div | ||
| class="markdown" | ||
| v-html="previewContentHTML" | ||
| /> | ||
| </ExpandableContent> | ||
| </template> | ||
|
|
@@ -229,7 +229,7 @@ | |
| <ExpandableContent> | ||
| <div | ||
| class="markdown" | ||
| v-html="authorDescriptionHTML" | ||
| /> | ||
| </ExpandableContent> | ||
| </template> | ||
|
|
@@ -238,7 +238,7 @@ | |
| <ExpandableContent> | ||
| <div | ||
| class="markdown" | ||
| v-html="tableOfContentsHTML" | ||
| /> | ||
| </ExpandableContent> | ||
| </template> | ||
|
|
@@ -276,6 +276,20 @@ | |
| /> | ||
| </div> | ||
| </UCard> | ||
| <UCard | ||
| v-if="stakingRank > 0" | ||
| :ui="{ body: 'p-4' }" | ||
| > | ||
| <div class="text-center"> | ||
|
Comment on lines
+279
to
+283
|
||
| <div class="text-2xl font-semibold"> | ||
| #{{ stakingRank }} | ||
| </div> | ||
| <div | ||
| class="mt-1 text-sm text-muted" | ||
| v-text="$t('staking_like_rank')" | ||
| /> | ||
| </div> | ||
| </UCard> | ||
| <UCard | ||
| v-if="hasLoggedIn" | ||
| :ui="{ body: 'p-4' }" | ||
|
|
@@ -490,7 +504,7 @@ | |
| <div | ||
| v-if="item.renderedDescription" | ||
| class="markdown whitespace-normal text-left mt-2" | ||
| v-html="item.renderedDescription" | ||
| /> | ||
|
|
||
| <div class="flex flex-wrap gap-1 mt-3"> | ||
|
|
@@ -883,6 +897,7 @@ | |
| formattedUserStake, | ||
| formattedPendingRewards, | ||
| numberOfStakers, | ||
| stakingRank, | ||
| handleClaimRewards, | ||
| loadStakingData, | ||
| } = useNFTClassStakingData(nftClassId) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ interface StakingBooks { | |
| nftClassId: string | ||
| totalStaked: bigint | ||
| stakerCount: number | ||
| likeRank: number | ||
| }> | ||
| isFetching: boolean | ||
| hasFetched: boolean | ||
|
|
@@ -383,16 +384,16 @@ export const useBookstoreStore = defineStore('bookstore', () => { | |
| 'sort_by': sortBy as 'staked_amount' | 'last_staked_at' | 'number_of_stakers', | ||
| }) | ||
|
|
||
| const currentOffset = Number(stakingBooksMap.value[sortBy].offset ?? 0) | ||
| const bookNFTs = result.data | ||
| .map(bookNFT => ({ | ||
| .filter(bookNFT => BigInt(bookNFT.staked_amount || 0) > 0) | ||
| .map((bookNFT, index) => ({ | ||
| nftClassId: normalizeNFTClassId(bookNFT.evm_address), | ||
| totalStaked: BigInt(bookNFT.staked_amount || 0), | ||
| stakerCount: bookNFT.number_of_stakers, | ||
| lastStakedAt: bookNFT.last_staked_at, | ||
| likeRank: currentOffset + index + 1, | ||
|
||
| })) | ||
|
Comment on lines
392
to
396
|
||
| .filter((bookNFT) => { | ||
| return bookNFT.totalStaked > 0 | ||
| }) | ||
|
|
||
| if (isRefresh) { | ||
| stakingBooksMap.value[sortBy].items = bookNFTs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After removing the
:pending-rewardsprop from<BookshelfItem>, this page still computespendingRewardsinBookshelfItemWithStaking(includingformatUnits(...)) but no longer uses it anywhere (onlystakedAmountis used for sorting). Consider removing thependingRewardsfield and its associated conversions to avoid unnecessary work and reduce data shape complexity.