From 615692b1aa3adbfd9a649034ccd994e7c6d8fad1 Mon Sep 17 00:00:00 2001 From: Karim Dalaize Date: Thu, 8 Feb 2024 16:21:11 +0100 Subject: [PATCH] =?UTF-8?q?[Fixed]=C2=A0Merge=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drops/components/CsvFileInput/CsvFileInput.tsx | 7 ++++--- .../components/Modals/CancelDropModal/CancelDropModal.tsx | 2 +- .../Modals/EditDepositModal/EditDepositModal.tsx | 5 ++--- src/pages/MySavings/MySavings.tsx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/drops/components/CsvFileInput/CsvFileInput.tsx b/src/drops/components/CsvFileInput/CsvFileInput.tsx index 0b401d2f..c0e18ff5 100644 --- a/src/drops/components/CsvFileInput/CsvFileInput.tsx +++ b/src/drops/components/CsvFileInput/CsvFileInput.tsx @@ -2,10 +2,11 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useDropzone, ErrorCode } from 'react-dropzone'; import Papa from 'papaparse'; -import { LumConstants, LumUtils } from '@lum-network/sdk-javascript'; +import { LUM_DENOM, MICRO_LUM_DENOM, convertUnit } from '@lum-network/sdk-javascript'; import Assets from 'assets'; import { Card } from 'components'; +import { WalletUtils } from 'utils'; import './CsvFileInput.scss'; @@ -74,13 +75,13 @@ const CsvFileInput = (props: CsvFileInputProps): JSX.Element => { break; } - if (!LumUtils.isAddressValid(winnerAddress, 'lum')) { + if (!WalletUtils.isAddressValid(winnerAddress, 'lum')) { error = t('depositDrops.depositFlow.fileInputSubLabel.invalidAddress', { row: i + 1 }); break; } drops.push({ - amount: LumUtils.convertUnit({ amount: amount, denom: LumConstants.LumDenom }, LumConstants.MicroLumDenom), + amount: convertUnit({ amount: amount, denom: LUM_DENOM }, MICRO_LUM_DENOM), winnerAddress, }); } diff --git a/src/drops/pages/MyDeposits/components/Modals/CancelDropModal/CancelDropModal.tsx b/src/drops/pages/MyDeposits/components/Modals/CancelDropModal/CancelDropModal.tsx index 4f0234d4..dc125fde 100644 --- a/src/drops/pages/MyDeposits/components/Modals/CancelDropModal/CancelDropModal.tsx +++ b/src/drops/pages/MyDeposits/components/Modals/CancelDropModal/CancelDropModal.tsx @@ -17,7 +17,7 @@ const CancelDropModal = ({ deposits, limit }: { deposits?: DepositModel[]; limit const modalRef = useRef>(null); const isLoading = useSelector((state: RootState) => state.loading.effects.wallet.cancelDrop); - const pool = useSelector((state: RootState) => state.pools.pools.find((p) => (deposits && deposits.length > 0 ? p.poolId.eq(deposits[0]?.poolId) : undefined))); + const pool = useSelector((state: RootState) => state.pools.pools.find((p) => (deposits && deposits.length > 0 ? p.poolId === deposits[0]?.poolId : undefined))); const dispatch = useDispatch(); const steps = I18n.t('depositDrops.cancelDropModal.steps', { diff --git a/src/drops/pages/MyDeposits/components/Modals/EditDepositModal/EditDepositModal.tsx b/src/drops/pages/MyDeposits/components/Modals/EditDepositModal/EditDepositModal.tsx index bc4edfc8..e3bbe217 100644 --- a/src/drops/pages/MyDeposits/components/Modals/EditDepositModal/EditDepositModal.tsx +++ b/src/drops/pages/MyDeposits/components/Modals/EditDepositModal/EditDepositModal.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useRef, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; -import { LumUtils } from '@lum-network/sdk-javascript'; import Assets from 'assets'; @@ -18,7 +17,7 @@ const EditDepositModal = ({ deposit }: { deposit: DepositModel | null }) => { const modalRef = useRef>(null); const isLoading = useSelector((state: RootState) => state.loading.effects.wallet.editDrop); - const pool = useSelector((state: RootState) => state.pools.pools.find((p) => (deposit ? p.poolId.eq(deposit.poolId) : undefined))); + const pool = useSelector((state: RootState) => state.pools.pools.find((p) => (deposit ? p.poolId === deposit.poolId : undefined))); const dispatch = useDispatch(); const steps = I18n.t('depositDrops.editDropModal.steps', { @@ -53,7 +52,7 @@ const EditDepositModal = ({ deposit }: { deposit: DepositModel | null }) => { const onAddressChange = (newAddress: string) => { setAddress(newAddress); - if (newAddress && !LumUtils.isAddressValid(newAddress)) { + if (newAddress && !WalletUtils.isAddressValid(newAddress)) { setAddressError(I18n.t('errors.generic.invalid', { field: 'lum address' })); } else if (newAddress === deposit?.winnerAddress) { setAddressError(I18n.t('depositDrops.editDropModal.sameAddressError')); diff --git a/src/pages/MySavings/MySavings.tsx b/src/pages/MySavings/MySavings.tsx index c961b009..1bd6e03d 100644 --- a/src/pages/MySavings/MySavings.tsx +++ b/src/pages/MySavings/MySavings.tsx @@ -32,7 +32,7 @@ const MySavings = () => { useSelector((state: RootState) => ({ lumWallet: state.wallet.lumWallet, otherWallets: state.wallet.otherWallets, - balances: state.wallet.lumWallet?.balances.filter((balance) => state.pools.pools.find((pool) => pool.nativeDenom === balance.denom) || balance.denom === LumConstants.MicroLumDenom), + balances: state.wallet.lumWallet?.balances.filter((balance) => state.pools.pools.find((pool) => pool.nativeDenom === balance.denom) || balance.denom === MICRO_LUM_DENOM), activities: state.wallet.lumWallet?.activities, deposits: state.wallet.lumWallet?.deposits, prizes: state.wallet.lumWallet?.prizes,