Skip to content

Commit

Permalink
Merge branch 'main' into neostickymodal-tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo authored Dec 14, 2023
2 parents 6021e11 + ae92eb0 commit d997c1b
Show file tree
Hide file tree
Showing 20 changed files with 315 additions and 115 deletions.
5 changes: 3 additions & 2 deletions components/MessageNotify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const realworldFullPath = computed(() => {
&--toast {
z-index: 100;
position: fixed;
border-radius: 0;
border-radius: 0 !important;
top: 100px;
right: 0;
margin-left: auto;
Expand All @@ -73,7 +73,8 @@ const realworldFullPath = computed(() => {
}
.message-body {
border: none;
border-left-width: 0;
border-radius: 0;
}
.congrats-message {
Expand Down
5 changes: 3 additions & 2 deletions components/carousel/CarouselTypeGenerative.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
</template>

<script lang="ts" setup>
import { AHK_GENERATIVE_DROPS, AHP_GENERATIVE_DROPS } from '@/utils/drop'
import { useCarouselGenerativeNftEvents } from './utils/useCarouselEvents'
const { nfts, ids } = await useCarouselGenerativeNftEvents(
['176'],
['38', '40', '46', '49', '50'],
AHK_GENERATIVE_DROPS,
AHP_GENERATIVE_DROPS,
)
</script>
69 changes: 47 additions & 22 deletions components/collection/drop/modal/DropConfirmModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
content-class="modal-width"
@close="onClose">
<ModalBody :title="title" @close="onClose">
<transition name="fade">
<EmailSignup v-if="needsEmail" @confirm="handleEmailSignupConfirm" />
<EmailSignup
v-if="isEmailSignupStep"
@confirm="handleEmailSignupConfirm" />

<ClaimingDrop v-else-if="claimingDrop" :est="displayDuration" />
<ClaimingDrop v-else-if="isClaimingDropStep" :est="displayDuration" />

<SuccessfulDrop
v-else-if="successfulDrop && sanitizedMintedNft"
:minted-nft="sanitizedMintedNft"
:can-list-nft="canListNft"
@list="$emit('list')" />
</transition>
<SuccessfulDrop
v-else-if="isSuccessfulDropStep"
:minted-nft="sanitizedMintedNft"
:can-list-nft="canListNft"
@list="$emit('list')" />
</ModalBody>
</NeoModal>
</template>
Expand All @@ -34,6 +34,12 @@ import {
useCountDown,
} from '@/components/collection/unlockable/utils/useCountDown'
enum ModalStep {
EMAIL = 'email',
CLAIMING = 'claiming',
SUCCEEDED = 'succeded',
}
const emit = defineEmits(['confirm', 'completed', 'close', 'list'])
const props = defineProps<{
modelValue: boolean
Expand All @@ -51,13 +57,10 @@ const { $i18n } = useNuxtApp()
const isModalActive = useVModel(props, 'modelValue')
const modalStep = ref<ModalStep>(ModalStep.EMAIL)
const email = ref<string>()
const nftCoverLoaded = ref(false)
const successfulDrop = computed(() => Boolean(sanitizedMintedNft.value))
const claimingDrop = computed(() =>
nftCoverLoaded.value ? false : distance.value > 0,
)
const retry = ref(3)
const sanitizedMintedNft = computed<DropMintedNft | undefined>(
() =>
Expand All @@ -67,16 +70,24 @@ const sanitizedMintedNft = computed<DropMintedNft | undefined>(
},
)
const needsEmail = computed(
() => !email.value && !claimingDrop.value && !successfulDrop.value,
)
const isEmailSignupStep = computed(() => modalStep.value === 'email')
const isClaimingDropStep = computed(() => modalStep.value === 'claiming')
const isSuccessfulDropStep = computed(() => modalStep.value === 'succeded')
const moveSuccessfulDrop = computed(() => {
if (nftCoverLoaded.value) {
return true
}
return distance.value <= 0 && sanitizedMintedNft.value && retry.value === 0
})
const title = computed(() => {
if (needsEmail.value) {
if (isEmailSignupStep.value) {
return $i18n.t('drops.finalizeClaimNow')
}
if (claimingDrop.value) {
if (isClaimingDropStep.value) {
return $i18n.t('drops.claimingDrop')
}
Expand Down Expand Up @@ -106,9 +117,23 @@ watch(
},
)
watch(sanitizedMintedNft, async (mintedNft) => {
if (mintedNft?.image) {
nftCoverLoaded.value = await preloadImage(mintedNft.image)
watch([sanitizedMintedNft, retry], async ([mintedNft]) => {
if (mintedNft?.image && retry.value) {
try {
nftCoverLoaded.value = await preloadImage(mintedNft.image)
} catch (error) {
retry.value -= 1
}
}
})
watchEffect(() => {
if (props.claiming && isEmailSignupStep.value) {
modalStep.value = ModalStep.CLAIMING
} else if (moveSuccessfulDrop.value && isClaimingDropStep.value) {
modalStep.value = ModalStep.SUCCEEDED
} else if (!props.modelValue && isSuccessfulDropStep.value) {
modalStep.value = ModalStep.EMAIL
}
})
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
alt="unlockable icon" />
<span>{{ $t('mint.unlockable.mintLive') }}</span>
</div>
<nuxt-link class="has-text-weight-bold" to="/ahp/drops/wallstreet">
<nuxt-link class="has-text-weight-bold" :to="DEFAULT_DROP">
{{ $t('mint.unlockable.takeMe') }}
</nuxt-link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/collection/unlockable/UnlockableLandingTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="separator mx-2" />
<nuxt-link
class="is-flex is-align-items-center has-text-weight-bold my-2"
to="/ahp/drops/wallstreet">
:to="DEFAULT_DROP">
{{ $t('mint.unlockable.takeMe') }}
</nuxt-link>
</div>
Expand Down
1 change: 0 additions & 1 deletion components/common/shoppingCart/ShoppingCartModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
data-testid="shopping-cart-modal-container">
<NeoModalHead
:title="$t('shoppingCart.title')"
data-testid="shopping-cart-modal"
@close="closeShoppingCart(ModalCloseType.BACK)" />
<div
v-if="numberOfItems"
Expand Down
4 changes: 3 additions & 1 deletion components/items/ItemsGrid/ItemsGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
v-if="total !== 0 && (!isLoading || !isFetchingData)"
:id="scrollContainerId"
v-slot="slotProps"
:mobile-cols="2"
class="my-5">
<div
v-for="(entity, index) in items"
Expand Down Expand Up @@ -53,7 +54,8 @@
<!-- skeleton on first load -->
<DynamicGrid
v-if="total === 0 && (isLoading || isFetchingData)"
class="my-5">
class="my-5"
:mobile-cols="2">
<NeoNftCardSkeleton
v-for="n in skeletonCount"
:key="n"
Expand Down
2 changes: 1 addition & 1 deletion components/profile/activityTab/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<div v-if="!desktop" class="is-flex is-justify-content-flex-end my-5">
<Pagination
v-model="currentPage"
:value="currentPage"
:total="total"
:per-page="itemsPerPage"
:range-before="2"
Expand Down
4 changes: 3 additions & 1 deletion components/shared/DynamicGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const props = withDefaults(
}
gridSize?: 'small' | 'medium' | 'large'
mobileVariant?: boolean
mobileCols?: number
}>(),
{
defaultWidth: () => ({
Expand All @@ -25,6 +26,7 @@ const props = withDefaults(
large: 16 * 20, // 20rem
}),
mobileVariant: true,
mobileCols: 1,
},
)
Expand All @@ -45,7 +47,7 @@ const updateColumns = () => {
containerWidth.value / props.defaultWidth[grid.value],
)
cols.value = isMobileVariant.value ? 1 : getCols
cols.value = isMobileVariant.value ? props.mobileCols : getCols
}
}
Expand Down
6 changes: 1 addition & 5 deletions composables/popularCollections/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export const POPULAR_COLLECTIONS = {
'u-31848', // Ajuna Network Promo Collection
],
ahp: [
'50', // .motherboard
'49', // wallstreet
'46', // Snowflakes
'40', // Swirls
'38', // Generativ Art - Pare1d0scope
...AHP_POPULAR_DROP_COLLECTIONS,
'10', // Kodachain - Berlin Onchain Exhibition
'11', // Kodachain - Sub0 Opening Party 2023
'13', // The sub0 2023 Biodiversity Collection
Expand Down
Loading

0 comments on commit d997c1b

Please sign in to comment.