Skip to content

Commit

Permalink
Calculate points when min amount met
Browse files Browse the repository at this point in the history
  • Loading branch information
kpyszkowski committed Nov 8, 2024
1 parent d39606e commit bd921a0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { H4, TextMd } from "#/components/shared/Typography"
import { numberToLocaleString } from "#/utils"
import { IconChevronDown } from "@tabler/icons-react"
import { TOKEN_AMOUNT_FIELD_NAME } from "#/components/shared/TokenAmountForm/TokenAmountFormBase"
import { useFormField } from "#/hooks"
import { useFormField, useMinDepositAmount } from "#/hooks"
import { ONE_MONTH_IN_DAYS, ONE_WEEK_IN_DAYS } from "#/constants"

const ACRE_POINTS_DATA = {
Expand Down Expand Up @@ -48,7 +48,10 @@ function AcrePointsRewardEstimation(props: StackProps) {
const { value = 0n } = useFormField<bigint | undefined>(
TOKEN_AMOUNT_FIELD_NAME,
)
const baseReward = Number(value)
const minDepositAmount = useMinDepositAmount()
const amount = value >= minDepositAmount ? value : 0n

const baseReward = Number(amount)
const pointsRate = 10000

const estimatedReward = useMemo(
Expand Down

0 comments on commit bd921a0

Please sign in to comment.