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

➖ remove b-image component #5854

Merged
merged 26 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cf408d0
➖ remove b-image component
roiLeo May 3, 2023
4cbcee2
➖ remove b-image component
roiLeo May 3, 2023
6f1458f
🔧 BasicImage
roiLeo May 3, 2023
cdbeb4e
🔧 BasicImage image-wrapper
roiLeo May 3, 2023
899268d
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 4, 2023
16aad3a
🔧 image wrapper
roiLeo May 4, 2023
4c9b1cc
🔧 image wrapper
roiLeo May 5, 2023
450ff02
Update components/shared/view/BasicImage.vue
roiLeo May 5, 2023
8758021
Update components/series/SeriesTable.vue
roiLeo May 5, 2023
2482878
Merge branch 'main' into chore/Buefy/b-image
vikiival May 6, 2023
62bae2a
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 10, 2023
1d9fa47
🔧 iT wOrK On mY ScrEen
roiLeo May 10, 2023
c4ab509
Merge branch 'feat/pnpm-8-' into chore/Buefy/b-image
roiLeo May 12, 2023
4f5c597
🔧 isLoadingMeta ref
roiLeo May 12, 2023
d2abda2
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 12, 2023
39c3c2a
🔧 BasicImage fit
roiLeo May 12, 2023
5f913dc
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 12, 2023
091938b
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 13, 2023
c5fb50b
🔧 wallet Image
roiLeo May 13, 2023
8e35470
➖ remove unused component
roiLeo May 15, 2023
cf528b5
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 15, 2023
68cd2a7
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 17, 2023
97a0fa3
🔧 CollectionCard
roiLeo May 17, 2023
111fdf9
Merge branch 'main' into chore/Buefy/b-image
vikiival May 21, 2023
306e762
🔧 ???
roiLeo May 22, 2023
9d38e10
Merge branch 'main' into chore/Buefy/b-image
roiLeo May 24, 2023
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
25 changes: 15 additions & 10 deletions components/collection/CollectionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
<nuxt-link
v-if="!isLoading && collection"
:to="`/${urlPrefix}/collection/${collection.id}`">
<BasicImage
:src="image"
:alt="collection.name"
custom-class="collection-card__image-wrapper" />

<CollectionDetail
:nfts="collection.nfts || []"
:name="collection.name || ''"
:image="image" />
<template v-if="!isLoadingMeta">
<BasicImage
:src="image"
:alt="collection.name"
custom-class="collection-card__image-wrapper" />

<CollectionDetail
:nfts="collection.nfts || []"
:name="collection.name || ''"
:image="image" />
</template>
</nuxt-link>

<template v-else>
<NeoSkeleton no-margin :rounded="false" height="112px" />
<CollectionDetail :is-loading="true" :nfts="[]" name="" />
<CollectionDetail is-loading :nfts="[]" name="" />
</template>
</div>
</template>
Expand All @@ -32,6 +34,7 @@ import CollectionDetail from './CollectionDetail.vue'
import type { Metadata } from '@/components/rmrk/service/scheme'

const { urlPrefix } = usePrefix()
const isLoadingMeta = ref(false)

interface Props {
isLoading?: boolean
Expand All @@ -46,11 +49,13 @@ onMounted(async () => {
return
}

isLoadingMeta.value = true
const metadata = (await processSingleMetadata(
props.collection.metadata
)) as Metadata
image.value = sanitizeIpfsUrl(
metadata.image || metadata.thumbnailUri || metadata.mediaUri || ''
)
isLoadingMeta.value = false
})
</script>
7 changes: 4 additions & 3 deletions components/common/ConnectWallet/WalletMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
<div
class="is-flex is-justify-content-space-between is-align-items-center">
<span>
<b-image
<img
:src="wallet.img"
class="is-32x32 is-inline-block"
style="vertical-align: middle"></b-image>
:alt="wallet.extensionName"
width="32"
style="vertical-align: middle" />
<span class="is-size-6 ml-2 is-capitalized">{{ wallet.name }}</span>
</span>

