Skip to content
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f8fc2f6
feat: display strategy names instead of asset symbols in yield cards
gomesalexandre Jan 16, 2026
fca42a0
feat: add maintenance and deprecated warnings for yield opportunities
gomesalexandre Jan 16, 2026
e7b34e7
chore: add temporary monkey patch for testing maintenance/deprecated …
gomesalexandre Jan 16, 2026
ea4338b
chore: remove temporary monkey patch for maintenance/deprecated badges
gomesalexandre Jan 16, 2026
6ebcbc0
feat: add YieldExplainers component for consistent staking info
gomesalexandre Jan 16, 2026
1555437
feat: add documentation link to yield detail page
gomesalexandre Jan 16, 2026
3784581
feat: add yield explainers to YieldForm and improve docs link
gomesalexandre Jan 16, 2026
9f1e96a
feat: add Available to Earn tab and improve yield page navigation
gomesalexandre Jan 16, 2026
ec27e2b
feat: improve yield page UX with filter fixes and code cleanup
gomesalexandre Jan 16, 2026
f90fac7
feat: swap fiat/crypto display on yield detail page
gomesalexandre Jan 16, 2026
1e247f3
feat: improve yield detail page desktop layout with two-column design
gomesalexandre Jan 16, 2026
b18f7ab
feat: fix validator mismatch bug and add New badge to Yields menu
gomesalexandre Jan 16, 2026
eb59b8d
feat: add getYieldDisplayName utility for clean yield names
gomesalexandre Jan 16, 2026
3969437
feat: improve asset/chain/protocol display with icon + label format
gomesalexandre Jan 16, 2026
6abea3f
refactor: use named functions in memo() for better debugging
gomesalexandre Jan 16, 2026
b24cbd9
feat: commit best practices skill
gomesalexandre Jan 16, 2026
2d8bb8d
chore: add project-specific style preferences to react-best-practices…
gomesalexandre Jan 16, 2026
cccc386
refactor: improve yields code quality and patterns
gomesalexandre Jan 16, 2026
fa85b17
fix: add null coalescing to prevent runtime error in sort comparator
gomesalexandre Jan 16, 2026
e872c09
fix: guard claimable section against zero-amount balances
gomesalexandre Jan 16, 2026
f89c34a
style updates
reallybeard Jan 19, 2026
9bddb08
Update LazyLoadAvatar.tsx
reallybeard Jan 19, 2026
d351bda
Merge branch 'develop' into style-updates
reallybeard Jan 19, 2026
d96f4f1
fixes
reallybeard Jan 19, 2026
50f7112
rabbits
reallybeard Jan 19, 2026
188dd3d
updates
reallybeard Jan 19, 2026
4778649
revert: restore useMemo in YieldItem.tsx
reallybeard Jan 19, 2026
e61b227
remove stuff
reallybeard Jan 19, 2026
8d1f174
Update YieldDetail.tsx
reallybeard Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/assets/translations/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,10 @@
"potentialEarningsAmount": "%{amount}/yr at %{apy}% APY",
"depositNow": "Deposit Now",
"strategyInfo": "Strategy Info",
"overview": "Overview"
"overview": "Overview",
"availableToAdd": "%{amount} %{symbol} available",
"earnUpTo": "Earn up to",
"addMore": "Add More"
},
"earn": {
"enterFrom": "Enter from",
Expand Down
17 changes: 14 additions & 3 deletions src/components/AccountSelector/AccountSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@ export type AccountSelectorProps = {
disabled?: boolean
buttonProps?: ButtonProps
boxProps?: BoxProps
showBalance?: boolean
showIcon?: boolean
}

const chevronIconSx = {
svg: { h: '18px', w: '18px' },
}

export const AccountSelector: FC<AccountSelectorProps> = memo(
({ assetId, accountId: selectedAccountId, onChange, disabled, buttonProps, boxProps }) => {
({
assetId,
accountId: selectedAccountId,
onChange,
disabled,
buttonProps,
boxProps,
showBalance = true,
showIcon = true,
}) => {
const translate = useTranslate()
const { isOpen, onOpen, onClose } = useDisclosure()
const {
Expand Down Expand Up @@ -120,7 +131,7 @@ export const AccountSelector: FC<AccountSelectorProps> = memo(
{...buttonProps}
>
<HStack spacing={3} flex={1}>
<AssetIcon assetId={assetId} size='sm' borderRadius='full' />
{showIcon && <AssetIcon assetId={assetId} size='sm' borderRadius='full' />}
<VStack align='start' spacing={0} flex={1}>
{accountNumber !== undefined && (
<Text fontSize='xs' color='text.subtle'>
Expand All @@ -132,7 +143,7 @@ export const AccountSelector: FC<AccountSelectorProps> = memo(
<MiddleEllipsis value={fromAccountId(selectedAccountId).account} />
)}
</Text>
{selectedAccountDetails && (
{selectedAccountDetails && showBalance && (
<Flex alignItems='center' gap={1}>
<Amount.Crypto
value={selectedAccountDetails.cryptoBalance}
Expand Down
16 changes: 14 additions & 2 deletions src/components/Avatar/Avatar.theme.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u sure?

Image

Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
export const AVATAR_SIZES = {
'2xs': '1rem',
xs: '1.5rem',
sm: '2rem',
md: '2.5rem',
lg: '3.5rem',
xl: '4rem',
'2xl': '5rem',
} as const

export type AvatarSize = keyof typeof AVATAR_SIZES

export const AvatarStyle = {
sizes: {
md: {
container: {
'--avatar-size': '2.5rem',
'--avatar-size': AVATAR_SIZES.md,
},
},
lg: {
container: {
'--avatar-size': '3.5rem',
'--avatar-size': AVATAR_SIZES.lg,
},
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/components/Button/Button.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const ButtonStyle: ComponentStyleConfig = {
variants: {
solid: (props: StyleFunctionProps) => {
const { colorScheme: c } = props
const isGreen = c === 'green'
if (c === 'gray') {
return {
bg: 'background.button.secondary.base',
Expand All @@ -79,8 +80,11 @@ export const ButtonStyle: ComponentStyleConfig = {
return {
bg: `${c}.500`,
color: 'white',
_dark: {
color: isGreen ? 'black' : 'white',
},
_hover: {
bg: mode(`${c}.600`, `${c}.300`)(props),
bg: mode(`${c}.500`, `${c}.300`)(props),
_disabled: {
bg: `${c}.500`,
},
Expand Down
3 changes: 2 additions & 1 deletion src/components/Card/Card.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export const CardStyle = {
elevated: () => ({
container: {
bg: 'background.surface.raised.base',
borderColor: 'border.base',
boxShadow:
'0 1px 0 var(--chakra-colors-border-base) inset, 0 0 0 1px var(--chakra-colors-border-base) inset',
Comment on lines +47 to +48

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah also not sure about this one

Image

},
}),
unstyled: {
Expand Down
18 changes: 10 additions & 8 deletions src/components/LazyLoadAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import type { AvatarProps, SkeletonProps } from '@chakra-ui/react'
import { Avatar, SkeletonCircle } from '@chakra-ui/react'
import { useCallback, useState } from 'react'
import { useCallback, useMemo, useState } from 'react'

import type { AvatarSize } from '@/components/Avatar/Avatar.theme'
import { AVATAR_SIZES } from '@/components/Avatar/Avatar.theme'
import { imageLongPressSx } from '@/constants/longPress'

export type LazyLoadAvatarProps = SkeletonProps &
Pick<AvatarProps, 'src' | 'size' | 'boxSize' | 'name' | 'icon' | 'bg'>
Pick<AvatarProps, 'src' | 'boxSize' | 'name' | 'icon' | 'bg' | 'size'>

export const LazyLoadAvatar: React.FC<LazyLoadAvatarProps> = ({
src,
size = 'sm',
borderRadius,
name,
icon,
boxSize,
bg,
...rest
}) => {
Expand All @@ -22,12 +23,14 @@ export const LazyLoadAvatar: React.FC<LazyLoadAvatarProps> = ({
const handleImageLoaded = useCallback(() => setImageLoaded(true), [])
const handleImageError = useCallback(() => setImageError(true), [])

const skeletonSize = useMemo(() => {
return AVATAR_SIZES[size as AvatarSize] ?? AVATAR_SIZES.md
}, [size])

return (
<SkeletonCircle
isLoaded={Boolean(imageLoaded || (imageError && name))}
width='auto'
height='auto'
display='flex'
size={skeletonSize}
borderRadius={borderRadius}
{...rest}
>
Expand All @@ -36,9 +39,8 @@ export const LazyLoadAvatar: React.FC<LazyLoadAvatarProps> = ({
onLoad={handleImageLoaded}
onError={handleImageError}
src={src}
size={size}
icon={icon}
boxSize={boxSize}
boxSize='100%'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this expected?

name={name}
borderRadius={borderRadius}
sx={imageLongPressSx}
Expand Down
47 changes: 47 additions & 0 deletions src/lib/yieldxyz/providerDescriptions.ts
Comment thread
reallybeard marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export const PROVIDER_DESCRIPTIONS: Record<
string,
{
description: string
}
> = {
morpho: {
description:
'Morpho is a money market and vault infrastructure protocol, multiply audited by top-tier security firms, live since 2022, with $2.5M in bug bounty incentives.',
},
'morpho-aave': {
description:
'Morpho is a money market and vault infrastructure protocol, multiply audited by top-tier security firms, live since 2022, with $2.5M in bug bounty incentives.',
},
'morpho-compound': {
description:
'Morpho is a money market and vault infrastructure protocol, multiply audited by top-tier security firms, live since 2022, with $2.5M in bug bounty incentives.',
},
lido: {
description:
'Lido is a liquid staking protocol that lets users stake ETH while keeping liquidity via stETH. Multiply audited by top-tier security firms, live since 2020, with $2M in bug bounty incentives.',
},
aave: {
description:
'Aave is a multi-chain lending marketplace enabling users to lend, borrow, and build advanced strategies. Multiply audited by top-tier security firms, live since 2017, with $1M in bug bounty incentives.',
},
compound: {
description:
'Compound is a foundational DeFi money market with algorithmic interest rates. Multiply audited by top-tier security firms, live since 2018, with $1M in bug bounty incentives.',
},
kamino: {
description:
'Kamino is a Solana DeFi suite unifying lending, liquidity, and leverage into one platform. Runs an Immunefi program with up to $1.5M maximum bounty.',
},
fluid: {
description:
'Fluid is a liquidity layer built by the Instadapp team, connecting lending, DEX, borrowing, and stablecoin markets into one efficient system. Multiply audited by top-tier security firms, live since 2024, with $0.5M in bug bounty incentives.',
},
venus: {
description:
'Venus is a lending and borrowing protocol focused on BNB Chain. Emphasizes security through third-party audits and an ongoing bug bounty program.',
},
gearbox: {
description:
'Gearbox is a composable leverage protocol enabling credit accounts that plug into DeFi strategies. Multiply audited by top-tier security firms, live since 2021, with $0.2M in bug bounty incentives.',
},
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
86 changes: 49 additions & 37 deletions src/pages/Yields/YieldAssetDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Avatar,
Box,
Button,
Container,
Flex,
Heading,
HStack,
Expand All @@ -23,6 +22,7 @@ import { Amount } from '@/components/Amount/Amount'
import { AssetIcon } from '@/components/AssetIcon'
import { ChainIcon } from '@/components/ChainMenu'
import { Display } from '@/components/Display'
import { Main } from '@/components/Layout/Main'
import { useFeatureFlag } from '@/hooks/useFeatureFlag/useFeatureFlag'
import { bnOrZero } from '@/lib/bignumber/bignumber'
import {
Expand Down Expand Up @@ -531,42 +531,54 @@ export const YieldAssetDetails = memo(() => {
effectiveViewMode,
])

const headerComponent = useMemo(
() => (
<>
<Button
leftIcon={<ArrowBackIcon />}
variant='ghost'
onClick={() => navigate('/yields')}
mb={6}
>
{translate('common.back')}
</Button>
{assetHeaderElement}
</>
),
[assetHeaderElement, navigate, translate],
)

const containerPaddingX = useMemo(() => ({ base: 4, xl: 0 }), [])

return (
<Container maxW='1200px' py={{ base: 4, md: 8 }} px={{ base: 4, md: 6 }}>
<Button
leftIcon={<ArrowBackIcon />}
variant='ghost'
onClick={() => navigate('/yields')}
mb={6}
>
{translate('common.back')}
</Button>
{assetHeaderElement}
<Flex
justify='flex-end'
align={{ base: 'stretch', md: 'center' }}
mb={6}
gap={4}
direction={{ base: 'column', md: 'row' }}
width='full'
display={isMobile ? 'none' : 'flex'}
>
<YieldFilters
networks={networks}
selectedNetwork={selectedNetwork}
onSelectNetwork={handleNetworkChange}
providers={providers}
selectedProvider={selectedProvider}
onSelectProvider={handleProviderChange}
types={types}
selectedType={selectedType}
onSelectType={handleTypeChange}
sortOption={sortOption}
onSortChange={handleSortChange}
/>
<ViewToggle viewMode={viewMode} setViewMode={setViewMode} />
</Flex>
{contentElement}
</Container>
<Main headerComponent={headerComponent} isSubPage>
<Box py={4} px={containerPaddingX}>
<Flex
justify='flex-end'
align={{ base: 'stretch', md: 'center' }}
mb={6}
gap={4}
direction={{ base: 'column', md: 'row' }}
width='full'
display={isMobile ? 'none' : 'flex'}
>
<YieldFilters
networks={networks}
selectedNetwork={selectedNetwork}
onSelectNetwork={handleNetworkChange}
providers={providers}
selectedProvider={selectedProvider}
onSelectProvider={handleProviderChange}
types={types}
selectedType={selectedType}
onSelectType={handleTypeChange}
sortOption={sortOption}
onSortChange={handleSortChange}
/>
<ViewToggle viewMode={viewMode} setViewMode={setViewMode} />
</Flex>
{contentElement}
</Box>
</Main>
)
})
Loading
Loading