-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from art-by-city/94-add-curations-tab-to-profile
94 add curations tab to profile
- Loading branch information
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<v-container v-if="curationFeed"> | ||
<v-row> | ||
<v-col v-for="item in curationFeed" :key="item.id" cols="4"> | ||
<FeedItemCard :id="item.id" /> | ||
</v-col> | ||
</v-row> | ||
<v-row v-if="!hasReachedEnd"> | ||
<v-col> | ||
<v-btn | ||
elevation="2" | ||
color="primary" | ||
variant="outlined" | ||
@click="onLoadMore" | ||
> | ||
Load More | ||
</v-btn> | ||
</v-col> | ||
</v-row> | ||
</v-container> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import ArdbTransaction from 'ardb/lib/models/transaction' | ||
const props = defineProps<{ address: string }>() | ||
const abc = useArtByCity() | ||
const curationFeed = ref<ArdbTransaction[]>([]) | ||
const cursor = ref<string | undefined>() | ||
const hasReachedEnd = ref(false) | ||
const onLoadMore = debounce(async () => { | ||
if (hasReachedEnd.value) { return } | ||
const { curations, cursor: nextCursor } = await abc | ||
.curations | ||
.createdBy(props.address, cursor.value) | ||
curationFeed.value.push(...curations) | ||
cursor.value = nextCursor | ||
if (!nextCursor) { | ||
hasReachedEnd.value = true | ||
} | ||
}) | ||
onLoadMore() | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters