Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
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
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
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
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