Skip to content

Commit 2184980

Browse files
committed
chore(new-issuer): refactor condition test as a variable
1 parent b85a567 commit 2184980

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

  • packages/new-polymath-issuer/src/pages/DividendsWizard/Step-3

packages/new-polymath-issuer/src/pages/DividendsWizard/Step-3/index.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ const Step3Base: FC<Props> = ({
127127

128128
const [erc20TokenSymbol, setErc20TokenSymbol] = useState('');
129129

130+
const isTestNet = [
131+
constants.NetworkIds.Kovan,
132+
constants.NetworkIds.Local,
133+
constants.NetworkIds.LocalVm,
134+
].includes(networkId);
135+
130136
useEffect(
131137
() => {
132138
const { isSubmitting, submitEvent } = formSubmissionStatus;
@@ -218,12 +224,6 @@ const Step3Base: FC<Props> = ({
218224
});
219225

220226
const difference = dividendAmount.minus(balance);
221-
222-
const isTestNet = [
223-
constants.NetworkIds.Kovan,
224-
constants.NetworkIds.Local,
225-
constants.NetworkIds.LocalVm,
226-
].includes(networkId);
227227
const willUseFaucet = isTestNet && currency === types.Tokens.Poly;
228228

229229
if (!willUseFaucet && difference.gte(0)) {
@@ -351,22 +351,22 @@ const Step3Base: FC<Props> = ({
351351
},
352352
{
353353
value: types.Tokens.Gusd,
354-
isDisabled: networkId === constants.NetworkIds.Kovan,
354+
isDisabled: isTestNet,
355355
},
356356
{
357357
value: types.Tokens.Pax,
358-
isDisabled: true,
358+
isDisabled: isTestNet,
359359
},
360360
{
361361
value: types.Tokens.Poly,
362362
},
363363
{
364364
value: types.Tokens.Usdc,
365-
isDisabled: networkId === constants.NetworkIds.Kovan,
365+
isDisabled: isTestNet,
366366
},
367367
{
368368
value: types.Tokens.Usdt,
369-
isDisabled: networkId === constants.NetworkIds.Kovan,
369+
isDisabled: isTestNet,
370370
},
371371
],
372372
placeholder: 'Choose currency',

0 commit comments

Comments
 (0)