-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Colection required amount #6849
Changes from 9 commits
bc7e1ba
46d6519
4d63931
d92c4ef
5156e82
46bf2c6
21ef9eb
e7f0415
46f4e37
2032938
62b18a1
c75c659
7d33ec8
d5ff609
b713ced
ac607af
a29c5a4
12f1a84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -38,15 +38,26 @@ | |||||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
<template #footer> | ||||||||||||||||||||||||||||
<NeoField | ||||||||||||||||||||||||||||
v-if="isLogIn" | ||||||||||||||||||||||||||||
variant="danger" | ||||||||||||||||||||||||||||
:message="balanceNotEnoughMessage"> | ||||||||||||||||||||||||||||
<NeoField v-if="isLogIn"> | ||||||||||||||||||||||||||||
<SubmitButton | ||||||||||||||||||||||||||||
expanded | ||||||||||||||||||||||||||||
label="create collection" | ||||||||||||||||||||||||||||
:label="balanceNotEnough ? 'not enough funds' : 'create collection'" | ||||||||||||||||||||||||||||
Jarsen136 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
:loading="isLoading" | ||||||||||||||||||||||||||||
disabled-icon | ||||||||||||||||||||||||||||
variant="k-accent" | ||||||||||||||||||||||||||||
:disabled="balanceNotEnough" | ||||||||||||||||||||||||||||
@click="submit" /> | ||||||||||||||||||||||||||||
<template #message> | ||||||||||||||||||||||||||||
{{ $t('tooltip.deposit1') }} | ||||||||||||||||||||||||||||
<strong>{{ COLLECTION_DEPOSIT }} KSM</strong> | ||||||||||||||||||||||||||||
pbkompasz marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
{{ $t('tooltip.deposit2') }} | ||||||||||||||||||||||||||||
<a | ||||||||||||||||||||||||||||
v-safe-href=" | ||||||||||||||||||||||||||||
'https://hello.kodadot.xyz/multi-chain/fees/assethub-fees#polkadot-asset-hub-fees-prev.-statemint' | ||||||||||||||||||||||||||||
" | ||||||||||||||||||||||||||||
>Learn more</a | ||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
missing translation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where should the 'Learn more' link to for /bsx? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depends on the chain ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, maybe bsx & snek has the same, I think it can be fetched through polkadot api package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The values should be fetched from the API or kept in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I use this?
|
||||||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||||||
</NeoField> | ||||||||||||||||||||||||||||
</template> | ||||||||||||||||||||||||||||
</BaseCollectionForm> | ||||||||||||||||||||||||||||
|
@@ -65,6 +76,7 @@ import SubmitButton from '@/components/base/SubmitButton.vue' | |||||||||||||||||||||||||||
import { NeoField, NeoInput } from '@kodadot1/brick' | ||||||||||||||||||||||||||||
import { BaseCollectionType } from '@/composables/transaction/types' | ||||||||||||||||||||||||||||
import useLoader from '@/composables/useLoader' | ||||||||||||||||||||||||||||
import { COLLECTION_DEPOSIT } from '@/utils/constants' | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
interface ComponentWithCheckValidity extends Vue { | ||||||||||||||||||||||||||||
checkValidity(): boolean | ||||||||||||||||||||||||||||
|
@@ -83,7 +95,6 @@ const symbolInput = ref<ComponentWithCheckValidity>() | |||||||||||||||||||||||||||
const { accountId, balance, isLogIn } = useAuth() | ||||||||||||||||||||||||||||
const { isLoading, status } = useLoader() | ||||||||||||||||||||||||||||
const emit = defineEmits(['created']) | ||||||||||||||||||||||||||||
const { $i18n } = useNuxtApp() | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const checkValidity = () => { | ||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||
|
@@ -93,9 +104,8 @@ const checkValidity = () => { | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const rmrkId = computed(() => generateId(accountId.value, symbol.value)) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
const balanceNotEnough = computed(() => Number(balance.value) <= 2) | ||||||||||||||||||||||||||||
const balanceNotEnoughMessage = computed(() => | ||||||||||||||||||||||||||||
balanceNotEnough.value ? $i18n.t('tooltip.notEnoughBalance') : '' | ||||||||||||||||||||||||||||
const balanceNotEnough = computed( | ||||||||||||||||||||||||||||
() => Number(balance.value) <= COLLECTION_DEPOSIT | ||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||
const isMintDisabled = computed(() => balanceNotEnough.value) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
@@ -154,3 +164,15 @@ const submit = async () => { | |||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
</script> | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
<style lang="scss" scoped> | ||||||||||||||||||||||||||||
@import '@/styles/abstracts/variables'; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
a { | ||||||||||||||||||||||||||||
@include ktheme() { | ||||||||||||||||||||||||||||
color: theme('k-blue') !important; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
text-decoration: underline; | ||||||||||||||||||||||||||||
white-space: nowrap; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm... even on scoped component this can be smelly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is styling directly the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes there could be side effects If we'll use another a tag on this component |
||||||||||||||||||||||||||||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
"facts": "Facts", | ||
"computed id": "Computed id", | ||
"create collection": "Create Collection", | ||
"not enough funds": "Not Enough Funds", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate of |
||
"Select collection where do you want mint your token": "Select collection where do you want mint your token", | ||
"Maximum NFTs in collection": "Maximum NFTs in collection", | ||
"name": "Name", | ||
|
@@ -538,7 +539,9 @@ | |
"smallDisplay": "Small Display", | ||
"largeDisplay": "Large Display", | ||
"emptyAddress": "Receiver address cannot be empty", | ||
"emptyListAmount": "Amount should be greater than 0" | ||
"emptyListAmount": "Amount should be greater than 0", | ||
"deposit1": "A deposit of", | ||
"deposit2": "is required to create a collection. Please note, this initial deposit is refundable." | ||
pbkompasz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
"nft": { | ||
"carbonless": "This NFT is carbonless", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't you just check if there is
icon
prop behing passed?something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't work because it has a default value (
paper-plane
). Should I remove the default value, but that might break functionality on other pages.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'll keep this icon on all submit button in app, might be time to remove it.