Skip to content

Commit

Permalink
Merge pull request #11161 from kodadot/main
Browse files Browse the repository at this point in the history
(beta): 74% of October 2024 Durian 💛
  • Loading branch information
vikiival authored Oct 23, 2024
2 parents f01ff70 + 4d70b19 commit a700368
Show file tree
Hide file tree
Showing 65 changed files with 690 additions and 519 deletions.
2 changes: 2 additions & 0 deletions components/base/MediaItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
:preview="preview"
:autoplay="autoplay"
:lazy-loading="lazyLoading"
:inner-class="innerClass"
/>
<div
v-if="isLewd && isLewdBlurredLayer"
Expand Down Expand Up @@ -101,6 +102,7 @@ const props = withDefaults(
lazyLoading?: boolean
enableNormalTag?: boolean
sizes?: string
innerClass?: string
imageComponent?:
| string
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
Expand Down
17 changes: 11 additions & 6 deletions components/collection/CollectionHeader/CollectionBanner.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
class="collection-banner relative md:h-[560px] h-72 bg-no-repeat bg-cover bg-center border-b"
:style="{ backgroundImage: `url(${bannerImageUrl})` }"
:style="{ backgroundImage: `url(${collectionBanner})` }"
>
<div class="collection-banner-shadow absolute inset-0" />

Expand Down Expand Up @@ -55,38 +55,43 @@ 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 = '--'
})
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 {
const meta = (await processSingleMetadata(
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
}
Expand Down
2 changes: 1 addition & 1 deletion components/collection/drop/GenerativePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions components/collection/utils/useCollectionDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const useCollectionMinimal = ({

collection.value = collectionData
},
{ immediate: true },
)

watchEffect(async () => {
Expand Down
14 changes: 5 additions & 9 deletions components/common/ConnectWallet/ConnectEvm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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,
})
}
})
Expand Down
12 changes: 7 additions & 5 deletions components/common/ConnectWallet/ConnectSubstrate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
15 changes: 9 additions & 6 deletions components/common/ConnectWallet/ConnectWalletModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@

<script setup lang="ts">
import { NeoModalHead } from '@kodadot1/brick'
import { type ChainVM, DEFAULT_VM_PREFIX } from '@kodadot1/static'
import { type ChainVM, type Prefix } from '@kodadot1/static'
import { DEFAULT_VM_PREFIX } from '@kodadot1/static'
import WalletAsset from '@/components/common/ConnectWallet/WalletAsset.vue'
import { ModalCloseType } from '@/components/navbar/types'
import { arePrefixesOfSameVm } from '@/utils/config/chain.config'
const emit = defineEmits(['close', 'connect'])
const props = defineProps<{ preselected?: ChainVM }>()
Expand All @@ -68,14 +70,15 @@ const selectedTab = ref<ChainVM>(props.preselected ?? 'SUB')
const showAccount = computed(() => Boolean(account.value))
const setAccount = (account: WalletAccount) => {
const setAccount = ({ account, prefix }: { account: WalletAccount, prefix?: Prefix }) => {
prefix ??= DEFAULT_VM_PREFIX[account.vm]
walletStore.setWallet(account)
identityStore.setAuth({ address: account.address })
if (!isPrefixVmOf(urlPrefix.value, account.vm)) {
const newChain = DEFAULT_VM_PREFIX[account.vm]
setUrlPrefix(newChain)
redirectAfterChainChange(newChain)
if (!arePrefixesOfSameVm(prefix, urlPrefix.value)) {
setUrlPrefix(prefix)
redirectAfterChainChange(urlPrefix.value)
}
emit('connect', account)
Expand Down
2 changes: 0 additions & 2 deletions components/common/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ import {
NeoMessage,
} from '@kodadot1/brick'
type NotificationAction = { label: string, url: string, icon?: string }
const emit = defineEmits(['close'])
const props = withDefaults(
defineProps<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
:disabled="isDisabled"
:loading="loading"
:loading-with-label="loading"
with-shortcut
class="flex flex-grow btn-height capitalize"
@click="handleSubmit"
/>
Expand Down
Loading

0 comments on commit a700368

Please sign in to comment.