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

fix: Drop page does not work on mobile #10570

Merged
merged 3 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 13 additions & 6 deletions components/collection/drop/GenerativePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
<div
data-partykit="generative-preview-card"
class="border bg-background-color shadow-primary p-5 pb-6 w-full h-min md:w-[444px] lg:w-[490px] relative">
<BaseMediaItem
:src="sanitizeIpfsUrl(displayUrl)"
:mime-type="generativeImageUrl ? 'text/html' : ''"
preview
is-detail
class="border" />
<div class="relative">
<BaseMediaItem
:src="sanitizeIpfsUrl(displayUrl)"
:mime-type="generativeImageUrl ? 'text/html' : ''"
:class="{ 'opacity-0': !imageDataLoaded }"
class="border"
preview
is-detail />
<SkeletonLoader
v-if="!imageDataLoaded"
:title="$t('drops.loadingGenerativeArt')"
class="!absolute w-full top-0" />
</div>

<NeoButton
v-if="dropStore.isCapturingImage"
Expand Down
10 changes: 7 additions & 3 deletions components/shared/SkeletonLoader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ const calculateTextContainerWidth = () => {

nextTick(() => {
const title = titleRef.value?.clientWidth || 0
const subtitle =
(subtitleRef.value?.clientWidth || 0) + DOTS_PLUS_MARGIN_WIDTH
textContainerWidth.value = subtitle > title ? `${subtitle}px` : undefined
const substitle = subtitleRef.value?.clientWidth || 0
const subtitlePlusDots = substitle + DOTS_PLUS_MARGIN_WIDTH

textContainerWidth.value =
substitle && subtitlePlusDots > title
? `${subtitlePlusDots}px`
: undefined
})
}

Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,8 @@
"phases": {
"private": "Allowlist",
"public": "Public Mint"
}
},
"loadingGenerativeArt": "Loading Generative Art"
},
"confirmPurchase": {
"action": "Confirm Purchase",
Expand Down
Loading