-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add search by nft and shorten search placehodler (#626)
- Loading branch information
Showing
22 changed files
with
263 additions
and
57 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
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
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
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
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
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,39 @@ | ||
<template> | ||
<app-panel> | ||
<paginated-content | ||
:entities="nftsResults" | ||
:limit="limit" | ||
@prev-clicked="loadPrevNfts" | ||
@next-clicked="loadNextNfts"> | ||
<search-nfts-table | ||
:nfts="nftsResults" | ||
class="u-hidden-mobile"/> | ||
<search-nfts-table-condensed | ||
:nfts="nftsResults" | ||
class="u-hidden-desktop"/> | ||
</paginated-content> | ||
</app-panel> | ||
</template> | ||
<script setup> | ||
import { computed } from 'vue' | ||
import { storeToRefs } from 'pinia' | ||
import { isDesktop } from '@/utils/screen' | ||
import { useSearchStore } from '@/stores/search' | ||
const searchStore = useSearchStore() | ||
const { nftsResults } = storeToRefs(searchStore) | ||
const { fetchNftsResults } = searchStore | ||
const limit = computed(() => process.client && isDesktop() ? 10 : 3) | ||
const route = useRoute() | ||
await fetchNftsResults({ query: route.params.id, limit: limit.value }) | ||
async function loadPrevNfts() { | ||
await fetchNftsResults({ queryParameters: nftsResults.value.prev }) | ||
} | ||
async function loadNextNfts() { | ||
await fetchNftsResults({ queryParameters: nftsResults.value.next }) | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<template> | ||
<table class="search-nfts-table"> | ||
<thead> | ||
<tr> | ||
<th> | ||
Collection Name | ||
<hint-tooltip> | ||
{{ nftsHints.collectionName }} | ||
</hint-tooltip> | ||
</th> | ||
<th> | ||
Smart Contract ID | ||
<hint-tooltip> | ||
{{ nftsHints.smartContractId }} | ||
</hint-tooltip> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr | ||
v-for="nft in nfts.data" | ||
:key="nft.contractId"> | ||
<td> | ||
<app-link | ||
:to="`/nfts/${nft.contractId}`" | ||
class="search-nfts-table__link"> | ||
{{ nft.name }} | ||
</app-link> | ||
</td> | ||
<td> | ||
<value-hash-ellipsed | ||
:link-to="`/contracts/${nft.contractId}`" | ||
:hash="nft.contractId"/> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<script setup> | ||
import { nftsHints } from '@/utils/hints/nftsHints' | ||
defineProps({ | ||
nfts: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
.search-nfts-table { | ||
margin-bottom: var(--space-4); | ||
&__link { | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
&__icon { | ||
width: 24px; | ||
height: 24px; | ||
margin-right: var(--space-1); | ||
} | ||
} | ||
</style> |
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,88 @@ | ||
<template> | ||
<div> | ||
<table | ||
v-for="nft in nfts.data" | ||
:key="nft.contractId" | ||
class="search-nfts-table-condensed__table"> | ||
<tbody> | ||
<tr class="search-nfts-table-condensed__row"> | ||
<th class="search-nfts-table-condensed__header"> | ||
<app-tooltip> | ||
Collection Name | ||
<template #tooltip> | ||
{{ nftsHints.collectionName }} | ||
</template> | ||
</app-tooltip> | ||
</th> | ||
<td class="search-nfts-table-condensed__data"> | ||
<app-link | ||
:to="`/nfts/${nft.contractId}`" | ||
class="search-nfts-table-condensed__link"> | ||
{{ nft.name }} | ||
</app-link> | ||
</td> | ||
</tr> | ||
<tr class="search-nfts-table-condensed__row"> | ||
<th class="search-nfts-table-condensed__header"> | ||
<app-tooltip> | ||
Smart Contract ID | ||
<template #tooltip> | ||
{{ nftsHints.smartContractId }} | ||
</template> | ||
</app-tooltip> | ||
</th> | ||
<td class="search-nfts-table-condensed__data"> | ||
<value-hash-ellipsed | ||
:link-to="`/contracts/${nft.contractId}`" | ||
:hash="nft.contractId"/> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</template> | ||
<script setup> | ||
import AppLink from '@/components/AppLink' | ||
import AppTooltip from '@/components/AppTooltip' | ||
import { nftsHints } from '@/utils/hints/nftsHints' | ||
defineProps({ | ||
nfts: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
.search-nfts-table-condensed { | ||
&__table { | ||
padding: 0 var(--space-1) var(--space-7); | ||
margin-bottom: var(--space-5); | ||
} | ||
&__header { | ||
border-bottom: 1px solid var(--color-midnight-25); | ||
} | ||
&__row:last-of-type &__header { | ||
border-bottom: 0; | ||
} | ||
&__data { | ||
text-align: right; | ||
} | ||
&__link { | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
&__icon { | ||
width: 20px; | ||
height: 20px; | ||
margin-right: var(--space-1); | ||
} | ||
} | ||
</style> |
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
Oops, something went wrong.