Expand Down
18 changes: 5 additions & 13 deletions components/generative/CongratsView.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<template>
<section>
<br />
<p class="title is-size-3">Waii you made it! ✨</p>
<p class="title is-size-4">Your NFT should be ready in 1 minute</p>
<nuxt-link class="is-size-4 link" :to="`/bsx/collection/${collectionId}`">
In the meanwhile, click here to check the collection ♥️🍷
</nuxt-link>
<b-image
<BasicImage
src="https://imagedelivery.net/jk5b6spi_m_-9qC4VTnjpg/bafybeifp6l3kqvimdnzymgitv4q67ryodvymx6keihdmudx6vv3syqz2ku/aaa" />
<br />
<SubmitButton
class="py-2"
icon="sync"
type="is-success"
label="Start over"
Expand All @@ -20,17 +19,10 @@

<script setup lang="ts">
import { COLLECTION_ID } from './promptBuilder'
import BasicImage from '@/components/shared/view/BasicImage.vue'
import SubmitButton from '@/components/base/SubmitButton.vue'

const SubmitButton = defineAsyncComponent(
() => import('@/components/base/SubmitButton.vue')
)

const { urlPrefix } = usePrefix()
const collectionId = COLLECTION_ID

const emit = defineEmits(['select'])

const submit = () => {
emit('select')
}
const submit = () => emit('select')
</script>
9 changes: 2 additions & 7 deletions components/series/SeriesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@
header-class="front-stack-layer"
cell-class="is-vcentered">
<div class="image is-48x48 mb-2">
<b-image
v-if="!isLoading"
:src="props.row.image"
:alt="props.row.name"
ratio="1by1"
rounded />
<NeoSkeleton :active="isLoading" circle width="48px" height="48px" />
<BasicImage :src="props.row.image" :alt="props.row.name" rounded />
</div>
</b-table-column>

Expand Down Expand Up @@ -330,6 +324,7 @@ const components = {
Identity: () => import('@/components/identity/IdentityIndex.vue'),
Money: () => import('@/components/shared/format/Money.vue'),
Loader: () => import('@/components/shared/Loader.vue'),
BasicImage: () => import('@/components/shared/view/BasicImage.vue'),
}

@Component({ components })
Expand Down
67 changes: 46 additions & 21 deletions components/shared/view/BasicImage.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,57 @@
<template>
<b-image
:src="src || placeholder"
:src-fallback="placeholder"
:alt="alt"
ratio="1by1"
:class="customClass"
:rounded="rounded"
data-cy="type-image"
@error="onImageError">
<template #placeholder>
<NeoSkeleton full-size no-margin :circle="rounded" />
</template>
</b-image>
<figure class="image-wrapper image is-1by1" :class="customClass">
vikiival marked this conversation as resolved.
Show resolved Hide resolved
<transition name="fade">
<img
:src="imageSrc || placeholder"
:alt="alt"
:class="['has-ratio', { 'is-rounded': rounded }]"
@load="onImageLoad"
@error="onImageError" />
</transition>
<transition name="fade">
<slot v-if="!loaded" name="placeholder">
<NeoSkeleton full-size no-margin :circle="rounded" />
</slot>
</transition>
</figure>
</template>

<script lang="ts" setup>
import { NeoSkeleton } from '@kodadot1/brick'

const { $consola } = useNuxtApp()
const { placeholder } = useTheme()
defineProps({
src: { type: String, default: '' },
alt: { type: String, default: 'KodaDot NFT minted multimedia' },
customClass: { type: String, default: '' },
rounded: Boolean,
})
const props = withDefaults(
defineProps<{
src: string
alt?: string
customClass?: string
rounded?: boolean
}>(),
{
src: '',
alt: '',
customClass: '',
}
)

