format code in contractDropdownUI. add more tooltips to account component in run and deploy

pull/2904/head
Joseph Izang 2 years ago
parent 0bc4404383
commit 4f0027ac18
  1. 21
      libs/remix-ui/run-tab/src/lib/components/account.tsx
  2. 6
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

@ -3,6 +3,7 @@ import React, { useEffect, useState, useRef } from 'react'
import { CopyToClipboard } from '@remix-ui/clipboard' import { CopyToClipboard } from '@remix-ui/clipboard'
import { AccountProps } from '../types' import { AccountProps } from '../types'
import { PassphrasePrompt } from './passphrase' import { PassphrasePrompt } from './passphrase'
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
export function AccountUI (props: AccountProps) { export function AccountUI (props: AccountProps) {
const { selectedAccount, loadedAccounts } = props.accounts const { selectedAccount, loadedAccounts } = props.accounts
@ -150,9 +151,15 @@ export function AccountUI (props: AccountProps) {
<div className="udapp_crow"> <div className="udapp_crow">
<label className="udapp_settingsLabel"> <label className="udapp_settingsLabel">
Account Account
<span id="remixRunPlusWraper" title={plusOpt.title}> <OverlayTrigger placement={'top-start'} overlay={
<i id="remixRunPlus" className={`fas fa-plus-circle udapp_icon ${plusOpt.classList}`} aria-hidden="true" onClick={newAccount}></i> <Tooltip className="text-wrap" id="remixPlusWrapperTooltip">
</span> <span>{plusOpt.title}</span>
</Tooltip>
}>
<span id="remixRunPlusWraper">
<i id="remixRunPlus" className={`fas fa-plus-circle udapp_icon ${plusOpt.classList}`} aria-hidden="true" onClick={newAccount}></i>
</span>
</OverlayTrigger>
</label> </label>
<div className="udapp_account"> <div className="udapp_account">
<select id="txorigin" data-id="runTabSelectAccount" name="txorigin" className="form-control udapp_select custom-select pr-4" value={selectedAccount} onChange={(e) => { props.setAccount(e.target.value) }}> <select id="txorigin" data-id="runTabSelectAccount" name="txorigin" className="form-control udapp_select custom-select pr-4" value={selectedAccount} onChange={(e) => { props.setAccount(e.target.value) }}>
@ -161,7 +168,13 @@ export function AccountUI (props: AccountProps) {
} }
</select> </select>
<div style={{ marginLeft: -5 }}><CopyToClipboard tip='Copy account to clipboard' content={selectedAccount} direction='top' /></div> <div style={{ marginLeft: -5 }}><CopyToClipboard tip='Copy account to clipboard' content={selectedAccount} direction='top' /></div>
<i id="remixRunSignMsg" data-id="settingsRemixRunSignMsg" className="mx-1 fas fa-edit udapp_icon" aria-hidden="true" onClick={signMessage} title="Sign a message using this account"></i> <OverlayTrigger placement={'top-start'} overlay={
<Tooltip className="text-nowrap" id="remixSignMsgTooltip">
<span>{"Sign a message using this account"}</span>
</Tooltip>
}>
<i id="remixRunSignMsg" data-id="settingsRemixRunSignMsg" className="mx-1 fas fa-edit udapp_icon" aria-hidden="true" onClick={signMessage}></i>
</OverlayTrigger>
</div> </div>
</div> </div>
) )

@ -328,9 +328,9 @@ export function ContractDropdownUI(props: ContractDropdownProps) {
<Tooltip className="text-wrap" id="runAndDeployAddresstooltip"> <Tooltip className="text-wrap" id="runAndDeployAddresstooltip">
<span>{atAddressOptions.title}</span> <span>{atAddressOptions.title}</span>
</Tooltip> </Tooltip>
}> }>
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions. disabled} onClick={loadFromAddress}>At Address</button> <button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions. disabled} onClick={loadFromAddress}>At Address</button>
</OverlayTrigger> </OverlayTrigger>
<input <input
ref={atAddressValue} ref={atAddressValue}
className="udapp_input udapp_ataddressinput ataddressinput form-control" className="udapp_input udapp_ataddressinput ataddressinput form-control"

Loading…
Cancel
Save