linting file

pull/1342/head
davidzagi93@gmail.com 4 years ago
parent b96c22f97a
commit f56d21d4cc
  1. 4
      libs/remix-ui/terminal/src/lib/actions/terminalAction.ts
  2. 2
      libs/remix-ui/terminal/src/lib/reducers/remixWelcom.ts
  3. 4
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.css
  4. 23
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

@ -153,7 +153,7 @@ export const initListeningOnNetwork = (props, dispatch) => {
// // // append(el) // // // append(el)
// }, { activate: true }, dispatch) // }, { activate: true }, dispatch)
} else { } else {
registerCommandAction('knownTransaction', function (args, cmds, append) { registerCommandAction('knownTransaction', function (args) {
var data = args[0] var data = args[0]
console.log({ data }) console.log({ data })
// let el // let el
@ -168,7 +168,7 @@ export const initListeningOnNetwork = (props, dispatch) => {
}, { activate: true }, dispatch) }, { activate: true }, dispatch)
} }
}) })
props.txListener.event.register('newCall', (tx) => { props.txListener.event.register('newCall', () => {
console.log('new call action') console.log('new call action')
// log(this, tx, null) // log(this, tx, null)
}) })

@ -22,4 +22,4 @@ export const remixWelcome = () => {
<li>remix (run remix.help() for more info)</li> <li>remix (run remix.help() for more info)</li>
</ul> </ul>
</div>` </div>`
} }

@ -378,10 +378,10 @@ element.style {
} }
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ /* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.accordion:hover, /* .accordion:hover,
.active { .active {
background-color: #ccc; background-color: #ccc;
} } */
/* Style the accordion content title */ /* Style the accordion content title */
.accordion__title { .accordion__title {

@ -259,11 +259,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
if (autoCompletState.showSuggestions && (event.which === 13 || event.which === 9)) { if (autoCompletState.showSuggestions && (event.which === 13 || event.which === 9)) {
if (autoCompletState.userInput.length === 1) { if (autoCompletState.userInput.length === 1) {
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[0]).toString() })) setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[0]).toString() }))
} } else {
// else if (autoCompletState.activeSuggestion === 0) {
// setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: autoCompletState.userInput }))
// }
else {
console.log(autoCompletState.activeSuggestion, 'autoCompletState.userInput.length') console.log(autoCompletState.activeSuggestion, 'autoCompletState.userInput.length')
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[autoCompletState.activeSuggestion]).toString() })) setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[autoCompletState.activeSuggestion]).toString() }))
} }
@ -335,7 +331,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
const onMouseMove: any = (e: MouseEvent) => { const onMouseMove: any = (e: MouseEvent) => {
e.preventDefault() e.preventDefault()
if (dragging && leftHeight && separatorYPosition) { if (dragging && leftHeight && separatorYPosition) {
const newEditorHeight = leftHeight - e.clientY + separatorYPosition // const newEditorHeight = leftHeight - e.clientY + separatorYPosition
const newLeftHeight = leftHeight + separatorYPosition - e.clientY const newLeftHeight = leftHeight + separatorYPosition - e.clientY
setSeparatorYPosition(e.clientY) setSeparatorYPosition(e.clientY)
setLeftHeight(newLeftHeight) setLeftHeight(newLeftHeight)
@ -362,7 +358,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
React.useEffect(() => { React.useEffect(() => {
const leftRef = document.getElementById('terminal-view') const leftRef = document.getElementById('terminal-view')
const editorRef = document.getElementById('mainPanelPluginsContainer-id') // const editorRef = document.getElementById('mainPanelPluginsContainer-id')
if (leftRef) { if (leftRef) {
if (!leftHeight) { if (!leftHeight) {
setLeftHeight(leftRef.offsetHeight) setLeftHeight(leftRef.offsetHeight)
@ -539,7 +535,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
} }
} }
const txDetails = (event, tx, obj) => { const txDetails = (event, tx) => {
if (showTableHash.includes(tx.hash)) { if (showTableHash.includes(tx.hash)) {
const index = showTableHash.indexOf(tx.hash) const index = showTableHash.indexOf(tx.hash)
console.log({ index }) console.log({ index })
@ -725,13 +721,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
const renderUnKnownTransactions = (tx, receipt, index) => { const renderUnKnownTransactions = (tx, receipt, index) => {
const from = tx.from const from = tx.from
const to = tx.to const to = tx.to
const obj = { from, to } // const obj = { from, to }
const txType = 'unknown' + (tx.isCall ? 'Call' : 'Tx') const txType = 'unknown' + (tx.isCall ? 'Call' : 'Tx')
console.log('render unknown transaction ') console.log('render unknown transaction ')
return ( return (
<span id={`tx${tx.hash}`} key={index}> <span id={`tx${tx.hash}`} key={index}>
<div className="log" onClick={(event) => txDetails(event, tx, obj)}> <div className="log" onClick={(event) => txDetails(event, tx)}>
{/* onClick={e => txDetails(e, tx, data, obj)} */}
{checkTxStatus(receipt || tx, txType)} {checkTxStatus(receipt || tx, txType)}
{context({ from, to, tx }, props.blockchain)} {context({ from, to, tx }, props.blockchain)}
{ console.log('under context and checkTxStatus')} { console.log('under context and checkTxStatus')}
@ -763,12 +758,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
const renderKnownTransactions = (tx, receipt, resolvedData, logs, index) => { const renderKnownTransactions = (tx, receipt, resolvedData, logs, index) => {
const from = tx.from const from = tx.from
const to = resolvedData.contractName + '.' + resolvedData.fn const to = resolvedData.contractName + '.' + resolvedData.fn
const obj = { from, to } // const obj = { from, to }
const txType = 'knownTx' const txType = 'knownTx'
console.log('render unknown transaction ') console.log('render unknown transaction ')
return ( return (
<span id={`tx${tx.hash}`} key={index}> <span id={`tx${tx.hash}`} key={index}>
<div className="log" onClick={(event) => txDetails(event, tx, obj)}> <div className="log" onClick={(event) => txDetails(event, tx)}>
{checkTxStatus(receipt, txType)} {checkTxStatus(receipt, txType)}
{context({ from, to, tx }, props.blockchain)} {context({ from, to, tx }, props.blockchain)}
<div className='buttons'> <div className='buttons'>
@ -820,7 +815,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
const handlePaste = () => { const handlePaste = () => {
setPaste(true) setPaste(true)
setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false})) setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false }))
} }
return ( return (

Loading…
Cancel
Save