Skip to content

Commit

Permalink
🚀 resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo committed Jun 28, 2022
2 parents dc81ccd + b3dc90f commit 806afb6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 13 deletions.
7 changes: 6 additions & 1 deletion components/bsx/Gallery/Item/AvailableActions.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<template>
<div>
<Loader v-model="isLoading" :status="status" />
<ActionList v-if="accountId" :actions="actions" @click="handleAction" />
<ActionList
v-if="accountId"
:actions="actions"
:isMakeOffersAllowed="isMakeOffersAllowed"
@click="handleAction" />
<component
class="mb-4"
v-if="showMeta"
Expand Down Expand Up @@ -54,6 +58,7 @@ export default class AvailableActions extends mixins(
@Prop() public price!: string
@Prop(String) public nftId!: string
@Prop(String) public collectionId!: string
@Prop(Boolean) public isMakeOffersAllowed!: boolean
@Prop({ type: Array, default: () => [] }) public ipfsHashes!: string[]
private selectedAction: ShoppingActions | '' = ''
Expand Down
9 changes: 9 additions & 0 deletions components/bsx/Gallery/Item/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
:delegateId="nft.delegate"
:collectionId="collectionId"
:frozen="nft.isFrozen"
:isMakeOffersAllowed="isMakeOffersAllowed"
:ipfs-hashes="[
nft.image,
nft.animation_url,
Expand All @@ -114,6 +115,7 @@
<OfferList
:current-owner-id="nft.currentOwner"
:nftId="id"
@offersUpdate="offersUpdate"
:collectionId="collectionId" />
</template>
</BaseGalleryItem>
Expand Down Expand Up @@ -198,6 +200,7 @@ export default class GalleryItem extends mixins(
public meta: NFTMetadata = emptyObject<NFTMetadata>()
public emotes: Emote[] = []
public message = ''
public isMakeOffersAllowed = true
public async created() {
this.checkId()
Expand Down Expand Up @@ -227,6 +230,12 @@ export default class GalleryItem extends mixins(
)
}
public offersUpdate({ offers }) {
this.isMakeOffersAllowed = !offers.find(({ caller }) => {
return caller === this.accountId
})
}
protected observeOwner(data: Option<InstanceDetails>) {
const instance = unwrapOrNull(data)
if (instance) {
Expand Down
3 changes: 2 additions & 1 deletion components/bsx/Offer/OfferList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</template>

<script lang="ts">
import { Component, mixins, Prop } from 'nuxt-property-decorator'
import { Component, Emit, mixins, Prop } from 'nuxt-property-decorator'
import { isSameAccount } from '~/utils/account'
import AuthMixin from '~/utils/mixins/authMixin'
import MetaTransactionMixin from '~/utils/mixins/metaMixin'
Expand Down Expand Up @@ -72,6 +72,7 @@ export default class OfferList extends mixins(
})
}
@Emit('offersUpdate')
protected setResponse(response: OfferResponse) {
this.offers = response.offers
this.total = response.stats.total
Expand Down
29 changes: 20 additions & 9 deletions components/rmrk/Gallery/Item/ActionList.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<template>
<div class="buttons">
<b-button
v-for="action in actions"
:key="action"
:type="iconType(action)"
outlined
expanded
@click="handleActionSelect(action)">
{{ action }}
</b-button>
<b-tooltip
class="w-100"
:active="!isMakeOffersAllowed"
:label="$t('tooltip.makeOfferDisabled')">
<b-button
v-for="action in actions"
:key="action"
:type="iconType(action)"
:disabled="
action === ShoppingActions.MAKE_OFFER && !isMakeOffersAllowed
"
outlined
expanded
@click="handleActionSelect(action)">
{{ action }}
</b-button>
</b-tooltip>
</div>
</template>

Expand All @@ -19,6 +27,9 @@ import { getActionButtonColor, ShoppingActions } from '@/utils/shoppingActions'
@Component({})
export default class ActionList extends Vue {
@Prop({ type: Array, required: false }) public actions!: ShoppingActions[]
@Prop(Boolean) public isMakeOffersAllowed!: boolean
private ShoppingActions = ShoppingActions
@Emit('click')
protected handleActionSelect(action: ShoppingActions) {
Expand Down
2 changes: 1 addition & 1 deletion components/rmrk/Gallery/LatestSales.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class LatestSales extends mixins(PrefixMixin, AuthMixin) {
limit: 10,
event: 'BUY',
}
if (this.isLogIn && this.passionList.length > 9) {
if (this.isLogIn) {
queryVars.and.nft = {
issuer_in: this.passionList,
}
Expand Down
3 changes: 2 additions & 1 deletion langDir/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@
"random": "Go to random page",
"buyDisabled": "Not enough balance",
"holdings": "Nfts owned by",
"gains": "Gained by"
"gains": "Gained by",
"makeOfferDisabled": "You have already made an offer for this NFT"
},
"nft": {
"carbonless": "This NFT is carbonless",
Expand Down
4 changes: 4 additions & 0 deletions styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,7 @@ button.button.navbar-link-background {
border: none!important;
border-top: 1px solid $primary!important;
}

.w-100 {
width: 100%;
}

0 comments on commit 806afb6

Please sign in to comment.