diff --git a/apps/remix-dapp/src/locales/en/udapp.json b/apps/remix-dapp/src/locales/en/udapp.json index fadb2ed75b..431eb59ed4 100644 --- a/apps/remix-dapp/src/locales/en/udapp.json +++ b/apps/remix-dapp/src/locales/en/udapp.json @@ -49,6 +49,8 @@ "udapp.enterAMessageToSign": "Enter a message to sign", "udapp.hash": "hash", "udapp.signature": "signature", + "udapp.saveVmStateTitle": "Save VM state", + "udapp.saveVmStateLabel": "State Name", "udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).", "udapp.createNewAccount": "Create a new account", "udapp.web3Title": "Creating an account is possible only in Personal mode. Please go to Settings to enable it.", 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 d56d7087a7..f9c88dc1e6 100644 --- a/apps/remix-ide/src/app/tabs/locales/en/udapp.json +++ b/apps/remix-ide/src/app/tabs/locales/en/udapp.json @@ -49,6 +49,8 @@ "udapp.enterAMessageToSign": "Enter a message to sign and click `Sign`", "udapp.hash": "hash", "udapp.signature": "signature", + "udapp.saveVmStateTitle": "Save VM state", + "udapp.saveVmStateLabel": "State Name", "udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).", "udapp.createNewAccount": "Create new account", "udapp.web3Title": "Creating an account is possible only in Personal mode. Please go to Settings to enable it.", diff --git a/libs/remix-ui/run-tab/src/lib/components/environment.tsx b/libs/remix-ui/run-tab/src/lib/components/environment.tsx index 12cb4daf2e..fde65572a1 100644 --- a/libs/remix-ui/run-tab/src/lib/components/environment.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/environment.tsx @@ -1,6 +1,6 @@ // eslint-disable-next-line no-use-before-define import React, { useEffect } from 'react' -import { FormattedMessage } from 'react-intl' +import { FormattedMessage, useIntl } from 'react-intl' import { EnvironmentProps, Provider } from '../types' import { Dropdown } from 'react-bootstrap' import { CustomMenu, CustomToggle, CustomTooltip } from '@remix-ui/helper' @@ -23,6 +23,38 @@ export function EnvironmentUI(props: EnvironmentProps) { 'L2 - Arbitrum': 'https://bridge.arbitrum.io/' } + const intl = useIntl() + + const saveVmStatePrompt = (defaultName: string) => { + return ( +
+ + +
+ ) + } + + const saveVmState = () => { + const defaultName: string = `${currentProvider.name}_${Date.now()}` + props.modal( + intl.formatMessage({ id: 'udapp.saveVmStateTitle' }), + saveVmStatePrompt(defaultName), + intl.formatMessage({ id: 'udapp.save' }), + () => { + console.log('Saved') + }, + intl.formatMessage({ id: 'udapp.cancel' }), + null + ) + } + const isL2 = (providerDisplayName: string) => providerDisplayName && (providerDisplayName.startsWith('L2 - Optimism') || providerDisplayName.startsWith('L2 - Arbitrum')) return (
@@ -39,7 +71,7 @@ export function EnvironmentUI(props: EnvironmentProps) { { currentProvider && currentProvider.isVM && }> - + }
diff --git a/libs/remix-ui/run-tab/src/lib/components/settingsUI.tsx b/libs/remix-ui/run-tab/src/lib/components/settingsUI.tsx index 12a7da58dd..44920f33f6 100644 --- a/libs/remix-ui/run-tab/src/lib/components/settingsUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/settingsUI.tsx @@ -12,7 +12,14 @@ export function SettingsUI(props: SettingsProps) { return (
- + void + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void, okBtnClass?: string, cancelBtnClass?: string) => void, } export interface NetworkProps {