Skip to content

Commit

Permalink
chore: enable swaypoints (Swaylend#209)
Browse files Browse the repository at this point in the history
Co-authored-by: tadejpodrekar <tadej.podrekar@gmail.com>
  • Loading branch information
lutralabs-bot and tadejpodrekar committed Nov 26, 2024
1 parent e1567ab commit 81bdca0
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 309 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InfoIcon } from '@/components/InfoIcon';
import { type Point, PointIcons } from '@/components/PointIcons';
import { PointIcons } from '@/components/PointIcons';
import { POINTS_BORROW } from '@/components/PointIcons/PointsTooltip';
import { Title } from '@/components/Title';
import { Button } from '@/components/ui/button';
import {
Expand Down Expand Up @@ -51,46 +52,6 @@ import BigNumber from 'bignumber.js';
import Image from 'next/image';
import { useMemo } from 'react';

const POINTS_BORROW: Point[] = [
{
id: '1',
name: 'Activity Points',
description: (
<div className="text-md">
By Borrowing USDC on Swaylend you get{' '}
<span className="text-primary">4x</span> Fuel Points Multiplier:
<br />-{' '}
<span className="text-lavender font-semibold">
2x for Borrowing Activity
</span>
<br />-{' '}
<span className="text-lavender font-semibold">
2x for using USDC as Incentivised Asset
</span>
<br />
<br />
For more details, check out our{' '}
<a
href="https://swaylend.medium.com/incentivizing-useful-liquidity-on-swaylend-with-fuel-points-c2308be4b4c6"
className="text-primary underline"
target="_blank"
rel="noreferrer"
>
blog post
</a>
.
</div>
),
icon: SYMBOL_TO_ICON.FUEL,
},
// {
// id: '2',
// name: 'Swaylend',
// description: 'Earn Swaylend Points by lending assets',
// icon: SYMBOL_TO_ICON.SWAY,
// },
];

const SkeletonRow = (
<TableRow>
<TableCell>
Expand Down Expand Up @@ -286,7 +247,7 @@ export const BorrowTable = () => {
</TableCell>
<TableCell>{borrowedBalance}</TableCell>
<TableCell>
<PointIcons value="4x" points={POINTS_BORROW} />
<PointIcons points={POINTS_BORROW} />
</TableCell>
<TableCell>
{userRole === USER_ROLE.LENDER ? (
Expand Down Expand Up @@ -420,7 +381,7 @@ export const BorrowTable = () => {
<div className="w-1/2 text-moon font-medium">
Borrow Points
</div>
<PointIcons value="4x" points={POINTS_BORROW} />
<PointIcons points={POINTS_BORROW} />
</div>
</div>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AssetName } from '@/components/AssetName';
import { CircularProgressBar } from '@/components/CircularProgressBar';
import { InfoIcon } from '@/components/InfoIcon';
import { type Point, PointIcons } from '@/components/PointIcons';
import { PointIcons } from '@/components/PointIcons';
import { POINTS_COLLATERAL } from '@/components/PointIcons/PointsTooltip';
import { Title } from '@/components/Title';
import { Button } from '@/components/ui/button';
import {
Expand Down Expand Up @@ -70,61 +71,6 @@ type TableRowProps = {
price: BigNumber;
};

const POINTS_COLLATERAL: Point[] = [
{
id: '1',
name: 'Passive Points',
description: (
<div className="text-md">
Supply this asset as collateral to earn 1 Fuel Point per dollar value.
<br /> Earn up to a <span className="text-primary">2x</span> multiplier
if the collateral is actively used for borrowing.
<br />
<br />
For more details, check out our{' '}
<a
href="https://swaylend.medium.com/incentivizing-useful-liquidity-on-swaylend-with-fuel-points-c2308be4b4c6"
className="text-primary underline"
target="_blank"
rel="noreferrer"
>
blog post
</a>
.
</div>
),
icon: SYMBOL_TO_ICON.FUEL,
},
{
id: '2',
name: 'Passive Points',
description: (
<div className="text-md">
Supply this asset as collateral to earn 1 Fuel Point per dollar value.
<br />
<br />
For more details, check out our{' '}
<a
href="https://swaylend.medium.com/incentivizing-useful-liquidity-on-swaylend-with-fuel-points-c2308be4b4c6"
className="text-primary underline"
target="_blank"
rel="noreferrer"
>
blog post
</a>
.
</div>
),
icon: SYMBOL_TO_ICON.FUEL,
},
// {
// id: '2',
// name: 'Swaylend',
// description: 'Earn Swaylend Points by lending assets',
// icon: SYMBOL_TO_ICON.SWAY,
// },
];

const CollateralTableRow = ({
account,
assetId,
Expand Down Expand Up @@ -275,14 +221,16 @@ const CollateralTableRow = ({
</div>
</TableCell>
<TableCell>
<PointIcons
value={symbol === 'USDT' || symbol === 'ETH' ? '2x' : undefined}
points={
symbol === 'USDT' || symbol === 'ETH'
? [POINTS_COLLATERAL[0]]
: [POINTS_COLLATERAL[1]]
}
/>
<div className=" h-full flex items-center gap-x-2">
<PointIcons
points={[
...(symbol === 'USDT' || symbol === 'ETH'
? [POINTS_COLLATERAL[0]]
: [POINTS_COLLATERAL[1]]),
POINTS_COLLATERAL[2],
]}
/>
</div>
</TableCell>
<TableCell>
<div className="flex gap-x-2 w-full">
Expand Down Expand Up @@ -393,7 +341,14 @@ const CollateralCard = ({
</div>
<div className="w-full flex items-center">
<div className="w-1/2 text-moon font-medium">Supply Points</div>
<PointIcons points={POINTS_COLLATERAL} />
<PointIcons
points={[
...(symbol === 'USDT' || symbol === 'ETH'
? [POINTS_COLLATERAL[0]]
: [POINTS_COLLATERAL[1]]),
POINTS_COLLATERAL[2],
]}
/>
</div>
</div>
</CardContent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InfoIcon } from '@/components/InfoIcon';
import { type Point, PointIcons } from '@/components/PointIcons';
import { PointIcons } from '@/components/PointIcons';
import { POINTS_LEND } from '@/components/PointIcons/PointsTooltip';
import { Title } from '@/components/Title';
import { Button } from '@/components/ui/button';
import {
Expand Down Expand Up @@ -48,46 +49,6 @@ import * as VisuallyHidden from '@radix-ui/react-visually-hidden';
import BigNumber from 'bignumber.js';
import Image from 'next/image';

const POINTS_LEND: Point[] = [
{
id: '1',
name: 'Activity Points',
description: (
<div className="text-md">
By Lending USDC on Swaylend you get{' '}
<span className="text-primary">4x</span> Fuel Points Multiplier:
<br />-{' '}
<span className="text-lavender font-semibold">
2x for Lending Activity
</span>
<br />-{' '}
<span className="text-lavender font-semibold">
2x for using USDC as Incentivised Asset
</span>
<br />
<br />
For more details, check out our{' '}
<a
href="https://swaylend.medium.com/incentivizing-useful-liquidity-on-swaylend-with-fuel-points-c2308be4b4c6"
className="text-primary underline"
target="_blank"
rel="noreferrer"
>
blog post
</a>
.
</div>
),
icon: SYMBOL_TO_ICON.FUEL,
},
// {
// id: '2',
// name: 'Swaylend',
// description: 'Earn Swaylend Points by lending assets',
// icon: SYMBOL_TO_ICON.SWAY,
// },
];

const SkeletonRow = (
<TableRow>
<TableCell>
Expand Down Expand Up @@ -260,7 +221,7 @@ export const LendTable = () => {
{appConfig.assets[marketConfiguration?.baseToken.bits ?? '']}
</TableCell>
<TableCell>
<PointIcons value="4x" points={POINTS_LEND} />
<PointIcons points={POINTS_LEND} />
</TableCell>
<TableCell>
{userRole === USER_ROLE.BORROWER ? (
Expand Down Expand Up @@ -398,7 +359,7 @@ export const LendTable = () => {
<div className="w-1/2 text-moon font-medium">
Supply Points
</div>
<PointIcons value="4x" points={POINTS_LEND} />
<PointIcons points={POINTS_LEND} />
</div>
</div>
</CardContent>
Expand Down
Loading

0 comments on commit 81bdca0

Please sign in to comment.