fix linting

pull/5370/head
aniket-engg 9 months ago committed by Aniket
parent 49966bdeda
commit 2ddc940d26
  1. 62
      libs/remix-ui/run-tab/src/lib/components/instanceContainerUI.tsx
  2. 8
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx

@ -10,7 +10,7 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
useEffect(() => {
const fetchSavedContracts = async () => {
let allSavedContracts = localStorage.getItem('savedContracts')
const allSavedContracts = localStorage.getItem('savedContracts')
if (allSavedContracts) {
const savedContracts = JSON.parse(allSavedContracts)
const { network } = await props.plugin.call('blockchain', 'getCurrentNetworkStatus')
@ -22,8 +22,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
await props.plugin.call('udapp', 'addSavedInstance', inst.address, inst.contractData.abi, inst.name)
}
}
}
fetchSavedContracts()
}
fetchSavedContracts()
}, [props.plugin.REACT_API.networkName])
const clearInstance = () => {
@ -39,34 +39,34 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
</label>
</CustomTooltip>
</div>
{props.savedInstances.instanceList.length > 0 ? (
<div>
{' '}
{props.savedInstances.instanceList.map((instance, index) => {
return (
<UniversalDappUI
key={index}
instance={instance}
isSavedContract={true}
context={props.getContext()}
removeInstance={props.removeInstance}
index={index}
gasEstimationPrompt={props.gasEstimationPrompt}
passphrasePrompt={props.passphrasePrompt}
mainnetPrompt={props.mainnetPrompt}
runTransactions={props.runTransactions}
sendValue={props.sendValue}
getFuncABIInputs={props.getFuncABIInputs}
plugin={props.plugin}
/>
)
})}
</div>
) : (
<span className="mx-2 mt-3 alert alert-warning" data-id="NoSavedInstanceText" role="alert">
<FormattedMessage id="udapp.NoSavedInstanceText" />
</span>
)}
{props.savedInstances.instanceList.length > 0 ? (
<div>
{' '}
{props.savedInstances.instanceList.map((instance, index) => {
return (
<UniversalDappUI
key={index}
instance={instance}
isSavedContract={true}
context={props.getContext()}
removeInstance={props.removeInstance}
index={index}
gasEstimationPrompt={props.gasEstimationPrompt}
passphrasePrompt={props.passphrasePrompt}
mainnetPrompt={props.mainnetPrompt}
runTransactions={props.runTransactions}
sendValue={props.sendValue}
getFuncABIInputs={props.getFuncABIInputs}
plugin={props.plugin}
/>
)
})}
</div>
) : (
<span className="mx-2 mt-3 alert alert-warning" data-id="NoSavedInstanceText" role="alert">
<FormattedMessage id="udapp.NoSavedInstanceText" />
</span>
)}
<div className="d-flex justify-content-between align-items-center pl-2 mb-2 mt-3">
<CustomTooltip placement="top-start" tooltipClasses="text-nowrap" tooltipId="deployAndRunClearInstancesTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText6" />}>

@ -122,7 +122,7 @@ export function UniversalDappUI(props: UdappProps) {
const saveContract = async() => {
const env = await props.plugin.call('blockchain', 'getProvider')
const {network} = await props.plugin.call('blockchain', 'getCurrentNetworkStatus')
let savedContracts = localStorage.getItem('savedContracts')
const savedContracts = localStorage.getItem('savedContracts')
let objToSave
if (!savedContracts) {
objToSave = {}
@ -266,11 +266,11 @@ export function UniversalDappUI(props: UdappProps) {
{ !props.isSavedContract ?
( <CustomTooltip placement="top" tooltipClasses="text-nowrap" tooltipId="udapp_udappCloseTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText7" />}>
<i className="udapp_closeIcon m-1 fas fa-times align-self-center" aria-hidden="true" data-id="universalDappUiUdappClose" onClick={remove}></i>
<i className="udapp_closeIcon m-1 fas fa-times align-self-center" aria-hidden="true" data-id="universalDappUiUdappClose" onClick={remove}></i>
</CustomTooltip> ) :
( <CustomTooltip placement="top" tooltipClasses="text-nowrap" tooltipId="udapp_udappDeleteTooltip" tooltipText={<FormattedMessage id="udapp.tooltipTextUnsave" />}>
<i className="udapp_closeIcon m-1 far fa-trash-alt align-self-center" aria-hidden="true" data-id="universalDappUiUdappClose" onClick={unsave}></i>
</CustomTooltip> )}
<i className="udapp_closeIcon m-1 far fa-trash-alt align-self-center" aria-hidden="true" data-id="universalDappUiUdappClose" onClick={unsave}></i>
</CustomTooltip> )}
</div>
<div className="udapp_cActionsWrapper" data-id="universalDappUiContractActionWrapper">
<div className="udapp_contractActionsContainer">

Loading…
Cancel
Save