From 2115516e00514335ab5194c7b1f9fc6d65562ac9 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Wed, 19 Jun 2024 14:56:48 +0530 Subject: [PATCH] fix: copy changes in re-designed SIWE signature pages (#25381) --- app/_locales/en/messages.json | 8 +++++++- .../confirm/info/personal-sign/personal-sign.tsx | 2 +- .../confirmations/components/confirm/title/title.tsx | 11 ++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 8c9b810bdfa1..43198ef01267 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -909,12 +909,18 @@ "confirmTitleDescPermitSignature": { "message": "This site wants permission to spend your tokens." }, + "confirmTitleDescSIWESignature": { + "message": "A site wants you to sign in to prove you own this account." + }, "confirmTitleDescSignature": { "message": "Only confirm this message if you approve the content and trust the requesting site." }, "confirmTitlePermitSignature": { "message": "Spending cap request" }, + "confirmTitleSIWESignature": { + "message": "Sign-in request" + }, "confirmTitleSignature": { "message": "Signature request" }, @@ -4705,7 +4711,7 @@ "message": "Resources" }, "siweSignatureSimulationDetailInfo": { - "message": "This type of signature is not able to move your assets and is used for signing in." + "message": "You’re signing into a site and there are no predicted changes to your account." }, "siweURI": { "message": "URL" diff --git a/ui/pages/confirmations/components/confirm/info/personal-sign/personal-sign.tsx b/ui/pages/confirmations/components/confirm/info/personal-sign/personal-sign.tsx index 93e8aff2ef35..6421dd684b9b 100644 --- a/ui/pages/confirmations/components/confirm/info/personal-sign/personal-sign.tsx +++ b/ui/pages/confirmations/components/confirm/info/personal-sign/personal-sign.tsx @@ -67,7 +67,7 @@ const PersonalSignInfo: React.FC = () => { alertKey="requestFrom" ownerId={currentConfirmation.id} label={t('requestFrom')} - tooltip={t('requestFromInfo')} + tooltip={isSIWE ? undefined : t('requestFromInfo')} > diff --git a/ui/pages/confirmations/components/confirm/title/title.tsx b/ui/pages/confirmations/components/confirm/title/title.tsx index a38abbb55433..87aeb2c9b88e 100644 --- a/ui/pages/confirmations/components/confirm/title/title.tsx +++ b/ui/pages/confirmations/components/confirm/title/title.tsx @@ -13,7 +13,10 @@ import useAlerts from '../../../../../hooks/useAlerts'; import { getHighestSeverity } from '../../../../../components/app/alert-system/utils'; import GeneralAlert from '../../../../../components/app/alert-system/general-alert/general-alert'; import { Confirmation, SignatureRequestType } from '../../../types/confirm'; -import { isPermitSignatureRequest } from '../../../utils'; +import { + isPermitSignatureRequest, + isSIWESignatureRequest, +} from '../../../utils'; function ConfirmBannerAlert({ ownerId }: { ownerId: string }) { const t = useI18nContext(); @@ -57,6 +60,9 @@ const getTitle = (t: IntlFunction, confirmation?: Confirmation) => { case TransactionType.contractInteraction: return t('confirmTitleTransaction'); case TransactionType.personalSign: + if (isSIWESignatureRequest(confirmation as SignatureRequestType)) { + return t('confirmTitleSIWESignature'); + } return t('confirmTitleSignature'); case TransactionType.signTypedData: return isPermitSignatureRequest(confirmation as SignatureRequestType) @@ -72,6 +78,9 @@ const getDescription = (t: IntlFunction, confirmation?: Confirmation) => { case TransactionType.contractInteraction: return t('confirmTitleDescContractInteractionTransaction'); case TransactionType.personalSign: + if (isSIWESignatureRequest(confirmation as SignatureRequestType)) { + return t('confirmTitleDescSIWESignature'); + } return t('confirmTitleDescSignature'); case TransactionType.signTypedData: return isPermitSignatureRequest(confirmation as SignatureRequestType)