diff --git a/src/components/BorrowCapacity.tsx b/src/components/BorrowCapacity.tsx
index 76eff4f9..93f9c306 100644
--- a/src/components/BorrowCapacity.tsx
+++ b/src/components/BorrowCapacity.tsx
@@ -5,7 +5,7 @@ import { FormattedNumber } from 'components/FormattedNumber'
import Text from 'components/Text'
import { Tooltip } from 'components/Tooltip'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
interface Props {
@@ -31,7 +31,10 @@ export const BorrowCapacity = ({
hideValues,
decimals = 2,
}: Props) => {
- const [reduceMotion] = useLocalStorage
(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const [reduceMotion] = useLocalStorage(
+ LocalStorageKeys.REDUCE_MOTION,
+ DEFAULT_SETTINGS.reduceMotion,
+ )
const [percentOfMaxRound, setPercentOfMaxRound] = useState(0)
const [percentOfMaxRange, setPercentOfMaxRange] = useState(0)
const [limitPercentOfMax, setLimitPercentOfMax] = useState(0)
diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx
index 27eebed4..63a7eab1 100644
--- a/src/components/Button/index.tsx
+++ b/src/components/Button/index.tsx
@@ -17,7 +17,7 @@ import { glowElement } from 'components/Button/utils'
import { CircularProgress } from 'components/CircularProgress'
import { ChevronDown } from 'components/Icons'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
const Button = React.forwardRef(function Button(
@@ -44,7 +44,10 @@ const Button = React.forwardRef(function Button(
}: ButtonProps,
ref,
) {
- const [reduceMotion] = useLocalStorage(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const [reduceMotion] = useLocalStorage(
+ LocalStorageKeys.REDUCE_MOTION,
+ DEFAULT_SETTINGS.reduceMotion,
+ )
const isDisabled = disabled || showProgressIndicator
const shouldShowText = text && !children
const shouldShowGlowElement = variant === 'solid' && !isDisabled && !reduceMotion
diff --git a/src/components/CheckMark.tsx b/src/components/CheckMark.tsx
index 0c20ba5d..7d6ee4ce 100644
--- a/src/components/CheckMark.tsx
+++ b/src/components/CheckMark.tsx
@@ -2,7 +2,7 @@ import classNames from 'classnames'
import { CheckCircled } from 'components/Icons'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
interface Props {
@@ -12,7 +12,10 @@ interface Props {
}
export const CheckMark = ({ color = '#FFFFFF', size = 20, className }: Props) => {
- const [reduceMotion] = useLocalStorage(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const [reduceMotion] = useLocalStorage(
+ LocalStorageKeys.REDUCE_MOTION,
+ DEFAULT_SETTINGS.reduceMotion,
+ )
const classes = classNames('inline-block relative', className)
if (reduceMotion)
diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx
index fee21e9b..5b27acc8 100644
--- a/src/components/Checkbox.tsx
+++ b/src/components/Checkbox.tsx
@@ -1,27 +1,39 @@
import classNames from 'classnames'
import { Check } from 'components/Icons'
+import Text from 'components/Text'
interface Props {
checked: boolean
onChange: (checked: boolean) => void
+ text?: string
}
export default function Checkbox(props: Props) {
return (
-
+
)
}
diff --git a/src/components/CircularProgress.tsx b/src/components/CircularProgress.tsx
index b48ff777..2aa318e6 100644
--- a/src/components/CircularProgress.tsx
+++ b/src/components/CircularProgress.tsx
@@ -1,7 +1,7 @@
import classNames from 'classnames'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
interface Props {
@@ -11,7 +11,10 @@ interface Props {
}
export const CircularProgress = ({ color = '#FFFFFF', size = 20, className }: Props) => {
- const [reduceMotion] = useLocalStorage(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const [reduceMotion] = useLocalStorage(
+ LocalStorageKeys.REDUCE_MOTION,
+ DEFAULT_SETTINGS.reduceMotion,
+ )
const borderWidth = `${size / 10}px`
const borderColor = `${color} transparent transparent transparent`
const loaderClasses = classNames('inline-block relative', className)
diff --git a/src/components/DisplayCurrency.tsx b/src/components/DisplayCurrency.tsx
index 8939deb3..f361201e 100644
--- a/src/components/DisplayCurrency.tsx
+++ b/src/components/DisplayCurrency.tsx
@@ -3,7 +3,7 @@ import { useMemo } from 'react'
import { FormattedNumber } from 'components/FormattedNumber'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { DISPLAY_CURRENCY_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import { ORACLE_DENOM } from 'constants/oracle'
import useLocalStorage from 'hooks/useLocalStorage'
import usePrices from 'hooks/usePrices'
@@ -22,7 +22,7 @@ interface Props {
export default function DisplayCurrency(props: Props) {
const displayCurrencies = getDisplayCurrencies()
const [displayCurrency] = useLocalStorage(
- DISPLAY_CURRENCY_KEY,
+ LocalStorageKeys.DISPLAY_CURRENCY,
DEFAULT_SETTINGS.displayCurrency,
)
const { data: prices } = usePrices()
diff --git a/src/components/Earn/Farm/VaultExpanded.tsx b/src/components/Earn/Farm/VaultExpanded.tsx
index 81071fe5..b9f70292 100644
--- a/src/components/Earn/Farm/VaultExpanded.tsx
+++ b/src/components/Earn/Farm/VaultExpanded.tsx
@@ -6,7 +6,7 @@ import Button from 'components/Button'
import { AccountArrowDown, LockLocked, LockUnlocked, Plus } from 'components/Icons'
import { Tooltip } from 'components/Tooltip'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { SLIPPAGE_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useAccountId from 'hooks/useAccountId'
import useLocalStorage from 'hooks/useLocalStorage'
import useStore from 'store'
@@ -22,7 +22,7 @@ export default function VaultExpanded(props: Props) {
const accountId = useAccountId()
const [isConfirming, setIsConfirming] = useState(false)
const withdrawFromVaults = useStore((s) => s.withdrawFromVaults)
- const [slippage] = useLocalStorage(SLIPPAGE_KEY, DEFAULT_SETTINGS.slippage)
+ const [slippage] = useLocalStorage(LocalStorageKeys.SLIPPAGE, DEFAULT_SETTINGS.slippage)
function depositMoreHandler() {
useStore.setState({
diff --git a/src/components/Earn/Farm/VaultUnlockBanner.tsx b/src/components/Earn/Farm/VaultUnlockBanner.tsx
index 84fbcaea..84e57c64 100644
--- a/src/components/Earn/Farm/VaultUnlockBanner.tsx
+++ b/src/components/Earn/Farm/VaultUnlockBanner.tsx
@@ -4,7 +4,7 @@ import Button from 'components/Button'
import { ChevronRight } from 'components/Icons'
import NotificationBanner from 'components/NotificationBanner'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { SLIPPAGE_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useAccountId from 'hooks/useAccountId'
import useLocalStorage from 'hooks/useLocalStorage'
import useStore from 'store'
@@ -17,7 +17,7 @@ export default function VaultUnlockBanner(props: Props) {
const accountId = useAccountId()
const [isConfirming, setIsConfirming] = useState(false)
const withdrawFromVaults = useStore((s) => s.withdrawFromVaults)
- const [slippage] = useLocalStorage(SLIPPAGE_KEY, DEFAULT_SETTINGS.slippage)
+ const [slippage] = useLocalStorage(LocalStorageKeys.SLIPPAGE, DEFAULT_SETTINGS.slippage)
async function handleWithdraw() {
if (!accountId) return
diff --git a/src/components/Earn/Lend/LendingActionButtons.tsx b/src/components/Earn/Lend/LendingActionButtons.tsx
index 76f74d27..01cc1870 100644
--- a/src/components/Earn/Lend/LendingActionButtons.tsx
+++ b/src/components/Earn/Lend/LendingActionButtons.tsx
@@ -3,7 +3,7 @@ import { useCallback } from 'react'
import { ACCOUNT_MENU_BUTTON_ID } from 'components/Account/AccountMenuContent'
import Button from 'components/Button'
import ActionButton from 'components/Button/ActionButton'
-import { ArrowDownLine, ArrowUpLine, Enter } from 'components/Icons'
+import { ArrowDownLine, ArrowUpLine, Enter, ExclamationMarkCircled } from 'components/Icons'
import Text from 'components/Text'
import { Tooltip } from 'components/Tooltip'
import ConditionalWrapper from 'hocs/ConditionalWrapper'
@@ -36,8 +36,9 @@ export default function LendingActionButtons(props: Props) {
const handleUnlend = useCallback(() => {
if (isAutoLendEnabledForCurrentAccount) {
showAlertDialog({
+ icon: ,
title: 'Disable Automatically Lend Assets',
- description:
+ content:
"Your auto-lend feature is currently enabled. To unlend your funds, please confirm if you'd like to disable this feature in order to continue.",
positiveButton: {
onClick: () => document.getElementById(ACCOUNT_MENU_BUTTON_ID)?.click(),
diff --git a/src/components/FormattedNumber.tsx b/src/components/FormattedNumber.tsx
index 798cb33c..964c49f8 100644
--- a/src/components/FormattedNumber.tsx
+++ b/src/components/FormattedNumber.tsx
@@ -3,7 +3,7 @@ import React, { useEffect, useRef } from 'react'
import { animated, useSpring } from 'react-spring'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
import { formatValue } from 'utils/formatters'
@@ -19,7 +19,7 @@ interface Props {
export const FormattedNumber = React.memo(
(props: Props) => {
const [reduceMotion] = useLocalStorage(
- REDUCE_MOTION_KEY,
+ LocalStorageKeys.REDUCE_MOTION,
DEFAULT_SETTINGS.reduceMotion,
)
const prevAmountRef = useRef(0)
diff --git a/src/components/Gauge.tsx b/src/components/Gauge.tsx
index 0e948498..b0f31e58 100644
--- a/src/components/Gauge.tsx
+++ b/src/components/Gauge.tsx
@@ -3,7 +3,7 @@ import { ReactElement, ReactNode } from 'react'
import { Tooltip } from 'components/Tooltip'
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
-import { REDUCE_MOTION_KEY } from 'constants/localStore'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
import useLocalStorage from 'hooks/useLocalStorage'
interface Props {
@@ -27,7 +27,10 @@ export const Gauge = ({
icon,
labelClassName,
}: Props) => {
- const [reduceMotion] = useLocalStorage(REDUCE_MOTION_KEY, DEFAULT_SETTINGS.reduceMotion)
+ const [reduceMotion] = useLocalStorage(
+ LocalStorageKeys.REDUCE_MOTION,
+ DEFAULT_SETTINGS.reduceMotion,
+ )
const radius = 16
const percentageValue = percentage > 100 ? 100 : percentage < 0 ? 0 : percentage
const circlePercent = 100 - percentageValue
diff --git a/src/components/HLS/Farm/HLSFarmIntro.tsx b/src/components/HLS/Farm/HLSFarmIntro.tsx
index 88bb9e17..a8952492 100644
--- a/src/components/HLS/Farm/HLSFarmIntro.tsx
+++ b/src/components/HLS/Farm/HLSFarmIntro.tsx
@@ -11,7 +11,7 @@ export default function HlsFarmIntro() {
bg='farm'
text={
<>
- Leverage farming is a strategy where users borrow
+ Leveraged farming is a strategy where users borrow
funds to increase their yield farming position, aiming to earn more in rewards than the
cost of the borrowed assets.
>
diff --git a/src/components/HLS/Farm/Table/Columns/Deposit.tsx b/src/components/HLS/Farm/Table/Columns/Deposit.tsx
index b833b643..c60ff38f 100644
--- a/src/components/HLS/Farm/Table/Columns/Deposit.tsx
+++ b/src/components/HLS/Farm/Table/Columns/Deposit.tsx
@@ -1,7 +1,13 @@
-import React from 'react'
+import classNames from 'classnames'
+import React, { useCallback } from 'react'
import ActionButton from 'components/Button/ActionButton'
+import { Enter } from 'components/Icons'
import Loading from 'components/Loading'
+import Text from 'components/Text'
+import { LocalStorageKeys } from 'constants/localStorageKeys'
+import useAlertDialog from 'hooks/useAlertDialog'
+import useLocalStorage from 'hooks/useLocalStorage'
export const DEPOSIT_META = { accessorKey: 'deposit', header: 'Deposit' }
@@ -13,7 +19,58 @@ interface Props {
export default function Deposit(props: Props) {
const { vault } = props
+ const [showHlsInfo, setShowHlsInfo] = useLocalStorage(
+ LocalStorageKeys.HLS_INFORMATION,
+ true,
+ )
+
+ const { open: openAlertDialog, close } = useAlertDialog()
+
+ const showHlsInfoModal = useCallback(() => {
+ if (!showHlsInfo) return
+ openAlertDialog({
+ title: 'Understanding HLS Positions',
+ content: (
+
+ {INFO_ITEMS.map((item) => (
+
+
+ {item.icon}
+
+
+ {item.title}
+ {item.description}
+
+
+ ))}
+
+ ),
+ positiveButton: {
+ text: 'Continue',
+ icon: ,
+ onClick: enterVaultHandler,
+ },
+ negativeButton: {
+ text: 'Cancel',
+ onClick: () => {
+ setShowHlsInfo(true)
+ close()
+ },
+ },
+ checkbox: {
+ text: "Don't show again",
+ onClick: (isChecked: boolean) => setShowHlsInfo(!isChecked),
+ },
+ })
+ }, [close, enterVaultHandler, openAlertDialog, setShowHlsInfo, showHlsInfo])
+
function enterVaultHandler() {
+ showHlsInfoModal()
return
}
@@ -25,3 +82,23 @@ export default function Deposit(props: Props) {
)
}
+
+const INFO_ITEMS = [
+ {
+ icon: