diff --git a/components/common/EditNftModal.vue b/components/common/EditNftModal.vue index 7bd0d1a324..470521dfa7 100644 --- a/components/common/EditNftModal.vue +++ b/components/common/EditNftModal.vue @@ -16,10 +16,15 @@ :label="$t('mint.nft.art.label')" required > - + + + @@ -28,11 +33,16 @@ required :error="!name" > - + + + @@ -91,17 +101,24 @@ const image = ref() const imageUrl = ref() const attributes = ref([]) +const originalImageUrl = computed(() => sanitizeIpfsUrl(props.metadata?.image)) + +const nameChanged = computed(() => props.metadata?.name !== name.value) +const imageChanged = computed(() => originalImageUrl.value !== imageUrl.value) + +const initImage = () => { + imageUrl.value = originalImageUrl.value + image.value = undefined +} + const disabled = computed(() => { const hasImage = Boolean(imageUrl.value) const isNameFilled = Boolean(name.value) - - const nameChanged = props.metadata?.name !== name.value const descriptionChanged = props.metadata?.description !== description.value - const imageChanged = Boolean(image.value) const attributesChanged = JSON.stringify(attributes.value) !== JSON.stringify(props.metadata?.attributes || []) return !hasImage || !isNameFilled - || (!nameChanged && !descriptionChanged && !imageChanged && !attributesChanged) + || (!nameChanged.value && !descriptionChanged && !imageChanged.value && !attributesChanged) }) const editCollection = async () => { @@ -118,8 +135,7 @@ const editCollection = async () => { watch(isModalActive, (value) => { if (value) { - imageUrl.value = sanitizeIpfsUrl(props.metadata?.image) - image.value = undefined + initImage() name.value = props.metadata?.name description.value = props.metadata?.description attributes.value = structuredClone(toRaw(props.metadata?.attributes || [])) diff --git a/components/common/NonRecommendFieldNotification.vue b/components/common/NonRecommendFieldNotification.vue new file mode 100644 index 0000000000..27de4d33e2 --- /dev/null +++ b/components/common/NonRecommendFieldNotification.vue @@ -0,0 +1,48 @@ + + + diff --git a/locales/en.json b/locales/en.json index e0df34b649..ae894a5be4 100644 --- a/locales/en.json +++ b/locales/en.json @@ -941,6 +941,7 @@ "cancelled": "Transaction was cancelled", "feesPaidIn": "You are paying fees in {0}" }, + "undo": "Undo", "updateOnWebsiteSoon": "Update on website visible soon", "usd": "USD", "using": "using" @@ -1358,6 +1359,7 @@ "message": "People will be able to buy your NFT." } }, + "notRecommendedModify": "Please note that this field is not recommended to be modified as it may lead to misuse and confusion", "progress": "In Progress", "requiredDeposit": "A deposit of {0} is required to create a {1}. Please note, this initial deposit is refundable.", "royalty": {