Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(beta/fix): Mid-August 2024 Shark 🦈 #10832

Merged
merged 74 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
60e5857
✨ drops page shortcuts
roiLeo Jul 10, 2024
362907e
Merge branch 'main' into feature/drops/shortcut
roiLeo Jul 16, 2024
88371af
Merge branch 'main' into feature/drops/shortcut
roiLeo Jul 17, 2024
26a1ca6
✨ KeyboardShortcutModal
roiLeo Jul 17, 2024
f9fff4f
✨ KeyboardShortcutModal
roiLeo Jul 17, 2024
3dc75d9
✨ drops title
roiLeo Jul 17, 2024
be4ece7
Merge branch 'main' into feature/drops/shortcut
hassnian Jul 18, 2024
89477d3
Merge branch 'main' into feature/drops/shortcut
roiLeo Jul 19, 2024
457fbd2
Merge branch 'main' into feature/drops/shortcut
roiLeo Jul 22, 2024
2f68c69
Merge branch 'main' into feature/drops/shortcut
vikiival Jul 23, 2024
c7ff22b
Merge branch 'main' into feature/drops/shortcut
vikiival Jul 23, 2024
b6529de
fix: drops max count
preschian Aug 1, 2024
c25e266
refactor(tests): simplify image loading wait logic in explore.spec.ts
preschian Aug 1, 2024
5f4bf39
feat(tests): ensure images load during scroll in e2e explore
preschian Aug 1, 2024
5e481d8
refactor(tests): update collection spec to new data and optimize wait…
preschian Aug 1, 2024
c0cbc89
chore(workflow): increase shard count in Playwright configuration
preschian Aug 1, 2024
ac63e8b
chore(tests): add network idle state wait in gallery item interaction…
preschian Aug 1, 2024
9836743
feat(playwright): increase timeout and ensure server start command
preschian Aug 1, 2024
44c96a0
feat(playwright): increase timeout settings and add expect timeout
preschian Aug 1, 2024
318da3f
revert: flaky e2e test
preschian Aug 2, 2024
22f6985
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 2, 2024
515f22d
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 5, 2024
6cdf1a8
feat(drop): integrate EVM and Substrate collection data handling
preschian Aug 5, 2024
841d325
refactor(mint-button): add null check for maxCount comparison
preschian Aug 5, 2024
bb09b10
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 5, 2024
fa8b050
Update composables/drop/useGenerativeDropMint.ts
preschian Aug 5, 2024
90b9695
refactor(onchain): change API endpoint and adjust result parsing
preschian Aug 5, 2024
ff2ec26
feat(ogi): add service to fetch EVM collection data
preschian Aug 7, 2024
916e98c
refactor(drop): replace collection entity references with drop
preschian Aug 8, 2024
ae281ab
refactor(drop): replace useDrop with storeToRefs to streamline state
preschian Aug 8, 2024
ca3ac44
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 8, 2024
631991e
refactor(generative-drop): correct typos in function names and fix me…
preschian Aug 8, 2024
643fb86
Update components/drops/useDrops.ts
preschian Aug 8, 2024
942547e
fix(drops): prevent execution if collection is undefined in useDrop
preschian Aug 8, 2024
7dc049e
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 8, 2024
fcfa5ba
chore(deps): upgrade various npm dependencies in package.json
preschian Aug 13, 2024
390c2cb
refactor(plugins): update wagmi plugin configuration and initialization
preschian Aug 13, 2024
6c261ef
fix(identity): handle undefined balance with nullish coalescing operator
preschian Aug 13, 2024
6c0bd9c
chore(composables): remove unused useViem.ts file
preschian Aug 13, 2024
caf4007
chore(composables): remove deprecated useWagmi.ts file
preschian Aug 13, 2024
20c30d4
refactor(web3modal): replace useNuxtApp with useConfig for wagmi conf…
preschian Aug 13, 2024
71d2499
refactor(wallet): replace useWagmi with useAccount for account manage…
preschian Aug 13, 2024
251315d
refactor(utils): simplify EVM gas estimation function
preschian Aug 13, 2024
406e97b
fix(itemTransfer): remove unnecessary urlPrefix from getTransactionFe…
preschian Aug 13, 2024
96c68f9
refactor(autoTeleport): clean up type imports and cast action
preschian Aug 13, 2024
aaf8ba7
refactor(transaction): integrate wagmi for contract interactions
preschian Aug 13, 2024
96fbcc1
refactor(balance): simplify EVM balance fetching logic
preschian Aug 13, 2024
902020e
refactor(transaction): remove unused prefix parameter from getTransac…
preschian Aug 13, 2024
1707f73
refactor(balance): simplify getEvmBalance function signature and remo…
preschian Aug 13, 2024
0838159
refactor(auth): replace signMessage utility with useSignMessage from …
preschian Aug 13, 2024
a750bcd
fix(wallet): resolve issue with wallet disconnection logic
preschian Aug 13, 2024
3ccf7d1
fix(identity): replace nullish coalescing with logical OR in balance …
preschian Aug 13, 2024
009da88
refactor(utils): update import paths and remove unused client creatio…
preschian Aug 13, 2024
e26cc42
fix(balance): add chainId parameter to evmBalance function
preschian Aug 13, 2024
7bc8140
refactor(composables): pass prefix to EVM balance functions
preschian Aug 13, 2024
0c374fe
fix(itemTransfer): include urlPrefix in getTransactionFee call
preschian Aug 13, 2024
c349b80
Update plugins/wagmi.client.ts
vikiival Aug 14, 2024
f0a647f
Merge branch 'main' into refactor--proper-setup-wagmiPlugin
vikiival Aug 14, 2024
f7c6324
Merge pull request #10799 from kodadot/refactor--proper-setup-wagmiPl…
preschian Aug 15, 2024
7c46b44
Merge branch 'main' of github.com:kodadot/nft-gallery into fix--drops…
preschian Aug 15, 2024
25292da
refactor(onchain): remove unused wagmi config definitions
preschian Aug 15, 2024
74c9bd5
chore(config): remove use-wagmi from dependencies
preschian Aug 15, 2024
8b78c40
Merge pull request #10713 from kodadot/fix--drops-max-count
preschian Aug 15, 2024
fa5e26a
Merge branch 'main' into feature/drops/shortcut
roiLeo Aug 15, 2024
0b5d87a
Update keyboardShortcutsModal.vue
roiLeo Aug 15, 2024
43d0880
🔧 reviewdog
roiLeo Aug 15, 2024
f1bafc5
🔧 reviewdog
roiLeo Aug 15, 2024
12bd0d8
🔧 mobile collection filter position
roiLeo Aug 15, 2024
dc1cc4c
fix(useProfile.ts): `hasProfile` true when loading
hassnian Aug 15, 2024
5ce7cdf
Merge pull request #10829 from hassnian/issue-landing-profile-modal
vikiival Aug 15, 2024
767a663
Merge pull request #10825 from roiLeo/fix/mobile/collectionFilterPosi…
vikiival Aug 15, 2024
800fcce
Merge pull request #10612 from roiLeo/feature/drops/shortcut
vikiival Aug 15, 2024
01b730e
fix: unified evm avatar
Jarsen136 Aug 15, 2024
38560ca
Merge pull request #10833 from Jarsen136/issue-10821
vikiival Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
7 changes: 2 additions & 5 deletions components/collection/drop/GenerativeLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<CollectionUnlockableCollectionInfo
class="mt-7"
:collection-id="drop?.collection"
:description="description"
:description="drop.collectionDescription"
/>

