Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dapp-draft icon in deployed contract #4608

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
sendValue={props.sendValue}
getFuncABIInputs={props.getFuncABIInputs}
plugin={props.plugin}
exEnvironment={props.exEnvironment}
editInstance={props.editInstance}
/>
)
})}
Expand Down Expand Up @@ -141,6 +143,8 @@ export function InstanceContainerUI(props: InstanceContainerProps) {
sendValue={props.sendValue}
getFuncABIInputs={props.getFuncABIInputs}
plugin={props.plugin}
exEnvironment={props.exEnvironment}
editInstance={props.editInstance}
/>
)
})}
Expand Down
3 changes: 2 additions & 1 deletion libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ export function UniversalDappUI(props: UdappProps) {
</div>
<div className="udapp_cActionsWrapper" data-id="universalDappUiContractActionWrapper">
<div className="udapp_contractActionsContainer">
<div className="d-flex" data-id="instanceContractBal">
<div className="d-flex justify-content-between" data-id="instanceContractBal">
<label>
<b><FormattedMessage id="udapp.balance" />:</b> {instanceBalance} ETH
</label>
{props.exEnvironment === 'injected' && <i className="fas fa-edit btn btn-sm p-0" onClick={() => {props.editInstance(props.instance)}}></i>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also be displayed for all providers except VM providers. But what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think so. But the dapp template only works for intected provider for now. More providers will be adapted in further iterations. @yann300

</div>
{ props.isSavedContract && props.instance.savedOn ? (
<div className="d-flex" data-id="instanceContractSavedOn">
Expand Down
4 changes: 4 additions & 0 deletions libs/remix-ui/run-tab/src/lib/run-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ export function RunTabUI(props: RunTabProps) {
runTransactions={executeTransactions}
sendValue={runTab.sendValue}
getFuncABIInputs={getFuncABIValues}
exEnvironment={runTab.selectExEnv}
editInstance={(instance) => {
plugin.call('dapp-draft', 'edit', {address: instance.address, abi: instance.contractData.abi, name: instance.name, network: runTab.networkName})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from the top of my head, I think just this will work.

}}
/>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions libs/remix-ui/run-tab/src/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ export interface InstanceContainerProps {
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,
sendValue: string,
getFuncABIInputs: (funcABI: FuncABI) => string
exEnvironment: string
editInstance: (instance) => void
plugin: RunTab
}

Expand Down Expand Up @@ -449,6 +451,8 @@ export interface UdappProps {
funcIndex?: number) => void,
sendValue: string,
getFuncABIInputs: (funcABI: FuncABI) => string
exEnvironment: string
editInstance: (instance) => void
plugin: RunTab
}

Expand Down