Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
NunoAlexandre committed Aug 13, 2024
1 parent a130dce commit e4cd9bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/src/components/FeesPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<FeesPreviewProps> = ({ loading, fees, estimate, hidden }) => {
const FeesPreview: FC<FeesPreviewProps> = ({ loading, fees, durationEstimate, hidden }) => {
const renderContent = () => {
if (loading) {
return (
Expand Down Expand Up @@ -42,7 +42,7 @@ const FeesPreview: FC<FeesPreviewProps> = ({ loading, fees, estimate, hidden })
)}
</div>
<div className="flex items-center">
{estimate && <div className="text-turtle-foreground">{estimate}</div>}
{durationEstimate && <div className="text-turtle-foreground">{durationEstimate}</div>}
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/src/components/Transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 (
<form
Expand Down Expand Up @@ -226,7 +226,7 @@ const Transfer: FC = () => {
hidden={!isValid || requiresErc20SpendApproval}
loading={loadingFees || !fees}
fees={fees}
estimate={estimate}
durationEstimate={durationEstimate}
/>

{/* Transfer Button */}
Expand Down
4 changes: 2 additions & 2 deletions app/src/utils/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e4cd9bc

Please sign in to comment.