<hr class="hidden md:block mt-4 mb-0">
Expand Down Expand Up @@ -93,22 +93,19 @@ import type {
Drop } from '@/components/drops/useDrops'
import {
getFormattedDropItem,
useDrop,
} from '@/components/drops/useDrops'
import { useCollectionActivity } from '@/composables/collectionActivity/useCollectionActivity'
import { useCollectionMinimal } from '@/components/collection/utils/useCollectionDetails'
import useCursorDropEvents from '@/composables/party/useCursorDropEvents'
import { DropEventType } from '@/composables/party/types'
import { useCollectionEntity } from '@/composables/drop/useGenerativeDropMint'
import type { DropItem } from '@/params/types'

const mdBreakpoint = 768

const emit = defineEmits(['mint'])

const { drop } = useDrop()
const { drop } = storeToRefs(useDropStore())
const { previewItem, userMintsCount } = storeToRefs(useDropStore())
const { description } = useCollectionEntity()
const { width } = useWindowSize()

const { emitEvent, completeLastEvent } = useCursorDropEvents()
Expand Down
35 changes: 24 additions & 11 deletions components/collection/drop/GenerativePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,23 @@
<div class="mr-4 text-neutral-7">
{{ mintedPercent }}% ~
</div>
<div class="font-bold">
{{ dropStore.mintsCount }}/{{ maxCount }}
<div
v-if="drop.minted >= 0 && drop.max"
class="font-bold"
>
{{ drop.minted }}/{{ drop.max }}
{{ $t('statsOverview.minted') }}
</div>
<div v-else>
<NeoSkeleton width="100" />
</div>
</div>
</div>

