From 103affaddec2e1bddd011f869f5112951c0457ba Mon Sep 17 00:00:00 2001 From: OGPoyraz Date: Wed, 13 Nov 2024 12:19:45 +0100 Subject: [PATCH 01/15] Add firstTimeInteraction feat --- app/_locales/en/messages.json | 6 + package.json | 3 +- .../info/row/__snapshots__/row.test.tsx.snap | 4 +- .../app/confirm/info/row/constants.ts | 1 + ui/components/app/confirm/info/row/row.tsx | 2 +- .../transaction-flow-section.tsx | 59 +++++++-- .../useFirstTimeInteractionAlert.test.ts | 117 ++++++++++++++++++ .../useFirstTimeInteractionAlert.ts | 34 +++++ .../hooks/useConfirmationAlerts.ts | 4 + yarn.lock | 74 ++++++----- 10 files changed, 259 insertions(+), 45 deletions(-) create mode 100644 ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.test.ts create mode 100644 ui/pages/confirmations/hooks/alerts/transactions/useFirstTimeInteractionAlert.ts diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 610ddba3a4dd..0bbbf9ec1d99 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2091,6 +2091,12 @@ "message": "File import not working? Click here!", "description": "Helps user import their account from a JSON file" }, + "firstTimeInteractionReason": { + "message": "You're interacting with this address for the first time. Make sure that it's correct before you continue." + }, + "firstTimeInteractionTitle": { + "message": "1st interaction" + }, "flaskWelcomeUninstall": { "message": "you should uninstall this extension", "description": "This request is shown on the Flask Welcome screen. It is intended for non-developers, and will be bolded." diff --git a/package.json b/package.json index 6c9811cb3ed6..22101990dd5c 100644 --- a/package.json +++ b/package.json @@ -256,7 +256,8 @@ "@ledgerhq/evm-tools/axios": "^0.28.0", "@ledgerhq/hw-app-eth/axios": "^0.28.0", "@ledgerhq/hw-app-eth@npm:^6.39.0": "patch:@ledgerhq/hw-app-eth@npm%3A6.39.0#~/.yarn/patches/@ledgerhq-hw-app-eth-npm-6.39.0-866309bbbe.patch", - "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch" + "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch", + "@metamask/transaction-controller@^38.3.0": "npm:@metamask-previews/transaction-controller@39.0.0-preview-fefbd325" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", diff --git a/ui/components/app/confirm/info/row/__snapshots__/row.test.tsx.snap b/ui/components/app/confirm/info/row/__snapshots__/row.test.tsx.snap index 7dad4ee50357..03201ddd10ea 100644 --- a/ui/components/app/confirm/info/row/__snapshots__/row.test.tsx.snap +++ b/ui/components/app/confirm/info/row/__snapshots__/row.test.tsx.snap @@ -4,7 +4,7 @@ exports[`ConfirmInfoRow should match snapshot 1`] = `