|
1 |
| -import React, { useContext, useState, useEffect, createRef } from 'react'; |
| 1 | +import React, { useContext, useState, useEffect } from 'react'; |
2 | 2 | import Modal from 'react-bootstrap/Modal';
|
3 | 3 | import { toast } from 'react-toastify';
|
4 | 4 | import { useHistory } from 'react-router-dom';
|
@@ -148,8 +148,6 @@ const BridgeComponent = () => {
|
148 | 148 |
|
149 | 149 | const [showTokensListModal, setShowTokensListModal] = useState(false);
|
150 | 150 |
|
151 |
| -const inputRef = createRef(); |
152 |
| - |
153 | 151 | useEffect(() => {
|
154 | 152 | if (document.getElementById('inputValue')) {
|
155 | 153 | document.getElementById('inputValue').value = 0;
|
@@ -355,14 +353,16 @@ const BridgeComponent = () => {
|
355 | 353 | }, [token, txType, accountInstance]);
|
356 | 354 |
|
357 | 355 | const updateInputValue = () => {
|
358 |
| -const inputElement = document.querySelector('nightfall-app').shadowRoot.getElementById('inputValue'); |
| 356 | +const inputElement = document |
| 357 | +.querySelector('nightfall-app') |
| 358 | +.shadowRoot.getElementById('inputValue'); |
359 | 359 | if (txType === 'deposit') {
|
360 | 360 | inputElement.value = new BigFloat(l1Balance, token.decimals).toFixed(4);
|
361 | 361 | setTransferValue(l1Balance);
|
362 | 362 | return;
|
363 | 363 | }
|
364 | 364 | inputElement.value = new BigFloat(l2Balance, token.decimals).toFixed(4);
|
365 |
| -setTransferValue(l2Balance); |
| 365 | +setTransferValue(l2Balance); |
366 | 366 | };
|
367 | 367 |
|
368 | 368 | return (
|
@@ -425,7 +425,7 @@ const BridgeComponent = () => {
|
425 | 425 | <Input
|
426 | 426 | id="inputValue"
|
427 | 427 | name="price"
|
428 |
| -placeholder="0.00" |
| 428 | +placeholder="0.00" |
429 | 429 | onKeyDown={e => {
|
430 | 430 | if (
|
431 | 431 | (transferValue.toString().split('.')[1]?.length ?? 0) > 3 &&
|
|
0 commit comments