<CollectionUnlockableSlider
v-if="drop.max"
class="text-neutral-5 dark:text-neutral-9"
:value="dropStore.mintsCount / maxCount"
:value="drop.minted / drop.max"
/>

<div class="flex mt-6 gap-4 max-md:flex-col">
Expand All @@ -88,18 +95,14 @@
</template>

<script setup lang="ts">
import { NeoButton, NeoIcon } from '@kodadot1/brick'
import { NeoButton, NeoIcon, NeoSkeleton } from '@kodadot1/brick'
import { sanitizeIpfsUrl } from '@/utils/ipfs'
import useGenerativeIframeData from '@/composables/drop/useGenerativeIframeData'
import { useDrop } from '@/components/drops/useDrops'
import useGenerativeDropMint from '@/composables/drop/useGenerativeDropMint'

const { accountId } = useAuth()
const { chainSymbol, decimals } = useChain()
const { drop } = useDrop()
const dropStore = useDropStore()
const { userMintsCount, mintsCount } = storeToRefs(dropStore)
const { maxCount } = useGenerativeDropMint()
const { userMintsCount, drop } = storeToRefs(dropStore)
const { imageDataPayload, imageDataLoaded } = useGenerativeIframeData()
const { formatted: formattedPrice } = useAmount(
computed(() => drop.value.price),
Expand All @@ -121,10 +124,10 @@ const { start: startTimer } = useTimeoutFn(() => {
const generativeImageUrl = ref('')

const mintedPercent = computed(() => {
if (!maxCount.value) {
if (!drop.value.max) {
return 0
}
return Math.round((mintsCount.value / maxCount.value) * 100)
return Math.round((drop.value.minted / drop.value.max) * 100)
})

const displayUrl = computed(() => generativeImageUrl.value || drop.value?.image)
Expand All @@ -148,6 +151,16 @@ const generateNft = () => {
imageDataPayload.value = undefined
}

function bindDropsEvents(event: KeyboardEvent) {
switch (event.key) {
case 'n':
generateNft()
break
}
}

useKeyboardEvents({ v: bindDropsEvents })

watch(imageDataLoaded, () => {
if (imageDataLoaded.value) {
dropStore.setIsCapturingImage(false)
Expand Down
8 changes: 1 addition & 7 deletions components/collection/drop/HolderOfGenerative.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
<script setup lang="ts">
import { NeoModal } from '@kodadot1/brick'
import {
useDrop,
useDropMinimumFunds,
useDropStatus,
} from '@/components/drops/useDrops'
import useGenerativeDropMint, {
useUpdateMetadata,
Expand Down Expand Up @@ -91,14 +89,12 @@ const { openListingCartModal } = useListingCartModal({
const { fetchMultipleBalance } = useMultipleBalance()
const { hasMinimumFunds } = useDropMinimumFunds()

const { drop } = useDrop()
const { subscribeDropStatus } = useDropStatus(drop)
const dropStore = useDropStore()
const { claimedNft, canListMintedNft } = useGenerativeDropMint()
const { availableNfts } = useHolderOfCollection()
const { isAutoTeleportModalOpen } = useAutoTeleportModal()

const { mintingSession, loading, walletConnecting, isCapturingImage }
const { mintingSession, loading, walletConnecting, isCapturingImage, drop }
= storeToRefs(dropStore)

useCursorDropEvents([isTransactionLoading, loading])
Expand Down Expand Up @@ -241,8 +237,6 @@ useTransactionTracker({
watch(txHash, () => {
mintingSession.value.txHash = txHash.value
})

onBeforeMount(subscribeDropStatus)
</script>

<style scoped lang="scss">
Expand Down
15 changes: 8 additions & 7 deletions components/collection/drop/MintButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import { NeoButton } from '@kodadot1/brick'
import useGenerativeDropMint from '@/composables/drop/useGenerativeDropMint'
import { useDropStore } from '@/stores/drop'
import { useDrop, useDropMinimumFunds } from '@/components/drops/useDrops'
import { useDropMinimumFunds } from '@/components/drops/useDrops'
import {
calculateBalanceUsdValue,
formatAmountWithRound,
Expand All @@ -39,10 +39,10 @@ const { isLogIn } = useAuth()
const { chainSymbol, decimals } = useChain()
const dropStore = useDropStore()
const { hasCurrentChainBalance } = useMultipleBalance()
const { drop } = useDrop()
const now = useNow()
const { mintCountAvailable, maxCount } = useGenerativeDropMint()
const { amountToMint, previewItem, userMintsCount } = storeToRefs(dropStore)
const { mintCountAvailable } = useGenerativeDropMint()
const { amountToMint, previewItem, userMintsCount, drop } = storeToRefs(dropStore)

const { hasMinimumFunds } = useDropMinimumFunds()
const { holderOfCollection } = useHolderOfCollection()
const { getWalletVM, getIsWalletVMChain } = storeToRefs(useWalletStore())
Expand All @@ -51,7 +51,8 @@ const priceUsd = ref()
const isHolderAndEligible = computed(
() =>
holderOfCollection.value.isHolder
&& maxCount.value > dropStore.mintsCount
&& drop.value.max
&& drop.value.max > drop.value.minted
&& hasMinimumFunds.value
&& holderOfCollection.value.hasAvailable,
)
Expand All @@ -74,7 +75,7 @@ const mintForLabel = computed(() =>
)

const label = computed(() => {
if (!mintCountAvailable.value) {
if (drop.value.max && (drop.value.max === drop.value.minted)) {
return $i18n.t('mint.unlockable.seeListings')
}
if (!isLogIn.value) {
Expand Down Expand Up @@ -138,7 +139,7 @@ const enabled = computed(() => {
case 'holder':
return isHolderAndEligible.value
case 'paid':
return maxCount.value > userMintsCount.value
return drop.value.max && drop.value.max > userMintsCount.value
default:
return false
}
Expand Down
20 changes: 11 additions & 9 deletions components/collection/drop/MintStepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ const min = computed(() =>
isHolder.value ? Math.min(1, availableNftsAmount.value) : 1,
)

const max = computed(() => {
// tmp remove when uploading to IPFS step can be skipped @see https://github.com/kodadot/nft-gallery/issues/10001#issuecomment-2041533819
const dropMax = DROP_MASSMINT_LIMIT[drop.value.alias] ?? undefined
const max = computed(() => isHolder.value ? availableNftsAmount.value : undefined)

if (isHolder.value) {
return dropMax
? Math.min(dropMax, availableNftsAmount.value)
: availableNftsAmount.value
function bindDropsEvents(event: KeyboardEvent) {
switch (event.key) {
case '-':
amountToMint.value--
break
case '+':
amountToMint.value++
break
}
}

return dropMax
})
useKeyboardEvents({ v: bindDropsEvents })
</script>
7 changes: 1 addition & 6 deletions components/collection/drop/PaidGenerative.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</template>

<script setup lang="ts">
import { useDrop, useDropStatus } from '@/components/drops/useDrops'
import { useUpdateMetadata } from '@/composables/drop/useGenerativeDropMint'
import type { AutoTeleportAction } from '@/composables/autoTeleport/types'
import { ActionlessInteraction } from '@/components/common/autoTeleport/utils'
Expand All @@ -24,8 +23,6 @@ import useAutoTeleportModal from '@/composables/autoTeleport/useAutoTeleportModa
import { NFTs } from '@/composables/transaction/types'
import { openReconnectWalletModal } from '@/components/common/ConnectWallet/openReconnectWalletModal'

const { drop } = useDrop()
const { subscribeDropStatus } = useDropStatus(drop)
const { urlPrefix } = usePrefix()
const { doAfterLogin } = useDoAfterlogin()
const { $i18n, $consola } = useNuxtApp()
Expand All @@ -37,7 +34,7 @@ const { openListingCartModal } = useListingCartModal({
})
const { getWalletVM, getIsWalletVMChain } = storeToRefs(useWalletStore())

const { loading, walletConnecting, mintingSession, isCapturingImage }
const { loading, walletConnecting, mintingSession, isCapturingImage, drop }
= storeToRefs(useDropStore())

const { isAutoTeleportModalOpen } = useAutoTeleportModal()
Expand Down Expand Up @@ -174,8 +171,6 @@ useTransactionTracker({
watch(txHash, () => {
mintingSession.value.txHash = txHash.value
})

onBeforeMount(subscribeDropStatus)
</script>

<style scoped lang="scss">
Expand Down
3 changes: 2 additions & 1 deletion components/common/ConnectWallet/ConnectEvm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@

<script lang="ts" setup>
import { NeoButton, NeoIcon } from '@kodadot1/brick'
import { useAccount } from '@wagmi/vue'

const emits = defineEmits(['select'])

const { address, isConnected, isConnecting, chainId } = useWagmi()
const { address, isConnected, isConnecting, chainId } = useAccount()
const { urlPrefix, setUrlPrefix } = usePrefix()
const { modal } = useWeb3Modal()

Expand Down
Loading
Loading