diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 67231be4b..1417de452 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -1738,9 +1738,6 @@ "message": "Konto $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Sammelobjekt wurde nicht hinzugefügt, weil: $1" - }, "newCollectibleAddedMessage": { "message": "Sammelobjekt wurde erfolgreich hinzugefügt!" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 9408aeab9..b66f85652 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -1738,9 +1738,6 @@ "message": "Λογαριασμός $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Το Collectible δεν προστέθηκε επειδή: $1" - }, "newCollectibleAddedMessage": { "message": "Το Collectible προστέθηκε με επιτυχία!" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index e2ccea8eb..4ae02bfc8 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -486,6 +486,9 @@ "close": { "message": "Close" }, + "collectibleAddFailedMessage": { + "message": "NFT can’t be added as the ownership details do not match. Make sure you have entered correct information." + }, "collectibleAddressError": { "message": "This token is an NFT. Add on the $1", "description": "$1 is a clickable link with text defined by the 'importNFTPage' key" @@ -1961,9 +1964,6 @@ "message": "Account $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Collectible was not added because: $1" - }, "newCollectibleAddedMessage": { "message": "Collectible was successfully added!" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index dc2ebecb5..a154558d3 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -1787,9 +1787,6 @@ "message": "Cuenta $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "No se añadió el coleccionable porque: $1" - }, "newCollectibleAddedMessage": { "message": "¡El coleccionable fue añadido con éxito!" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index e00fa4478..a311e6ca5 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1738,9 +1738,6 @@ "message": "Compte $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Le collectible n’a pas été ajouté, car : $1" - }, "newCollectibleAddedMessage": { "message": "Le collectible a été ajouté avec succès !" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 9de7692c3..626d1ae25 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -1738,9 +1738,6 @@ "message": "खाता $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "संग्रहणीय नहीं जोड़ा गया था क्योंकि: $1" - }, "newCollectibleAddedMessage": { "message": "संग्रहणीय सफलतापूर्वक जोड़ा गया!" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index c3751ee0f..bae413007 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -1738,9 +1738,6 @@ "message": "Akun $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Koleksi tidak ditambahkan karena: $1" - }, "newCollectibleAddedMessage": { "message": "Koleksi berhasil ditambahkan!" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index c6d3bae26..e544f3a6b 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -1738,9 +1738,6 @@ "message": "アカウント$1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "次の理由により、コレクティブルは追加されませんでした: $1" - }, "newCollectibleAddedMessage": { "message": "コレクティブルが追加されました!" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index d6f619043..9814be129 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1738,9 +1738,6 @@ "message": "계정 $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "다음 이유 때문에 수집 금액이 추가되지 않았습니다: $1" - }, "newCollectibleAddedMessage": { "message": "수집이 성공적으로 추가되었습니다!" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index cbe2a5b1f..5d1289040 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -1771,9 +1771,6 @@ "message": "Conta $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "O colecionável não foi adicionado pelo seguinte motivo: $1" - }, "newCollectibleAddedMessage": { "message": "O colecionável foi adicionado com sucesso!" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index fe4e7336f..b2dd593ba 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -1738,9 +1738,6 @@ "message": "Счет $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Причина, по которой не был добавлен коллекционный актив: $1" - }, "newCollectibleAddedMessage": { "message": "Коллекционный актив успешно добавлен!" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index ac0209ba3..64bd5b6fc 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -1738,9 +1738,6 @@ "message": "Account $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Ang collectible ay hindi idinagdag dahil: $1" - }, "newCollectibleAddedMessage": { "message": "Ang collectible ay tagumpay na naidagdag!" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 46afbf969..1f19939af 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -1738,9 +1738,6 @@ "message": "Hesap $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Tahsil edilebilir tutar eklenmedi ve sebebi: $1" - }, "newCollectibleAddedMessage": { "message": "Tahsil edilebilir tutar başarılı bir şekilde eklendi!" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 430004a1f..d3cc6931c 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -1738,9 +1738,6 @@ "message": "Tài khoản $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "Bộ sưu tập đã không được thêm vì: $1" - }, "newCollectibleAddedMessage": { "message": "Bộ sưu tập đã được thêm thành công!" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 95099693c..d9c4aa6ea 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -1738,9 +1738,6 @@ "message": "账户 $1", "description": "Default name of next account to be created on create account screen" }, - "newCollectibleAddFailed": { - "message": "未添加收藏,因为:$1" - }, "newCollectibleAddedMessage": { "message": "收藏已成功添加!" }, diff --git a/ui/pages/add-collectible/add-collectible.js b/ui/pages/add-collectible/add-collectible.js index 188756aa1..0cf1bea74 100644 --- a/ui/pages/add-collectible/add-collectible.js +++ b/ui/pages/add-collectible/add-collectible.js @@ -5,7 +5,15 @@ import { util } from '@metamask/controllers'; import { useI18nContext } from '../../hooks/useI18nContext'; import { DEFAULT_ROUTE } from '../../helpers/constants/routes'; +import { + DISPLAY, + FONT_WEIGHT, + TYPOGRAPHY, +} from '../../helpers/constants/design-system'; + import Box from '../../components/ui/box'; +import Typography from '../../components/ui/typography'; +import ActionableMessage from '../../components/ui/actionable-message'; import PageContainer from '../../components/ui/page-container'; import { addCollectibleVerifyOwnership, @@ -38,6 +46,7 @@ export default function AddCollectible() { ); const [tokenId, setTokenId] = useState(''); const [disabled, setDisabled] = useState(true); + const [collectibleAddFailed, setCollectibleAddFailed] = useState(false); const handleAddCollectible = async () => { try { @@ -47,7 +56,7 @@ export default function AddCollectible() { } catch (error) { const { message } = error; dispatch(setNewCollectibleAddedMessage(message)); - history.push(DEFAULT_ROUTE); + setCollectibleAddFailed(true); return; } if (contractAddressToConvertFromTokenToCollectible) { @@ -84,24 +93,48 @@ export default function AddCollectible() { }} disabled={disabled} contentComponent={ - + {isMainnet && !useCollectibleDetection && !collectibleDetectionNoticeDismissed ? ( ) : null} - + {collectibleAddFailed && ( + + + {t('collectibleAddFailedMessage')} + +