diff --git a/components/base/MediaItem.vue b/components/base/MediaItem.vue index 5635c3d07f..a601c5c68b 100644 --- a/components/base/MediaItem.vue +++ b/components/base/MediaItem.vue @@ -25,6 +25,7 @@ :preview="preview" :autoplay="autoplay" :lazy-loading="lazyLoading" + :inner-class="innerClass" />
@@ -55,14 +55,12 @@ const props = defineProps<{ const route = useRoute() const collectionAvatar = ref('') +const collectionBanner = ref('') const collectionName = ref('--') -const bannerImageUrl = computed( - () => collectionAvatar.value && toOriginalContentUrl(collectionAvatar.value), -) - watch(() => props.collectionId, () => { collectionAvatar.value = '' + collectionBanner.value = '' collectionName.value = '--' }) @@ -70,10 +68,12 @@ watchEffect(async () => { const collection = props.collection const metadata = collection?.metadata const image = collection?.meta?.image + const banner = collection?.meta?.banner || image const name = collection?.name - if (image && name) { + if (image && name && banner) { collectionAvatar.value = sanitizeIpfsUrl(image) + collectionBanner.value = toOriginalContentUrl(sanitizeIpfsUrl(banner)) collectionName.value = name } else { @@ -81,12 +81,17 @@ watchEffect(async () => { metadata as string, )) as NFTMetadata const metaImage = sanitizeIpfsUrl(meta?.image) + const metaBanner = meta?.banner ? sanitizeIpfsUrl(meta?.banner) : metaImage const metaName = meta?.name if (metaName) { collectionName.value = metaName } + if (metaBanner) { + collectionBanner.value = toOriginalContentUrl(metaBanner) + } + if (metaImage) { collectionAvatar.value = metaImage } diff --git a/components/collection/drop/GenerativePreview.vue b/components/collection/drop/GenerativePreview.vue index fa8ed892be..3c3ca8abcc 100644 --- a/components/collection/drop/GenerativePreview.vue +++ b/components/collection/drop/GenerativePreview.vue @@ -123,7 +123,7 @@ const { formatted: formattedPrice } = useAmount( ) const emit = defineEmits(['generation:start', 'generation:end', 'mint']) -const isUnlimited = computed(() => drop.value.max !== undefined && drop.value.max > Number.MAX_SAFE_INTEGER) +const isUnlimited = computed(() => drop.value.max !== undefined && drop.value.max >= Number.MAX_SAFE_INTEGER) const { start: startTimer } = useTimeoutFn(() => { // quick fix: ensure that even if the completed event is not received, the loading state of the drop can be cleared diff --git a/components/collection/utils/useCollectionDetails.ts b/components/collection/utils/useCollectionDetails.ts index 4097513492..cf4f48b931 100644 --- a/components/collection/utils/useCollectionDetails.ts +++ b/components/collection/utils/useCollectionDetails.ts @@ -145,6 +145,7 @@ export const useCollectionMinimal = ({ collection.value = collectionData }, + { immediate: true }, ) watchEffect(async () => { diff --git a/components/common/ConnectWallet/ConnectEvm.vue b/components/common/ConnectWallet/ConnectEvm.vue index 56c42b124d..9efcf861a0 100644 --- a/components/common/ConnectWallet/ConnectEvm.vue +++ b/components/common/ConnectWallet/ConnectEvm.vue @@ -30,7 +30,6 @@ import { useAccount, useDisconnect, useConnections } from '@wagmi/vue' const emits = defineEmits(['select']) const { address, isConnected, isConnecting, chainId } = useAccount() -const { urlPrefix, setUrlPrefix } = usePrefix() const { modal } = useWeb3Modal() const { disconnectAsync: disconnect } = useDisconnect() const connections = useConnections() @@ -47,15 +46,12 @@ watch([address, isConnected, chainId], ([address, isConnected, chainId]) => { const chainPrefix = CHAIN_ID_TO_PREFIX?.[chainId ?? ''] if (address && isConnected && chainId && chainPrefix) { - const isCorrectChainConnected = chainPrefix === urlPrefix.value - - if (!isCorrectChainConnected) { - setUrlPrefix(chainPrefix) - } - emits('select', { - address: address as string, - vm: 'EVM', + account: { + address: address as string, + vm: 'EVM', + }, + prefix: chainPrefix, }) } }) diff --git a/components/common/ConnectWallet/ConnectSubstrate.vue b/components/common/ConnectWallet/ConnectSubstrate.vue index 1677f71674..65ff37e754 100644 --- a/components/common/ConnectWallet/ConnectSubstrate.vue +++ b/components/common/ConnectWallet/ConnectSubstrate.vue @@ -119,11 +119,13 @@ const installedWallet = computed(() => { const setAccount = (account: SubstrateWalletAccount) => { forceWalletSelect.value = false emits('select', { - address: account.address, - extension: account.source, - name: account.name, - vm: 'SUB', - } as WalletAccount) + account: { + address: account.address, + extension: account.source, + name: account.name, + vm: 'SUB', + } as WalletAccount, + }) } const refreshWallets = () => { diff --git a/components/common/ConnectWallet/ConnectWalletModal.vue b/components/common/ConnectWallet/ConnectWalletModal.vue index 8297f59ab6..bb9cd9665f 100644 --- a/components/common/ConnectWallet/ConnectWalletModal.vue +++ b/components/common/ConnectWallet/ConnectWalletModal.vue @@ -50,9 +50,11 @@ + autoTeleport.value = autoteleport - +useTransactionNotification({ + status, + isError, + sessionId: lastSessionId, + autoTeleport, + updateSession, + init: () => { + return notification(({ isSessionState, notify, session }) => { + return notify({ + title: ref($i18n.t('transaction.transferingNft', items.value.length)), + state: computed(() => session?.value.state as LoadingNotificationState), + action: computed(() => { + return isSessionState('succeeded') + ? ({ + label: $i18n.t('helper.viewTx'), + icon: 'arrow-up-right', + url: getTransactionUrl(txHash.value || '', urlPrefix.value) || '', + }) + : undefined + }), + showIndexerDelayMessage: true, + }) + }) + }, +}) + +useModalIsOpenTracker({ + isOpen: isModalActive, + onClose: false, + onChange: () => { + items.value = [...listingCartStore.itemsInChain] + }, +}) + +onBeforeMount(closeModal) + diff --git a/components/common/itemTransfer/ItemTransferMultipleItems.vue b/components/common/itemTransfer/ItemTransferMultipleItems.vue new file mode 100644 index 0000000000..214382f238 --- /dev/null +++ b/components/common/itemTransfer/ItemTransferMultipleItems.vue @@ -0,0 +1,25 @@ + + + diff --git a/components/common/itemTransfer/ItemTransferSingleItem.vue b/components/common/itemTransfer/ItemTransferSingleItem.vue new file mode 100644 index 0000000000..e1ed58b3c6 --- /dev/null +++ b/components/common/itemTransfer/ItemTransferSingleItem.vue @@ -0,0 +1,19 @@ + + + diff --git a/components/common/listingCart/ListingCartMini.vue b/components/common/listingCart/ListingCartMini.vue index 12c0216764..4b72e249b1 100644 --- a/components/common/listingCart/ListingCartMini.vue +++ b/components/common/listingCart/ListingCartMini.vue @@ -6,7 +6,7 @@ >
@@ -16,7 +16,7 @@
{{ $t('listingCart.selectAll') }}
+ +
+ + + {{ $t('transfer') }} + + + + + + {{ $t('listingCart.listItem', listingCartStore.count) }} + + +
- - {{ $t('listingCart.listItem', listingCartStore.count) }} -
diff --git a/components/items/ItemsGrid/ItemsGridImage.vue b/components/items/ItemsGrid/ItemsGridImage.vue index cb5e8498db..23c229c9f8 100644 --- a/components/items/ItemsGrid/ItemsGridImage.vue +++ b/components/items/ItemsGrid/ItemsGridImage.vue @@ -56,7 +56,7 @@
to import { resolveComponent } from 'vue' import { NeoButton, NeoIcon } from '@kodadot1/brick' -import { listVisible } from '@/utils/config/permission.config' import type { NftCardVariant } from '@/components/shared/nftCard/types' import type { NFTWithMetadata } from '@/composables/useNft' import { useShoppingCartStore } from '@/stores/shoppingCart' import { useListingCartStore } from '@/stores/listingCart' import { usePreferencesStore } from '@/stores/preferences' -import { - nftToListingCartItem, - nftToShoppingCartItem, -} from '@/components/common/shoppingCart/utils' +import { nftToShoppingCartItem } from '@/components/common/shoppingCart/utils' const { placeholder } = useTheme() const { isLogIn, isCurrentOwner } = useAuth() @@ -98,6 +94,7 @@ const { doAfterLogin } = useDoAfterlogin() const shoppingCartStore = useShoppingCartStore() const listingCartStore = useListingCartStore() const preferencesStore = usePreferencesStore() +const { listNftByNftWithMetadata } = useListingCartModal() const { $i18n } = useNuxtApp() const NuxtLink = resolveComponent('NuxtLink') @@ -128,12 +125,7 @@ const buyLabel = computed(function () { ) }) -const listLabel = computed(() => { - const label = Number(props.nft.price) - ? $i18n.t('transaction.price.change') - : $i18n.t('listingCart.listForSale') - return label + (listingCartStore.isItemInCart(props.nft.id) ? ' ✓' : '') -}) +const listLabel = computed(() => listingCartStore.isItemInCart(props.nft.id) ? $i18n.t('remove') : $i18n.t('select')) const isOwner = computed(() => isCurrentOwner(props.nft?.currentOwner)) @@ -164,13 +156,7 @@ const onClickShoppingCart = () => { } } const onClickListingCart = () => { - if (listingCartStore.isItemInCart(props.nft.id)) { - listingCartStore.removeItem(props.nft.id) - } - else { - const floorPrice = props.nft.collection.floorPrice[0]?.price || '0' - listingCartStore.setItem(nftToListingCartItem(props.nft, floorPrice)) - } + listNftByNftWithMetadata(props.nft, { toggle: true }) } diff --git a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue index 0b2a680569..922c92a68b 100644 --- a/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue +++ b/components/items/ItemsGrid/ItemsGridImageTokenEntity.vue @@ -70,7 +70,7 @@ /> -