-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(market): maket lp rewards (#253)
* feat(market): maket lp rewards * wip: vdot * wip: ui
- Loading branch information
1 parent
6444335
commit f469f68
Showing
19 changed files
with
407 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
apps/market/components/MarketSection/MarketRewards/MarketLPRewards.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { Trans } from '@lingui/macro' | ||
import type { Amount, Token } from '@zenlink-interface/currency' | ||
import { Currency, Typography } from '@zenlink-interface/ui' | ||
import { type FC, useMemo } from 'react' | ||
|
||
interface MarketLPRewardsProps { | ||
isLoading: boolean | ||
isError: boolean | ||
data: Amount<Token>[] | undefined | ||
} | ||
|
||
export const MarketLPRewards: FC<MarketLPRewardsProps> = ({ data, isLoading, isError }) => { | ||
const rewards = useMemo(() => { | ||
if (!data) | ||
return [] | ||
return data.filter(reward => reward.greaterThan(0)) | ||
}, [data]) | ||
|
||
if (isLoading && !isError) { | ||
return ( | ||
<div className="flex flex-col gap-3 px-5 py-4"> | ||
<div className="flex justify-between mb-1 py-0.5"> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[100px] rounded-full" /> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[60px] rounded-full" /> | ||
</div> | ||
<div className="flex justify-between py-0.5"> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[160px] rounded-full" /> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[60px] rounded-full" /> | ||
</div> | ||
<div className="flex justify-between py-0.5"> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[160px] rounded-full" /> | ||
<div className="h-[16px] bg-slate-300 dark:bg-slate-700 animate-pulse w-[60px] rounded-full" /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
if (!isLoading && !isError && rewards.length) { | ||
return ( | ||
<div className="flex flex-col gap-3 px-5 py-4"> | ||
<div className="flex items-center justify-between"> | ||
<Typography className="text-slate-900 dark:text-slate-50 text-sm leading-5" weight={600}> | ||
<Trans> | ||
Market LP Rewards | ||
</Trans> | ||
</Typography> | ||
</div> | ||
{rewards.map(reward => ( | ||
<div className="flex items-center justify-between" key={reward.currency.wrapped.address}> | ||
<div className="flex items-center gap-2"> | ||
<Currency.Icon currency={reward.currency} height={20} width={20} /> | ||
<Typography className="text-slate-700 dark:text-slate-300" variant="sm" weight={600}> | ||
{reward?.toSignificant(6)} {reward.currency.symbol} | ||
</Typography> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
) | ||
} | ||
|
||
return <></> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './stDOT' | ||
export * from './vDOT' |
Oops, something went wrong.