Skip to content

Commit

Permalink
Merge branch 'main' into neomodalextend-tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
roiLeo authored Dec 14, 2023
2 parents c94b8e4 + 68c22ac commit e2cc365
Show file tree
Hide file tree
Showing 35 changed files with 413 additions and 188 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>
9 changes: 9 additions & 0 deletions components/collection/CollectionInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
<IdentityIndex ref="identity" :address="address" show-clipboard />
</nuxt-link>
</div>
<div v-if="recipient" class="is-flex mb-2">
<div class="mr-2 is-capitalized">{{ $t('royalty') }}</div>
<nuxt-link :to="`/${urlPrefix}/u/${recipient}`" class="has-text-link">
<IdentityIndex ref="identity" :address="recipient" show-clipboard />
</nuxt-link>
&nbsp;({{ royalty }}%)
</div>
<div class="overflow-wrap">
<Markdown
:source="visibleDescription"
Expand Down Expand Up @@ -83,6 +90,8 @@ const chain = computed(
?.text,
)
const address = computed(() => collectionInfo.value?.currentOwner)
const recipient = computed(() => collectionInfo.value?.recipient)
const royalty = computed(() => collectionInfo.value?.royalty)
const seeAllDescription = ref(false)
const DESCRIPTION_MAX_LENGTH = 210
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
rounded
:tag="NuxtLink"
:to="`/${urlPrefix}/collection/${collectionId}`"
target="_blank"
icon="arrow-right">
<span>View Collection</span>
</NeoButton>
Expand Down
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
6 changes: 5 additions & 1 deletion components/collection/utils/useCollectionDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ export function useCollectionSoldData({ address, collectionId }) {
}

