From 06e6510b3a833d14d842c33e2fb164b4449b21a7 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 24 May 2024 13:45:58 +0530 Subject: [PATCH] added permission modal --- .../src/app/tabs/locales/en/udapp.json | 7 ++++++- .../src/lib/components/universalDappUI.tsx | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/locales/en/udapp.json b/apps/remix-ide/src/app/tabs/locales/en/udapp.json index e752fd1bc9..7ebb3b8605 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -80,6 +80,12 @@ "udapp.pinnedAt": "Pinned at", "udapp.filePath": "File path", + "udapp.solScan.iconTooltip": "Run Solidity scan for contract", + "udapp.solScan.modalTitle": "Permission to share code", + "udapp.solScan.modalMessage": "Contract code will be shared to third party Solidity Scan.\n Would you like to continue?", + "udapp.solScan.modalOkLabel": "Continue", + "udapp.solScan.modalCancelLabel": "Cancel", + "udapp._comment_recorderCardUI.tsx": "libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx", "udapp.transactionsRecorded": "Transactions recorded", "udapp.transactionsCountTooltip": "The number of recorded transactions", @@ -111,7 +117,6 @@ "udapp.tooltipTextRemove": "Remove from the list", "udapp.tooltipTextEdit": "Create a DApp using this contract in the main panel", "udapp.tooltipTextPin": "Pin contract", - "udapp.tooltipTextSolScan": "Run Solidity scan for contract", "udapp.tooltipText8": "Click for docs about using 'receive'/'fallback'", "udapp.tooltipText9": "The Calldata to send to fallback function of the contract.", "udapp.tooltipText10": "Send data to contract.", diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 935f9a35fc..f555c7532f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -6,6 +6,7 @@ import { FuncABI } from '@remix-project/core-plugin' import { CopyToClipboard } from '@remix-ui/clipboard' import * as remixLib from '@remix-project/remix-lib' import * as ethJSUtil from '@ethereumjs/util' +import { AppModal } from '@remix-ui/app' import { ContractGUI } from './contractGUI' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' import { BN } from 'bn.js' @@ -217,6 +218,20 @@ export function UniversalDappUI(props: UdappProps) { setCalldataValue(value) } + const askPermissionToScan = async () => { + + const modal: AppModal = { + id: 'SolidityScanPermissionHandler', + title: , + message: , + okLabel: , + cancelLabel: + } + + const result = await props.plugin.call('notification', 'modal', modal) + console.log('askPermissionToScan----> result----->', result) + } + const label = (key: string | number, value: string) => { return (
@@ -308,7 +323,7 @@ export function UniversalDappUI(props: UdappProps) { )} }> - +
{ props.isPinnedContract && props.instance.pinnedAt ? (