Skip to content

Commit c20bcb3

Browse files
rick23pRickk137tiltom
authored
SOV-4443: Rune Pools Market Making updates (#1013)
* feat: rune pool page update * Create honest-fans-fly.md * fix: rename pools prop * Hide highlighted pairs functionality --------- Co-authored-by: Peiman <25097709+Rickk137@users.noreply.github.com> Co-authored-by: tiltom <tilnak.tomas@gmail.com>
1 parent ef2f1ab commit c20bcb3

6 files changed

Lines changed: 42 additions & 4 deletions

File tree

.changeset/honest-fans-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frontend": patch
3+
---
4+
5+
SOV-4443: rune pool page update

apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ export const TESTNET_AMM = [
146146
ChainIds.RSK_TESTNET,
147147
'0x5fc0b3ac4683bd8af8e244e646d897a2c3f2a6ac',
148148
'0x64B1aC8301f64c92721804ed78f2ee6025aaf7cE',
149+
// undefined,
150+
// true,
149151
),
150152
new AmmLiquidityPool(
151153
COMMON_SYMBOLS.SOV,

apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,25 @@ export const MarketMaking: FC = () => {
5959
onClick={setIsPromoCardClicked}
6060
/>
6161

62+
{/* <Paragraph
63+
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
64+
size={ParagraphSize.base}
65+
>
66+
{t(translations.marketMakingPage.newPairs)}
67+
</Paragraph>
68+
<PoolsTable
69+
setActivePool={setActivePoolKey}
70+
shouldScroll={isPromoCardClicked}
71+
activePool={activePool}
72+
showHighlightedPools
73+
/>
74+
75+
<Paragraph
76+
className="pl-2 w-full text-base font-medium text-left mb-4 mt-8"
77+
size={ParagraphSize.base}
78+
>
79+
{t(translations.marketMakingPage.allPairs)}
80+
</Paragraph> */}
6281
<PoolsTable
6382
setActivePool={setActivePoolKey}
6483
shouldScroll={isPromoCardClicked}

apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/PoolsTable.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,28 @@ type PoolsTableProps = {
2424
activePool?: string;
2525
setActivePool: (poolKey: string) => void;
2626
shouldScroll?: boolean;
27+
showHighlightedPools?: boolean;
2728
};
2829

2930
export const PoolsTable: FC<PoolsTableProps> = ({
3031
activePool,
3132
setActivePool,
3233
shouldScroll = false,
34+
showHighlightedPools,
3335
}) => {
3436
const navigate = useNavigate();
3537
const { account } = useAccount();
3638
const tableRef = useRef<HTMLDivElement>(null);
3739

40+
const pools = useMemo(
41+
() =>
42+
ammPools.filter(pool => pool.isHighlighted === !!showHighlightedPools),
43+
[showHighlightedPools],
44+
);
45+
3846
const expandedIndex = useMemo(
39-
() => ammPools.findIndex(pool => pool.key === activePool),
40-
[activePool],
47+
() => pools.findIndex(pool => pool.key === activePool),
48+
[activePool, pools],
4149
);
4250

4351
const generateRowTitle = useCallback(
@@ -95,7 +103,7 @@ export const PoolsTable: FC<PoolsTableProps> = ({
95103
}, [activePool, shouldScroll]);
96104

97105
return (
98-
<div ref={tableRef} className="bg-gray-90 py-4 px-4 rounded w-full mt-8">
106+
<div ref={tableRef} className="bg-gray-90 py-4 px-4 rounded w-full">
99107
{account && (
100108
<div className="flex justify-end mb-2.5">
101109
<Button
@@ -110,7 +118,7 @@ export const PoolsTable: FC<PoolsTableProps> = ({
110118
)}
111119
<Table
112120
columns={COLUMNS_CONFIG}
113-
rows={ammPools}
121+
rows={pools}
114122
onRowClick={onPoolClick}
115123
expandedIndex={expandedIndex}
116124
className={styles.table}

apps/frontend/src/app/5_pages/MarketMakingPage/utils/AmmLiquidityPool.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class AmmLiquidityPool {
1919
public readonly converter: string,
2020
public readonly poolTokenA: string,
2121
public readonly poolTokenB?: string,
22+
public readonly isHighlighted?: boolean,
2223
) {
2324
if (converterVersion === 2 && !poolTokenB) {
2425
throw new Error(
@@ -32,6 +33,7 @@ export class AmmLiquidityPool {
3233
}
3334
this.converter = converter.toLowerCase();
3435
this.poolTokenA = poolTokenA.toLowerCase();
36+
this.isHighlighted = Boolean(isHighlighted);
3537
if (poolTokenB) {
3638
this.poolTokenB = poolTokenB.toLowerCase();
3739
}

apps/frontend/src/locales/en/translations.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,8 @@
13941394
"p2": "Next rewards recalibration on {{recalibrationDate}}.",
13951395
"learnMoreLink": "Learn more"
13961396
},
1397+
"newPairs": "New Pairs",
1398+
"allPairs": "All Pairs",
13971399
"rewards": "Rewards",
13981400
"poolsTable": {
13991401
"pair": "Pair",

0 commit comments

Comments
 (0)