From e4cd9bc13b9887cc80bf9ed004ccfcda95f3c42c Mon Sep 17 00:00:00 2001 From: Nuno Alexandre Date: Tue, 13 Aug 2024 16:27:23 +0200 Subject: [PATCH] Improve naming --- app/src/components/FeesPreview.tsx | 6 +++--- app/src/components/Transfer.tsx | 6 +++--- app/src/utils/transfer.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/components/FeesPreview.tsx b/app/src/components/FeesPreview.tsx index da7e6463..d6ad992c 100644 --- a/app/src/components/FeesPreview.tsx +++ b/app/src/components/FeesPreview.tsx @@ -8,11 +8,11 @@ import LoadingIcon from './svg/LoadingIcon' interface FeesPreviewProps { loading?: boolean fees?: Fees | null - estimate?: string + durationEstimate?: string hidden?: boolean } -const FeesPreview: FC = ({ loading, fees, estimate, hidden }) => { +const FeesPreview: FC = ({ loading, fees, durationEstimate, hidden }) => { const renderContent = () => { if (loading) { return ( @@ -42,7 +42,7 @@ const FeesPreview: FC = ({ loading, fees, estimate, hidden }) )}
- {estimate &&
{estimate}
} + {durationEstimate &&
{durationEstimate}
}
diff --git a/app/src/components/Transfer.tsx b/app/src/components/Transfer.tsx index d2f10ea0..fc8aacbc 100644 --- a/app/src/components/Transfer.tsx +++ b/app/src/components/Transfer.tsx @@ -18,7 +18,7 @@ import useSnowbridgeContext from '@/hooks/useSnowbridgeContext' import { Signer } from 'ethers' import useErc20Allowance from '@/hooks/useErc20Allowance' import { resolveDirection } from '@/services/transfer' -import { getEstimate } from '@/utils/transfer' +import { getDurationEstimate } from '@/utils/transfer' const Transfer: FC = () => { const { snowbridgeContext } = useSnowbridgeContext() @@ -77,7 +77,7 @@ const Transfer: FC = () => { const direction = sourceChain && destinationChain ? resolveDirection(sourceChain, destinationChain) : undefined - const estimate = direction ? getEstimate(direction) : undefined + const durationEstimate = direction ? getDurationEstimate(direction) : undefined return (
{ hidden={!isValid || requiresErc20SpendApproval} loading={loadingFees || !fees} fees={fees} - estimate={estimate} + durationEstimate={durationEstimate} /> {/* Transfer Button */} diff --git a/app/src/utils/transfer.ts b/app/src/utils/transfer.ts index ee863abd..236bc8a0 100644 --- a/app/src/utils/transfer.ts +++ b/app/src/utils/transfer.ts @@ -133,8 +133,8 @@ export function getExplorerLink(transfer: StoredTransfer): string | undefined { } } -//todo(team): query the right sdk to get the appropriate real-time estimate -export function getEstimate(direction: Direction): string { +//todo(team): query the right sdk to get the appropriate duration estimate +export function getDurationEstimate(direction: Direction): string { switch (direction) { case Direction.ToEthereum: return '~30 min to 4 hours'