Skip to content

Commit

Permalink
Merge branch 'main' into issue-revert-create
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival authored Jul 18, 2024
2 parents c8038e7 + ff87389 commit d5443ab
Show file tree
Hide file tree
Showing 22 changed files with 786 additions and 445 deletions.
13 changes: 5 additions & 8 deletions components/collection/HeroButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,10 @@
</NeoDropdown>
</div>
</div>
<NeoModal :value="QRModalActive" @close="QRModalActive = false">
<div class="card" data-testid="hero-share-qrcode-modal">
<header class="card-header">
<p class="card-header-title">{{ collection?.name }}</p>
</header>
<div class="card-content">
<QRCode :text="currentCollectionUrl" />
</div>
<NeoModal :value="QRModalActive" header="" @close="QRModalActive = false">
<NeoModalHead :title="collection?.name" @close="QRModalActive = false" />
<div class="card-content" data-testid="hero-share-qrcode-modal">
<QRCode :text="currentCollectionUrl" />
</div>
</NeoModal>
</div>
Expand All @@ -102,6 +98,7 @@ import {
NeoDropdownItem,
NeoIcon,
NeoModal,
NeoModalHead,
} from '@kodadot1/brick'
import { useCollectionMinimal } from '@/components/collection/utils/useCollectionDetails'
import { hasOperationsDisabled } from '@/utils/prefix'
Expand Down
1 change: 0 additions & 1 deletion components/collection/drop/AddFundsModal.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<NeoModal
:value="modelValue"
:can-cancel="['outside', 'escape']"
content-class="add-funds-modal !w-[unset]"
@close="onClose">
<ModalBody
Expand Down
5 changes: 1 addition & 4 deletions components/collection/drop/modal/PaidMint.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<NeoModal
:value="modelValue"
:can-cancel="isSigningStep ? false : ['outside', 'escape']"
@close="close">
<NeoModal :value="modelValue" @close="close">
<ModalBody
:title="title"
:scrollable="false"
Expand Down
127 changes: 0 additions & 127 deletions components/collection/unlockable/UnlockableLoader.vue

This file was deleted.

10 changes: 1 addition & 9 deletions components/common/autoTeleport/AutoTeleportModal.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<template>
<NeoModal
:value="isModalActive"
:can-cancel="canCancel"
class="z-[1000]"
@close="onClose">
<NeoModal :value="isModalActive" class="z-[1000]" @close="onClose">
<div class="sm:w-[25rem]">
<ModalBody
:title="$i18n.t('autoTeleport.signTransactions')"
Expand Down Expand Up @@ -215,10 +211,6 @@ const autoteleportFinalized = computed(() =>
: hasCompletedActionPreSteps.value,
)

const canCancel = computed(() =>
autoteleportFinalized.value ? ['outside', 'escape'] : false,
)