function onImageError(ev: Event, src: string) {
$consola.error('[BasicImage] to load:', src, ev)
const imageSrc = ref(props.src)
const loaded = ref(false)

const onImageLoad = () => {
loaded.value = true
roiLeo marked this conversation as resolved.
Show resolved Hide resolved
}
const onImageError = (ev: Event) => {
$consola.error('[BasicImage] to load:', props.src, ev)
imageSrc.value = placeholder.value
}
</script>

<style lang="scss" scoped>
.image-wrapper {
padding-top: 100%;
img {
object-fit: cover;
}
}
</style>
8 changes: 4 additions & 4 deletions components/shared/view/SelectableImage.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<b-image
ratio="1by1"
class="image"
<BasicImage
:class="[
disabled ? 'selectable-image-disabled' : 'selectable-image',
{ 'is-selected': selected },
]"
:src="src"
alt="Some Image"
@click.native="handleClick"></b-image>
@click.native="handleClick" />
</template>

<script setup lang="ts">
import BasicImage from '@/components/shared/view/BasicImage.vue'

const props = defineProps<{
src: string
index: number
Expand Down
8 changes: 2 additions & 6 deletions components/unique/Collection/Item/CollectionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
<div class="columns is-centered">
<div class="column is-half has-text-centered">
<div class="container image is-128x128 mb-2">
<b-image
v-if="!isLoading"
:src="image"
:alt="name"
ratio="1by1"
rounded></b-image>
<BasicImage v-if="!isLoading" :src="image" :alt="name" rounded />
vikiival marked this conversation as resolved.
Show resolved Hide resolved
</div>
<h1 class="title is-2">
{{ name }}
Expand Down Expand Up @@ -101,6 +96,7 @@ import UseApiMixin from '@/utils/mixins/useApiMixin'
import { tokenIdToRoute } from '../../utils'

const components = {
BasicImage: () => import('@/components/shared/view/BasicImage.vue'),
GalleryCardList: () =>
import('@/components/rmrk/Gallery/GalleryCardList.vue'),
Sharing: () => import('@/components/shared/Sharing.vue'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<ModalWrapper icon="paper-plane" title="Transfer collection" isRight>
<template v-slot:default>
<ModalWrapper icon="paper-plane" title="Transfer collection" is-right>
<template #default>
<Loader v-model="isLoading" :status="status" />
<b-field>
<Auth />
Expand All @@ -27,7 +27,7 @@
<script lang="ts">
import MetaTransactionMixin from '@/utils/mixins/metaMixin'
import { isAddress } from '@polkadot/util-crypto'
import { Component, mixins, Prop } from 'nuxt-property-decorator'
import { Component, Prop, mixins } from 'nuxt-property-decorator'
import { showNotification } from '@/utils/notification'

const components = {
Expand Down
8 changes: 4 additions & 4 deletions components/unique/Gallery/Item/DangerModal.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<ModalWrapper icon="trash" :title="title" isRight>
<template v-slot:default>
<ModalWrapper icon="trash" :title="title" is-right>
<template #default>
<Loader v-model="isLoading" :status="status" />
<div class="buttons">
<b-button type="is-danger" expanded outlined @click="clearMeta"
Expand All @@ -10,8 +10,8 @@
type="is-danger"
expanded
outlined
@click="clearAttrs"
:disabled="!hasAttributes"
@click="clearAttrs"
>Remove ALL attributes</b-button
>
</div>
Expand All @@ -22,7 +22,7 @@
<script lang="ts">
import { emptyArray } from '@/utils/empty'
import MetaTransactionMixin from '@/utils/mixins/metaMixin'
import { Component, mixins, Prop, Watch } from 'nuxt-property-decorator'
import { Component, Prop, Watch, mixins } from 'nuxt-property-decorator'
import { showNotification } from '~/utils/notification'
import { Attribute } from '../../types'

Expand Down
1 change: 0 additions & 1 deletion components/unique/graphqlResponseTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ export type NFTEntitiesWithCount<T> = {
export type WithData<T> = {
data: T
}