From 273590db044e1685730f410b1ec6d3bc5b663924 Mon Sep 17 00:00:00 2001 From: David Disu Date: Sat, 18 Dec 2021 13:59:13 +0100 Subject: [PATCH] Finish up deploy --- .eslintrc.json | 5 +- .../src/lib/publish-to-storage.tsx | 2 +- .../remix-ui/run-tab/src/lib/actions/index.ts | 74 +++++++++++-------- .../run-tab/src/lib/actions/payload.ts | 1 - .../src/lib/components/contractDropdownUI.tsx | 32 +++++++- .../run-tab/src/lib/components/mainnet.tsx | 39 +++------- .../run-tab/src/lib/reducers/runTab.ts | 8 +- libs/remix-ui/run-tab/src/lib/run-tab.tsx | 2 +- libs/remix-ui/run-tab/src/lib/types/index.ts | 50 ++++++++++++- .../src/lib/solidity-compiler.tsx | 2 +- .../solidity-compiler/src/lib/types/index.ts | 6 +- .../workspace/src/lib/contexts/index.ts | 1 - .../src/lib/providers/FileSystemProvider.tsx | 1 - .../remix-ui/workspace/src/lib/types/index.ts | 1 - 14 files changed, 141 insertions(+), 83 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 06cc47d9a2..5fe8155373 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -31,5 +31,8 @@ "extends": ["plugin:@nrwl/nx/javascript"], "rules": {} } - ] + ], + "globals": { + "JSX": true + } } diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index f9245dc15e..ed8ca6a65f 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -79,7 +79,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { resetStorage() } - const modal = async (title: string, message: string | JSX.Element) => { // eslint-disable-line no-undef + const modal = async (title: string, message: string | JSX.Element) => { await setState(prevState => { return { ...prevState, diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index af87629b30..8baec21381 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -7,7 +7,7 @@ import { addProvider, displayNotification, displayPopUp, fetchAccountsListFailed import { RunTab } from '../types/run-tab' import { CompilerAbstract } from '@remix-project/remix-solidity' import * as remixLib from '@remix-project/remix-lib' -import { ContractData } from '../types' +import { ContractData, Network, Tx } from '../types' declare global { interface Window { _paq: any @@ -228,7 +228,6 @@ const removeExternalProvider = (name) => { dispatch(removeProvider(name)) } -// eslint-disable-next-line no-undef export const setExecutionContext = (executionContext: { context: string, fork: string }, displayContent: JSX.Element) => { plugin.blockchain.changeExecutionContext(executionContext, () => { dispatch(displayNotification('External node request', displayContent, 'OK', 'Cancel', () => { @@ -250,7 +249,6 @@ export const clearPopUp = async () => { dispatch(hidePopUp()) } -// eslint-disable-next-line no-undef export const createNewBlockchainAccount = async (cbMessage: JSX.Element) => { plugin.blockchain.newAccount( '', @@ -283,7 +281,6 @@ export const setMatchPassphrasePrompt = (passphrase: string) => { dispatch(setMatchPassphrase(passphrase)) } -// eslint-disable-next-line no-undef export const signMessageWithAddress = (account: string, message: string, modalContent: (hash: string, data: string) => JSX.Element, passphrase?: string) => { plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => { if (err) { @@ -382,27 +379,32 @@ const getCompilerContracts = () => { return plugin.compilersArtefacts.__last.getData().contracts } -// eslint-disable-next-line no-undef const terminalLogger = (view: JSX.Element) => { plugin.call('terminal', 'logHtml', view) } -const getConfirmationCb = () => { +const getConfirmationCb = (confirmDialogContent: ( + tx: Tx, network: + Network, amount: string, + gasEstimation: string, + gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, + determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void + ) => JSX.Element) => { // this code is the same as in recorder.js. TODO need to be refactored out const confirmationCb = (network, tx, gasEstimation, continueTxExecution, cancelCb) => { if (network.name !== 'Main') { return continueTxExecution(null) } const amount = plugin.blockchain.fromWei(tx.value, true, 'ether') - const content = confirmDialog(tx, network, amount, gasEstimation, plugin.blockchain.determineGasFees(tx), plugin.blockchain.determineGasPrice.bind(plugin.blockchain)) + const content = confirmDialogContent(tx, network, amount, gasEstimation, plugin.blockchain.determineGasFees(tx), plugin.blockchain.determineGasPrice.bind(plugin.blockchain)) dispatch(displayNotification('Confirm transaction', content, 'Confirm', 'Cancel', () => { - plugin.blockchain.config.setUnpersistedProperty('doNotShowTransactionConfirmationAgain', content.querySelector('input#confirmsetting').checked) + plugin.blockchain.config.setUnpersistedProperty('doNotShowTransactionConfirmationAgain', plugin.REACT_API.confirmSettings) // TODO: check if this is check is still valid given the refactor - if (!content.gasPriceStatus) { + if (!plugin.REACT_API.gasPriceStatus) { cancelCb('Given transaction fee is not correct') } else { - continueTxExecution(content.txFee) + continueTxExecution({ maxFee: plugin.REACT_API.maxFee, maxPriorityFee: plugin.REACT_API.maxPriorityFee, baseFeePerGas: plugin.REACT_API.baseFeePerGas, gasPrice: plugin.REACT_API.gasPrice }) } }, () => { return cancelCb('Transaction canceled by user.') @@ -412,8 +414,22 @@ const getConfirmationCb = () => { return confirmationCb } -// eslint-disable-next-line no-undef -export const createInstance = async (selectedContract: ContractData, gasEstimationPrompt: (msg: string) => JSX.Element, passphrasePrompt: (msg: string) => JSX.Element, logBuilder: (msg: string) => JSX.Element, publishToStorage: (storage: 'ipfs' | 'swarm', contract: ContractData) => void) => { +export const createInstance = async ( + selectedContract: ContractData, + gasEstimationPrompt: (msg: string) => JSX.Element, + passphrasePrompt: (msg: string) => JSX.Element, + logBuilder: (msg: string) => JSX.Element, + publishToStorage: (storage: 'ipfs' | 'swarm', + contract: ContractData) => void, + mainnetPrompt: ( + tx: Tx, network: + Network, amount: string, + gasEstimation: string, + gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, + determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void + ) => JSX.Element, + isOverSizePrompt: () => JSX.Element, + args) => { const continueCb = (error, continueTxExecution, cancelCb) => { if (error) { const msg = typeof error !== 'string' ? error.message : error @@ -468,33 +484,27 @@ export const createInstance = async (selectedContract: ContractData, gasEstimati const compilerContracts = getCompilerContracts() const confirmationCb = getConfirmationCb(mainnetPrompt) - // if (selectedContract.isOverSizeLimit()) { - // return modalDialog('Contract code size over limit', yo`
Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails.
- // More info: eip-170 - //
`, - // { - // label: 'Force Send', - // fn: () => { - // this.deployContract(selectedContract, args, contractMetadata, compilerContracts, { continueCb, promptCb, statusCb, finalCb }, confirmationCb) - // } - // }, { - // label: 'Cancel', - // fn: () => { - // this.logCallback(`creation of ${selectedContract.name} canceled by user.`) - // } - // }) - // } - // this.deployContract(selectedContract, args, contractMetadata, compilerContracts, { continueCb, promptCb, statusCb, finalCb }, confirmationCb) + if (selectedContract.isOverSizeLimit()) { + return dispatch(displayNotification('Contract code size over limit', isOverSizePrompt(), 'Force Send', 'Cancel', () => { + deployContract(selectedContract, args, contractMetadata, compilerContracts, { continueCb, promptCb, statusCb, finalCb }, confirmationCb) + }, () => { + const log = logBuilder(`creation of ${selectedContract.name} canceled by user.`) + + return terminalLogger(log) + })) + } + deployContract(selectedContract, args, contractMetadata, compilerContracts, { continueCb, promptCb, statusCb, finalCb }, confirmationCb) } const deployContract = (selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) => { - _paq.push(['trackEvent', 'udapp', 'DeployContractTo', this.networkName + '_' + this.networkId]) + _paq.push(['trackEvent', 'udapp', 'DeployContractTo', plugin.REACT_API.networkName]) const { statusCb } = callbacks + if (!contractMetadata || (contractMetadata && contractMetadata.autoDeployLib)) { - return this.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) + return plugin.blockchain.deployContractAndLibraries(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) } if (Object.keys(selectedContract.bytecodeLinkReferences).length) statusCb(`linking ${JSON.stringify(selectedContract.bytecodeLinkReferences, null, '\t')} using ${JSON.stringify(contractMetadata.linkReferences, null, '\t')}`) - this.blockchain.deployContractWithLibrary(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) + plugin.blockchain.deployContractWithLibrary(selectedContract, args, contractMetadata, compilerContracts, callbacks, confirmationCb) } export const setCheckIpfs = (value: boolean) => { diff --git a/libs/remix-ui/run-tab/src/lib/actions/payload.ts b/libs/remix-ui/run-tab/src/lib/actions/payload.ts index 56cfd0d022..d804db13d3 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/payload.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/payload.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ export const fetchAccountsListRequest = () => { return { type: 'FETCH_ACCOUNTS_LIST_REQUEST', diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index d55b94c180..d0bceacf90 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -1,9 +1,10 @@ // eslint-disable-next-line no-use-before-define import React, { useEffect, useState } from 'react' -import { ContractData, ContractDropdownProps } from '../types' +import { ContractData, ContractDropdownProps, Network, Tx } from '../types' import * as ethJSUtil from 'ethereumjs-util' import { ContractGUI } from './contractGUI' import { PassphrasePrompt } from './passphrase' +import { MainnetPrompt } from './mainnet' export function ContractDropdownUI (props: ContractDropdownProps) { const [networkName, setNetworkName] = useState('') @@ -121,7 +122,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { if (selectedContract.bytecodeObject.length === 0) { return props.modal('Alert', 'This contract may be abstract, not implement an abstract parent\'s methods completely or not invoke an inherited contract\'s constructor correctly.', 'OK', () => {}) } - props.createInstance(loadedContractData, gasEstimationPrompt, passphrasePrompt, logBuilder, props.publishToStorage) + props.createInstance(loadedContractData, gasEstimationPrompt, passphrasePrompt, logBuilder, props.publishToStorage, mainnetPrompt, isOverSizePrompt, args) } // listenToContextChange () { @@ -346,8 +347,31 @@ export function ContractDropdownUI (props: ContractDropdownProps) { return } - const mainnetPrompt = () => { - + const mainnetPrompt = (tx: Tx, network: Network, amount: string, gasEstimation: string, gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void) => { + return + } + + const isOverSizePrompt = () => { + return ( +
Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails.
+ More info: eip-170 +
+ ) } return ( diff --git a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx index 9b494c8b8c..de98393fde 100644 --- a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx @@ -2,34 +2,9 @@ import React, { useEffect } from 'react' import { CopyToClipboard } from '@remix-ui/clipboard' import Web3 from 'web3' +import { MainnetProps } from '../types' -interface MainnetProps { - network: { - name: string, - lastBlock: { - baseFeePerGas: string - } - }, - tx: { - from: string, - to: string, - data: string, - gas: string - }, - amount: string, - gasEstimation: string, - setNewGasPrice: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, - updateGasPriceStatus: (status: boolean) => void, - updateConfirmSettings: (confirmation: boolean) => void, - updateMaxFee: (fee: string) => void, - updateBaseFeePerGas: (fee: string) => void, - init: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void, - setTxFeeContent: (content: string) => void, - updateGasPrice: (price: string) => void, - txFeeContent: string -} - -export function PassphrasePrompt (props: MainnetProps) { +export function MainnetPrompt (props: MainnetProps) { useEffect(() => { props.init((txFeeText, gasPriceValue, gasPriceStatus) => { if (txFeeText) props.setTxFeeContent(txFeeText) @@ -75,6 +50,10 @@ export function PassphrasePrompt (props: MainnetProps) { }) } + const onMaxPriorityFeeChange = (value: string) => { + props.updateMaxPriorityFee(value) + } + return (
You are about to create a transaction on {props.network.name} Network. Confirm the details to send the info to your provider. @@ -113,14 +92,14 @@ export function PassphrasePrompt (props: MainnetProps) {
Max Priority fee: - + onMaxPriorityFeeChange(e.target.value)} /> Gwei
Max fee (Not less than base fee {Web3.utils.fromWei(Web3.utils.toBN(parseInt(props.network.lastBlock.baseFeePerGas, 16)), 'Gwei')} Gwei): - onMaxFeeChange(e.target.value)} /> + onMaxFeeChange(e.target.value)} /> Gwei
@@ -128,7 +107,7 @@ export function PassphrasePrompt (props: MainnetProps) {
:
Gas price: - onGasPriceChange(e.target.value)} /> + onGasPriceChange(e.target.value)} /> Gwei (visit ethgasstation.info for current gas price info.)
} diff --git a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts index 4e3afb5598..edd353bff2 100644 --- a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts +++ b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts @@ -60,7 +60,8 @@ export interface RunTabState { maxFee: string, maxPriorityFee: string, baseFeePerGas: string, - txFeeContent: string + txFeeContent: string, + gasPrice: string } export const runTabInitialState: RunTabState = { @@ -134,9 +135,10 @@ export const runTabInitialState: RunTabState = { gasPriceStatus: false, confirmSettings: false, maxFee: '', - maxPriorityFee: '', + maxPriorityFee: '1', baseFeePerGas: '', - txFeeContent: '' + txFeeContent: '', + gasPrice: '' } export const runTabReducer = (state: RunTabState = runTabInitialState, action: Action) => { diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 79107e001a..eefd45775b 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -102,7 +102,6 @@ export function RunTabUI (props: RunTabProps) { } }, [runTab.popup]) - // eslint-disable-next-line no-undef const modal = (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { setModals(modals => { modals.push({ message, title, okLabel, okFn, cancelLabel, cancelFn }) @@ -187,6 +186,7 @@ export function RunTabUI (props: RunTabProps) { updateMaxFee={updateMaxFee} updateMaxPriorityFee={updateMaxPriorityFee} updateTxFeeContent={updateTxFeeContent} + txFeeContent={runTab.txFeeContent} /> diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 903985e78a..659ddce557 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-undef */ import { RunTab } from './run-tab' export interface RunTabProps { plugin: RunTab @@ -116,6 +115,20 @@ export interface ContractData { metadata: any } +export interface Tx { + from: string, + to: string, + data: string, + gas: string +} + +export interface Network { + name: string, + lastBlock: { + baseFeePerGas: string + } +} + export interface ContractDropdownProps { exEnvironment: string, contracts: { @@ -134,7 +147,21 @@ export interface ContractDropdownProps { modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, passphrase: string, setPassphrase: (passphrase: string) => void, - createInstance: (selectedContract: ContractData, gasEstimationPrompt: (msg: string) => JSX.Element, passphrasePrompt: (msg: string) => JSX.Element, logBuilder: (msg: string) => JSX.Element, publishToStorage: (storage: 'ipfs' | 'swarm', contract: ContractData) => void) => void, + createInstance: (selectedContract: ContractData, + gasEstimationPrompt: (msg: string) => JSX.Element, + passphrasePrompt: (msg: string) => JSX.Element, + logBuilder: (msg: string) => JSX.Element, + publishToStorage: (storage: 'ipfs' | 'swarm', + contract: ContractData) => void, + mainnetPrompt: ( + tx: Tx, network: + Network, amount: string, + gasEstimation: string, + gasFees: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, + determineGasPrice: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void + ) => JSX.Element, + isOverSizePrompt: () => JSX.Element, + args) => void, ipfsCheckedState: boolean, setIpfsCheckedState: (value: boolean) => void, publishToStorage: (storage: 'ipfs' | 'swarm', contract: ContractData) => void, @@ -144,7 +171,8 @@ export interface ContractDropdownProps { updateMaxFee: (fee: string) => void, updateMaxPriorityFee: (fee: string) => void, updateGasPrice: (price: string) => void, - updateTxFeeContent: (content: string) => void + updateTxFeeContent: (content: string) => void, + txFeeContent: string } export interface RecorderProps { @@ -181,3 +209,19 @@ export interface ContractGUIProps { evmBC: any, lookupOnly: boolean } +export interface MainnetProps { + network: Network, + tx: Tx, + amount: string, + gasEstimation: string, + setNewGasPrice: (maxFee: string, cb: (txFeeText: string, priceStatus: boolean) => void) => void, + updateGasPriceStatus: (status: boolean) => void, + updateConfirmSettings: (confirmation: boolean) => void, + updateMaxFee: (fee: string) => void, + updateBaseFeePerGas: (fee: string) => void, + init: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void, + setTxFeeContent: (content: string) => void, + updateGasPrice: (price: string) => void, + updateMaxPriorityFee: (fee: string) => void + txFeeContent: string +} diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 11852a17ca..dcc86f387f 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -81,7 +81,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { setCurrentVersion(value) api.setCompilerParameters({ version: value }) } - // eslint-disable-next-line no-undef + const modal = async (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { await setState(prevState => { return { diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 83100a0bd5..4932b1456c 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -10,8 +10,8 @@ export interface CompilerContainerProps { api: ICompilerApi, compileTabLogic: CompileTabLogic, isHardhatProject: boolean, - tooltip: (message: string | JSX.Element) => void, // eslint-disable-line no-undef - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, // eslint-disable-line no-undef + tooltip: (message: string | JSX.Element) => void, + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, compiledFileName: string, updateCurrentVersion: any, configurationSettings: ConfigurationSettings @@ -21,6 +21,6 @@ export interface ContractSelectionProps { contractMap: { file: string } | Record, - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, // eslint-disable-line no-undef + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, contractsDetails: Record } diff --git a/libs/remix-ui/workspace/src/lib/contexts/index.ts b/libs/remix-ui/workspace/src/lib/contexts/index.ts index 6e189693a9..1aedce98b5 100644 --- a/libs/remix-ui/workspace/src/lib/contexts/index.ts +++ b/libs/remix-ui/workspace/src/lib/contexts/index.ts @@ -4,7 +4,6 @@ import { BrowserState } from '../reducers/workspace' export const FileSystemContext = createContext<{ fs: BrowserState, - // eslint-disable-next-line no-undef modal:(title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, dispatchInitWorkspace:() => Promise, dispatchFetchDirectory:(path: string) => Promise, diff --git a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx index 53891615c2..904ed7cade 100644 --- a/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx +++ b/libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx @@ -170,7 +170,6 @@ export const FileSystemProvider = (props: WorkspaceProps) => { }) } - // eslint-disable-next-line no-undef const modal = (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { setModals(modals => { modals.push({ message, title, okLabel, okFn, cancelLabel, cancelFn }) diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts index 37f6c22833..bf4b24d661 100644 --- a/libs/remix-ui/workspace/src/lib/types/index.ts +++ b/libs/remix-ui/workspace/src/lib/types/index.ts @@ -41,7 +41,6 @@ export interface WorkspaceState { export interface Modal { hide?: boolean title: string - // eslint-disable-next-line no-undef message: string | JSX.Element okLabel: string okFn: () => void