export const useCollectionMinimal = ({ collectionId }) => {
const { urlPrefix } = usePrefix()
const { isAssetHub } = useIsChain(urlPrefix)
const collection = ref()
const { data } = useGraphql({
queryName: 'collectionByIdMinimal',
queryName: isAssetHub.value
? 'collectionByIdMinimalWithRoyalty'
: 'collectionByIdMinimal',
variables: {
id: collectionId,
},
Expand Down
4 changes: 2 additions & 2 deletions components/common/ConnectWallet/WalletAssetMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
:data-testid="`sidebar-language-${lang.value}`"
:value="lang.value"
:class="{ 'is-active': $i18n.locale === lang.value }"
@click="$i18n.locale = lang.value">
@click="setUserLocale(lang.value)">
<span>{{ lang.flag }} {{ lang.label }}</span>
</NeoDropdownItem>
</NeoDropdown>
Expand All @@ -63,7 +63,7 @@

<script setup lang="ts">
import { NeoDropdown, NeoDropdownItem, NeoIcon } from '@kodadot1/brick'
import { langsFlags } from '@/utils/config/i18n'
import { langsFlags, setUserLocale } from '@/utils/config/i18n'
const { urlPrefix } = usePrefix()
const { isBasilisk } = useIsChain(urlPrefix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<p v-if="Number(props.row.meta)">
{{ formatPrice(props.row.meta)[0] }}
<span class="has-text-grey">
(${{ formatPrice(props.row.meta)[1] }})</span
${{ formatPrice(props.row.meta)[1] }}</span
>
</p>
</NeoTableColumn>
Expand Down
4 changes: 2 additions & 2 deletions components/navbar/MobileLanguageOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
</template>

<script lang="ts" setup>
import { langsFlags } from '@/utils/config/i18n'
import { langsFlags, setUserLocale } from '@/utils/config/i18n'
const { $i18n } = useNuxtApp()
const emit = defineEmits(['closeLanguageOption', 'closeMobileSubMenu'])
const setUserLang = (value: string) => {
$i18n.locale.value = value
setUserLocale(value)
emit('closeLanguageOption')
emit('closeMobileSubMenu')
}
Expand Down
7 changes: 5 additions & 2 deletions components/navbar/ProfileDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
aria-role="listitem"
:value="lang.value"
:class="{ 'is-active': $i18n.locale === lang.value }"
@click="$i18n.locale = lang.value">
@click="setUserLocale(lang.value)">
<span>{{ lang.flag }} {{ lang.label }}</span>
</NeoDropdownItem>
</NeoDropdown>
Expand All @@ -70,7 +70,10 @@
import { NeoDropdown, NeoDropdownItem, NeoIcon } from '@kodadot1/brick'
import Avatar from '@/components/shared/Avatar.vue'
import { useIdentityStore } from '@/stores/identity'
import { langsFlags as langsFlagsList } from '@/utils/config/i18n'
import {
langsFlags as langsFlagsList,
setUserLocale,
} from '@/utils/config/i18n'
import { ConnectWalletModalConfig } from '@/components/common/ConnectWallet/useConnectWallet'
import ConnectWalletButton from '@/components/shared/ConnectWalletButton.vue'
Expand Down
36 changes: 36 additions & 0 deletions components/teleport/Teleport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@
>
</div>

<a
v-if="insufficientExistentialDeposit"
v-safe-href="
`https://support.polkadot.network/support/solutions/articles/65000168651-what-is-the-existential-deposit`
"
target="_blank"
class="has-text-danger">
{{
$t('teleport.insufficientExistentialDeposit', [
targetExistentialDepositAmount,
currency,
])
}}
</a>

<NeoButton
:label="teleportLabel"
size="large"
Expand Down Expand Up @@ -146,6 +161,7 @@ import { NeoButton, NeoField } from '@kodadot1/brick'
import { blockExplorerOf } from '@/utils/config/chain.config'
import { simpleDivision } from '@/utils/balance'
import { useFiatStore } from '@/stores/fiat'
import { existentialDeposit } from '@kodadot1/static'
const {
chainBalances,
Expand Down Expand Up @@ -176,6 +192,12 @@ const nativeAmount = computed(() =>
Math.floor(amount.value * Math.pow(10, currentTokenDecimals.value)),
)
const targetExistentialDepositAmount = computed(() =>
Number(
targetExistentialDeposit.value / Math.pow(10, targetTokenDecimals.value),
),
)
const amountToTeleport = computed(() =>
Math.max(nativeAmount.value - teleportFee.value, 0),
)
Expand All @@ -186,6 +208,18 @@ const recieveAmount = computed(() =>
formatBalance(amountToTeleport.value, currentTokenDecimals.value, false),
)
const targetExistentialDeposit = computed(
() => existentialDeposit[chainToPrefixMap[toChain.value]],
)
const insufficientExistentialDeposit = computed(() => {
return Boolean(
targetExistentialDeposit.value &&
amountToTeleport.value &&
targetExistentialDeposit.value > amountToTeleport.value,
)
})
const teleportLabel = computed(() => {
if (insufficientBalance.value) {
return $i18n.t('teleport.insufficientBalance', [currency])
Expand Down Expand Up @@ -289,6 +323,8 @@ const currentTokenDecimals = computed(() =>
getChainTokenDecimals(fromChain.value),
)
const targetTokenDecimals = computed(() => getChainTokenDecimals(toChain.value))
const toChainLabel = computed(() =>
getChainName(chainToPrefixMap[toChain.value]),
)
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
9 changes: 9 additions & 0 deletions libs/static/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,12 @@ export const chainList = (): Option[] => {
value: prefix,
}))
}

export const existentialDeposit: Record<Prefix, number> = {
ksm: 333333333,
rmrk: 333333333,
ahk: 33333333,
dot: 10000000000,
ahp: 1000000000,
bsx: 1000000000000,
}
16 changes: 9 additions & 7 deletions libs/ui/src/components/MediaItem/type/ImageMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
:image-component-props="imageComponentProps"
:src="src"
:alt="alt"
class="block rounded-none"
:class="{
'object-cover absolute inset-0 w-full h-full':
!original && !isFullscreen,
}"
:class="className"
data-testid="type-image"
@error.once="() => onError('error-1')" />
<!-- if fail, try to load original url -->
Expand All @@ -24,15 +20,15 @@
v-if="status === 'error-1'"
:src="src"
:alt="alt"
class="is-block image-media__image no-border-radius"
:class="className"
data-testid="type-image"
@error.once="() => onError('error-2')" />
<!-- else, load placeholder -->
<img
v-if="status === 'error-2'"
:src="placeholder"
:alt="alt"
class="is-block image-media__image no-border-radius"
:class="className"
data-testid="type-image" />
</figure>
</template>
Expand Down Expand Up @@ -73,6 +69,12 @@ type Status = 'ok' | 'error-1' | 'error-2'
const status = ref<Status>('ok')
const isGif = computed(() => props.mimeType === 'image/gif')
const className = computed(() =>
!props.original && !props.isFullscreen
? 'object-cover absolute inset-0 w-full h-full'
: 'block rounded-none',
)
const toOriginalContentUrl = (baseurl: string) => {
const url = new URL(baseurl)
url.searchParams.append('original', 'true')
Expand Down
Loading

0 comments on commit e2cc365

Please sign in to comment.