Skip to content

Commit 2c1465c

Browse files
committed
fix: display unit of PriceDefinitionField based on chainId
1 parent c8ba556 commit 2c1465c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pages/TranslationRequest/PriceDefinitionFields.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
22
import t from 'prop-types';
3-
import { useSelector } from 'react-redux';
43
import styled from 'styled-components';
54
import { Col, Form, Input } from 'antd';
65
import { InputNumberWithAddons } from '~/adapters/antd';
7-
import { selectAccount, selectChainId } from '~/features/web3/web3Slice';
6+
87
import { InfoIcon } from '~/shared/icons';
98
import PriceDefinitionInfographic from '~/shared/PriceDefinitionInfographic';
109
import Spacer from '~/shared/Spacer';
1110
import { getBestDisplayUnit } from '~/shared/EthValue';
11+
import { useWeb3 } from '~/hooks/useWeb3';
1212

1313
export default function PriceDefinitionFieldsWrapper() {
1414
return (
@@ -26,8 +26,7 @@ export default function PriceDefinitionFieldsWrapper() {
2626
const MIN_REPRESENTABLE_VALUE = 0.000000000000000001;
2727

2828
function PriceDefinitionFields({ setFieldsValue, getFieldValue }) {
29-
const account = useSelector(selectAccount);
30-
const chainId = useSelector(selectChainId);
29+
const { account, chainId } = useWeb3();
3130
const displayUnit = getBestDisplayUnit({ chainId, amount: '0' }).suffix.short;
3231

3332
const [minMaxPriceNumeric, setMinMaxPriceNumeric] = React.useState(MIN_REPRESENTABLE_VALUE);

0 commit comments

Comments
 (0)