-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
794fd51
commit 03f16cb
Showing
68 changed files
with
1,754 additions
and
2,437 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
'use client' | ||
|
||
import { GiftIcon } from '@heroicons/react-v1/outline' | ||
import { LinkExternal, LinkInternal, typographyVariants } from '@sushiswap/ui' | ||
import { Button } from '@sushiswap/ui' | ||
import { Chip } from '@sushiswap/ui' | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuGroup, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from '@sushiswap/ui' | ||
import { SelectIcon } from '@sushiswap/ui' | ||
import { DiscordIcon } from '@sushiswap/ui/icons/DiscordIcon' | ||
import { FC } from 'react' | ||
import { ChainId } from 'sushi/chain' | ||
import { | ||
SushiSwapV3ChainId, | ||
isSushiSwapV2ChainId, | ||
isSushiSwapV3ChainId, | ||
} from 'sushi/config' | ||
import { useChainId } from 'wagmi' | ||
|
||
export const Hero: FC = () => { | ||
const chainId = useChainId() | ||
|
||
return ( | ||
<section className="flex flex-col justify-between gap-12 lg:flex-row lg:items-start mb-12"> | ||
<div className="flex flex-col items-center flex-grow gap-6 lg:items-start"> | ||
<div className="flex flex-col"> | ||
<h1 className={typographyVariants({ variant: 'h1' })}> | ||
Put your funds to work <br /> | ||
by providing liquidity. | ||
</h1> | ||
<p | ||
className={typographyVariants({ | ||
variant: 'lead', | ||
className: 'max-w-[500px]', | ||
})} | ||
> | ||
When you add liquidity to a pool, you can receive a share of its | ||
trading volume and potentially snag extra rewards when there are | ||
incentives involved! | ||
</p> | ||
</div> | ||
<div className="flex flex-col sm:flex-row w-full sm:w-[unset] gap-4"> | ||
<div className="flex items-center w-full"> | ||
<Button | ||
asChild | ||
size="lg" | ||
className="flex-1 w-full sm:flex-0 sm:w-[unset] rounded-r-none" | ||
> | ||
<LinkInternal | ||
href={ | ||
isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) | ||
? `/pool/add?chainId=${chainId}` | ||
: isSushiSwapV2ChainId(chainId as SushiSwapV3ChainId) | ||
? `/pool/add/v2/${chainId}` | ||
: '' | ||
} | ||
> | ||
I want to create a position | ||
</LinkInternal> | ||
</Button> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button asChild size="lg" className="rounded-l-none"> | ||
<SelectIcon /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent className="w-80"> | ||
<DropdownMenuGroup> | ||
<DropdownMenuItem | ||
disabled={ | ||
!isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) | ||
} | ||
asChild | ||
> | ||
<LinkInternal | ||
href={`/pool/add?chainId=${chainId}`} | ||
className="flex flex-col !items-start gap-1 cursor-pointer" | ||
> | ||
<div className="flex items-center gap-1 font-medium leading-none"> | ||
V3 Position | ||
<Chip variant="secondary"> | ||
{isSushiSwapV3ChainId(chainId as SushiSwapV3ChainId) | ||
? 'New 🔥' | ||
: 'Unavailable'} | ||
</Chip> | ||
</div> | ||
<p className="text-sm leading-snug text-muted-foreground"> | ||
Provide liquidity to a V3 liquidity pool. | ||
</p> | ||
</LinkInternal> | ||
</DropdownMenuItem> | ||
{isSushiSwapV2ChainId(chainId as ChainId) ? ( | ||
<DropdownMenuItem asChild> | ||
<LinkInternal | ||
href={`/pools/add/v2/${chainId}`} | ||
className="flex flex-col !items-start gap-1 cursor-pointer" | ||
> | ||
<div className="flex items-center gap-1 font-medium leading-none"> | ||
V2 Position | ||
</div> | ||
<p className="text-sm leading-snug text-muted-foreground"> | ||
Provide liquidity to a V2 liquidity pool. | ||
</p> | ||
</LinkInternal> | ||
</DropdownMenuItem> | ||
) : null} | ||
</DropdownMenuGroup> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
</div> | ||
<Button | ||
fullWidth | ||
asChild | ||
icon={GiftIcon} | ||
variant="secondary" | ||
size="lg" | ||
> | ||
<LinkInternal href="/pools/incentivize"> | ||
I want to incentivize a pool | ||
</LinkInternal> | ||
</Button> | ||
</div> | ||
</div> | ||
<div className="flex flex-col items-center gap-4 lg:items-end"> | ||
<div className="flex flex-col items-center gap-1 lg:items-end"> | ||
<span className="font-semibold lg:text-sm"> | ||
Looking for a partnership with Sushi? | ||
</span> | ||
<Button | ||
className="flex-1 w-full sm:flex-0 sm:w-[unset]" | ||
variant="link" | ||
size="sm" | ||
asChild | ||
> | ||
<LinkInternal href="/partner">Apply here</LinkInternal> | ||
</Button> | ||
</div> | ||
<div className="flex flex-col items-center gap-1 lg:items-end"> | ||
<span className="font-semibold lg:text-sm">Need Help?</span> | ||
<Button icon={DiscordIcon} variant="link" size="sm" asChild> | ||
<LinkExternal href="https://sushi.com/discord"> | ||
Join our discord | ||
</LinkExternal> | ||
</Button> | ||
</div> | ||
</div> | ||
</section> | ||
) | ||
} |
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,29 @@ | ||
import { Container } from '@sushiswap/ui' | ||
import { GlobalStatsCharts } from 'src/ui/explore/global-stats-charts' | ||
import { ChainId } from 'sushi/chain' | ||
import { Hero } from './hero' | ||
|
||
export const metadata = { | ||
title: 'Pools 💦', | ||
} | ||
|
||
export default async function ExploreLayout({ | ||
children, | ||
params: { chainId }, | ||
}: { children: React.ReactNode; params: { chainId: string } }) { | ||
return ( | ||
<> | ||
<Container maxWidth="7xl" className="px-4 pt-20 pb-10"> | ||
<Hero /> | ||
<div className="mt-10"> | ||
<GlobalStatsCharts chainId={+chainId as ChainId} /> | ||
</div> | ||
</Container> | ||
<section className="flex flex-col flex-1"> | ||
<div className="bg-gray-50 dark:bg-white/[0.02] border-t border-accent pt-4 pb-20 h-full"> | ||
{children} | ||
</div> | ||
</section> | ||
</> | ||
) | ||
} |
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,43 @@ | ||
import { getTopPools } from '@sushiswap/graph-client/data-api' | ||
import { Container } from '@sushiswap/ui' | ||
import { unstable_cache } from 'next/cache' | ||
import React from 'react' | ||
import { PoolsFiltersProvider } from 'src/ui/pool' | ||
import { PoolsTable } from 'src/ui/pool/PoolsTable' | ||
import { TableFiltersSmartPoolsOnly } from 'src/ui/pool/TableFilterSmartPoolsOnly' | ||
import { TableFiltersFarmsOnly } from 'src/ui/pool/TableFiltersFarmsOnly' | ||
import { TableFiltersNetwork } from 'src/ui/pool/TableFiltersNetwork' | ||
import { TableFiltersPoolType } from 'src/ui/pool/TableFiltersPoolType' | ||
import { TableFiltersResetButton } from 'src/ui/pool/TableFiltersResetButton' | ||
import { TableFiltersSearchToken } from 'src/ui/pool/TableFiltersSearchToken' | ||
import { ChainId } from 'sushi/chain' | ||
|
||
export default async function PoolPage({ | ||
params: { chainId }, | ||
}: { | ||
params: { chainId: string } | ||
}) { | ||
const pools = await unstable_cache( | ||
async () => getTopPools({ chainId: +chainId }), | ||
['pools', chainId.toString()], | ||
{ | ||
revalidate: 60 * 3, | ||
}, | ||
)() | ||
|
||
return ( | ||
<PoolsFiltersProvider> | ||
<Container maxWidth="7xl" className="px-4"> | ||
<div className="flex flex-wrap gap-3 mb-4"> | ||
<TableFiltersSearchToken /> | ||
<TableFiltersPoolType /> | ||
<TableFiltersNetwork chainId={+chainId as ChainId} /> | ||
<TableFiltersFarmsOnly /> | ||
<TableFiltersSmartPoolsOnly /> | ||
<TableFiltersResetButton /> | ||
</div> | ||
<PoolsTable pools={pools} /> | ||
</Container> | ||
</PoolsFiltersProvider> | ||
) | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.