const btnLabel = computed<string>(() => {
if (!hasActions.value && isBalanceCheckCompleted.value) {
return $i18n.t('redirect.continue')
Expand Down
6 changes: 1 addition & 5 deletions components/common/autoTeleport/AutoTeleportWelcomeModal.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<template>
<NeoModal
:value="isModalActive"
:can-cancel="['outside', 'escape']"
class="z-[1000]"
@close="onClose">
<NeoModal :value="isModalActive" class="z-[1000]" @close="onClose">
<div class="sm:w-[40rem]">
<header class="py-5 pl-6 pr-5 flex justify-between items-center">
<span class="capitalize text-[1.6rem] font-bold">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<NeoModal
:value="isModalActive"
:can-cancel="['outside', 'escape']"
class="z-[1000]"
content-class="!w-[unset]"
@close="onClose">
Expand Down
5 changes: 1 addition & 4 deletions components/common/successfulModal/SuccessfulModal.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<NeoModal
:value="isModalActive"
:can-cancel="['outside', 'escape']"
@close="onClose">
<NeoModal :value="isModalActive" @close="onClose">
<ModalBody :title="$t('success')" @close="onClose">
<SuccessfulModalBody
:tx-hash="txHash"
Expand Down
5 changes: 1 addition & 4 deletions components/drops/CreateCalendarEventModal.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<NeoModal
:value="isModalActive"
:can-cancel="['outside', 'escape']"
@close="onClose">
<NeoModal :value="isModalActive" @close="onClose">
<ModalBody :title="$t('drops.createACalendarEvent')" @close="onClose">
<p class="capitalize">
{{ title }}
Expand Down
5 changes: 4 additions & 1 deletion components/identity/IdentityIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ const showIdentityBadge = computed(() =>
Boolean(props.showBadge && hasIdentity.value),
)
provide('address', props.address)
provide(
'address',
computed(() => props.address),
)
provide(
'shortenedAddress',
computed(() => shortenedAddress.value),
Expand Down
12 changes: 7 additions & 5 deletions components/identity/module/IdentityPopoverFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const GalleryCard = defineAsyncComponent(
const NFT_AMOUNT = 2
const address = inject('address') as string
const address = inject('address') as ComputedRef<string>
const { urlPrefix } = usePrefix()
const { totalCreated } = useIdentityStats({
Expand All @@ -68,7 +68,9 @@ const {
data: followersData,
refresh,
pending: loading,
} = useAsyncData(() => fetchFollowersOf(address))
} = useAsyncData(`followers-${address.value}`, () =>
fetchFollowersOf(address.value),
)
const followers = computed(() =>
loading.value ? 0 : followersData.value?.totalCount || 0,
Expand All @@ -82,12 +84,12 @@ const { data } = useSearchNfts({
OR: [
{
// created
issuer_eq: address,
issuer_eq: address.value,
},
{
// bought
issuer_not_eq: address,
currentOwner_eq: address,
issuer_not_eq: address.value,
currentOwner_eq: address.value,
},
],
},
Expand Down
16 changes: 10 additions & 6 deletions components/identity/utils/useIdentityStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { useIdentityMintStore } from '@/stores/identityMint'
import { formatToNow } from '@/utils/format/time'
import buyEventByProfile from '@/queries/subsquid/general/buyEventByProfile.query'

const useLastBought = ({ address }) => {
const useLastBought = ({ address }: { address: Ref<string> }) => {
const lastBoughtDate = ref(new Date())

const { data } = useAsyncQuery({
query: buyEventByProfile,
variables: {
id: address,
id: address.value,
},
})

Expand Down Expand Up @@ -55,7 +55,11 @@ const cacheTotalCount = ({ data, totalCreated }) => {
return cacheData
}

export default function useIdentityStats({ address }) {
export default function useIdentityStats({
address,
}: {
address: Ref<string>
}) {
const identityMintStore = useIdentityMintStore()

const totalCreated = ref(0)
Expand All @@ -65,7 +69,7 @@ export default function useIdentityStats({ address }) {
const { data: stats } = useGraphql({
queryName: 'userStatsByAccount',
variables: {
account: address,
account: address.value,
},
})

Expand All @@ -88,14 +92,14 @@ export default function useIdentityStats({ address }) {
firstMintDate.value = cacheData.firstMintDate

identityMintStore.setIdentity({
address,
address: address.value,
cacheData,
})
}

const fetchNFTStats = () => {
// if cache exist and within 12h
const data = identityMintStore.getIdentityMintFor(address)
const data = identityMintStore.getIdentityMintFor(address.value)
if (data?.updatedAt && isAfter(data.updatedAt, subHours(Date.now(), 12))) {
return handleNFTStats({ data, type: 'cache' })
}
Expand Down
2 changes: 1 addition & 1 deletion components/shared/TransactionLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const props = withDefaults(
isMobile?: boolean
}>(),
{
canCancel: true,
canCancel: false,
isMobile: false,
},
)
Expand Down
2 changes: 1 addition & 1 deletion libs/static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint-config-unjs": "^0.3.2",
"prettier": "^3.3.2",
"prettier": "^3.3.3",
"typescript": "^5.5.3",
"unbuild": "^2.0.0",
"vitest": "^1.6.0"
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint-plugin-vue": "^8.7.1",
"histoire": "0.17.6",
"postcss": "^8.4.39",
"tailwindcss": "^3.4.4"
"tailwindcss": "^3.4.5"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.2",
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/src/components/NeoModal/NeoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const props = withDefaults(
}>(),
{
destroyOnHide: true,
canCancel: true,
canCancel: false,
fullScreen: false,
contentClass: '',
rootClass: '',
Expand Down
3 changes: 3 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,13 @@ export default defineNuxtConfig({
'3fcc6bba6f1de962d911bb5b5c3dba68', // WalletConnect project ID from `https://wagmi.sh/core/api/connectors/walletConnect#projectid`
},
},

// In case of using ssr
// privateRuntimeConfig: {}

devtools: {
enabled: true,
},

compatibilityDate: '2024-07-11',
})
Loading

0 comments on commit d5443ab

Please sign in to comment.