Skip to content

Commit

Permalink
🔧 Holders activity tab
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo committed Oct 5, 2023
1 parent fcf63b4 commit 959d882
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ const toggleNFTDetails = (holderId: string) => {
const target = ref<HTMLElement | null>(null)
const offset = ref(4)
onMounted(() => {
console.log(props.owners)
})
const holders = computed(() =>
Object.entries(props.owners || {}).sort(
// sort by nft count: highest first
Expand Down
10 changes: 6 additions & 4 deletions composables/collectionActivity/useCollectionActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ export const useCollectionActivity = ({ collectionId }) => {
},
})

console.log(data)

watch(data, (result) => {
if (result.value?.collection) {
if (result) {
// flat events for chart
const interactions: InteractionWithNFT[] = result.value.collection.nfts
const interactions: InteractionWithNFT[] = result.collection.nfts
.map((nft) =>
nft.events.map((e) => ({
...e,
Expand All @@ -33,11 +35,11 @@ export const useCollectionActivity = ({ collectionId }) => {
events.value = interactions

if (urlPrefix.value === 'bsx') {
offers.value = getOffers(result.value.collection.nfts)
offers.value = getOffers(result.collection.nfts)
}

// not to repeat ref names
const ownersTemp = getOwners(result.value.collection.nfts)
const ownersTemp = getOwners(result.collection.nfts)
const flippersTemp = getFlippers(interactions)

const flipperdIds = Object.keys(flippersTemp)
Expand Down

0 comments on commit 959d882

Please sign in to comment.