Skip to content

Commit fd6f1e1

Browse files
committed
feat: update Market page
1 parent 91c7497 commit fd6f1e1

62 files changed

Lines changed: 1249 additions & 1244 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/flat-dots-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@venusprotocol/evm": minor
3+
---
4+
5+
update Market page

apps/evm/src/__mocks__/models/asset.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const assetData: Asset[] = [
2020
reserveTokens: new BigNumber(1000),
2121
cashTokens: new BigNumber(10),
2222
tokenPriceCents: new BigNumber('127.86734'),
23+
tokenPriceOracleAddress: '0xfakeResilientOracle',
2324
liquidityCents: new BigNumber(8036465875),
2425
badDebtMantissa: 6789000000000000000n,
2526
supplierCount: 100,
@@ -92,6 +93,7 @@ export const assetData: Asset[] = [
9293
reserveTokens: new BigNumber(1000),
9394
cashTokens: new BigNumber(10),
9495
tokenPriceCents: new BigNumber('99.99364'),
96+
tokenPriceOracleAddress: '0xfakeResilientOracle',
9597
liquidityCents: new BigNumber(1702951959),
9698
badDebtMantissa: 0n,
9799
supplierCount: 100,
@@ -182,6 +184,7 @@ export const assetData: Asset[] = [
182184
reserveTokens: new BigNumber(1000),
183185
cashTokens: new BigNumber(10),
184186
tokenPriceCents: new BigNumber('100.024602'),
187+
tokenPriceOracleAddress: '0xfakeChainlinkOracle',
185188
liquidityCents: new BigNumber(5534102886),
186189
badDebtMantissa: 0n,
187190
supplierCount: 100,
@@ -268,6 +271,7 @@ export const assetData: Asset[] = [
268271
reserveTokens: new BigNumber(1000),
269272
cashTokens: new BigNumber(10),
270273
tokenPriceCents: new BigNumber('100.000922'),
274+
tokenPriceOracleAddress: '0xfakeChainlinkOracle',
271275
liquidityCents: new BigNumber(3654492935),
272276
badDebtMantissa: 0n,
273277
supplierCount: 100,

apps/evm/src/clients/api/queries/useGetPools/__tests__/__snapshots__/index.eMode.spec.ts.snap

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

apps/evm/src/clients/api/queries/useGetPools/getPools/formatOutput/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ export const formatOutput = ({
266266
vToken,
267267
disabledTokenActions,
268268
tokenPriceCents,
269+
tokenPriceOracleAddress:
270+
correspondingOraclePrice.priceOracleAddress ?? correspondingOraclePrice.mainOracleAddress,
269271
reserveFactor,
270272
collateralFactor,
271273
liquidationThresholdPercentage,

apps/evm/src/clients/api/queries/useGetPools/getPools/getApiPools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ export interface ApiTokenPrice {
143143
priceMantissa: string;
144144
priceSource: 'oracle' | 'merkl' | 'coingecko';
145145
priceOracleAddress: Address | null;
146+
mainOracleName: string;
147+
mainOracleAddress: Address;
146148
isPriceInvalid: boolean;
147149
hasErrorFetchingPrice: boolean;
148150
}

apps/evm/src/components/CellGroup/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export const CellGroup: React.FC<CellGroupProps> = ({
2727
'p-4 grid grid-cols-2 rounded-xl gap-4 sm:flex sm:flex-wrap sm:gap-0 sm:px-6 sm:py-4',
2828
variant === 'secondary' &&
2929
'p-0 flex overflow-y-auto scrollbar-hidden bg-transparent sm:p-0 md:p-0 xl:p-0',
30-
variant === 'tertiary' &&
31-
'gap-2 bg-transparent p-0 grid grid-cols-2 sm:p-0 xl:bg-cards xl:flex xl:p-6 xl:flex-wrap xl:rounded-xl xl:gap-x-0',
30+
variant === 'tertiary' && 'flex flex-wrap p-0 gap-x-6 gap-y-3 sm:grid sm:grid-cols-3 md:flex',
3231
className,
3332
)}
3433
{...containerProps}
@@ -50,10 +49,10 @@ export const CellGroup: React.FC<CellGroupProps> = ({
5049
{index < cells.length - 1 && (
5150
<div
5251
className={cn(
53-
'w-px self-stretch shrink-0 bg-dark-grey',
52+
'w-px self-stretch shrink-0 bg-dark-blue-hover',
5453
variant === 'primary' && 'hidden sm:block',
5554
variant === 'secondary' && 'bg-white/10',
56-
variant === 'tertiary' && 'hidden xl:block',
55+
variant === 'tertiary' && 'hidden md:block',
5756
)}
5857
/>
5958
)}

apps/evm/src/components/Table/TableCards/MarketCard/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export interface MarketCardProps<R> {
1212
row: R;
1313
index: number;
1414
columns: TableProps<R>['columns'];
15-
key: string;
1615
href?: To;
1716
onClick?: TableProps<R>['rowOnClick'];
1817
onControlClick?: TableProps<R>['rowControlOnClick'];
@@ -27,7 +26,6 @@ export function MarketCard<R>({
2726
onClick,
2827
onControlClick,
2928
className,
30-
key,
3129
}: MarketCardProps<R>) {
3230
const [titleColumn, ...otherColumns] = columns;
3331

@@ -43,7 +41,7 @@ export function MarketCard<R>({
4341

4442
<div className="space-y-6">
4543
{otherColumns.map(column => (
46-
<LabeledInlineContent key={`${key}-${column.key}`} label={column.label}>
44+
<LabeledInlineContent key={column.key} label={column.label}>
4745
<div className="text-right inline-flex">{column.renderCell(row, index)}</div>
4846
</LabeledInlineContent>
4947
))}
@@ -59,7 +57,6 @@ export function MarketCard<R>({
5957
)}
6058
asChild
6159
onClick={e => onClick?.(e, row)}
62-
key={key}
6360
>
6461
{href ? (
6562
<Link className="text-white no-underline hover:no-underline" noStyle to={href}>

apps/evm/src/components/Table/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function Table<R>({
3636
breakpoint,
3737
isFetching,
3838
variant = 'primary',
39+
size = 'md',
3940
header,
4041
placeholder,
4142
selectVariant,
@@ -144,6 +145,7 @@ export function Table<R>({
144145
rounded: variant === 'secondary',
145146
}),
146147
]}
148+
className={cn(size === 'md' ? 'h-18' : 'h-14')}
147149
onClick={rowOnClick ? e => rowOnClick(e, row) : undefined}
148150
{...additionalProps}
149151
>

apps/evm/src/components/Table/styles.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ export const useStyles = (props?: StylesProps) => {
8989
}
9090
`,
9191
getTableRow: ({ clickable, rounded }: { clickable: boolean; rounded: boolean }) => css`
92-
height: ${theme.spacing(18)};
93-
9492
:hover {
9593
background-color: ${theme.palette.interactive.hover} !important;
9694
overflow: hidden;

apps/evm/src/components/Table/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface TableProps<R> extends Omit<CardProps, 'title'> {
3838
selectVariant?: SelectProps['variant'];
3939
cellHeight?: CSSProperties['height'];
4040
variant?: 'primary' | 'secondary';
41+
size?: 'sm' | 'md';
4142
controls?: boolean;
4243
}
4344

0 commit comments

Comments
 (0)