Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | <template>
<div v-if="exist">
<div class="col-12 text-h5 text-bold text-center q-my-md">
# NFTs available: {{ bal }}
</div>
<div class="row col-12" v-if="bal > 0">
<div
class="col-xs-12 col-sm-6 col-md-3 col-lg-2 flex justify-center"
v-for="nft in nftIds"
:key="nft.id"
>
<nft-img :src="nft.image" :alt="nft.id" />
</div>
</div>
<div
class="row q-mt-lg"
v-dm-class="{ dark: 'bg-grey-8', light: 'bg-green-1' }"
v-else
>
<div class="col-12 q-pa-lg row">
<span class="text-h5 text-center col-12">
No NFTs available
</span>
</div>
</div>
</div>
</template>
<script lang="ts">
import { GettersName } from "src/store";
import { mapGetters, mapState } from "vuex";
import NFTImageVue from "src/components/NFT/NFTImage.vue";
import { Vue, Component, Prop } from "vue-property-decorator";
import { darkModeClassDirectives } from "src/directives/darkModeClass";
@Component({
name: "NFTListComponent",
directives: {
"dm-class": darkModeClassDirectives
},
components: {
"nft-img": NFTImageVue
},
computed: {
...mapState({
nftIds: function(state: any) {
return state.contract.contractDetails[this.network][this.name].ids;
}
}),
...mapGetters({
contractDetails: GettersName.contract.getContractDetails
})
}
})
class NFTListComponent extends Vue {
@Prop(String) name: string;
@Prop(String) network: string;
public contractDetails: (network: string) => any[];
public get exist(): boolean {
const contractDetails = this.contractDetails(this.network);
return Object.keys(contractDetails).length > 0;
}
public get bal(): number {
return this.contractDetails(this.network).filter(
data => data.name === this.name
)[0].balance;
}
}
export default NFTListComponent;
</script>
|