Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use pool descriptions #459

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/lib/modules/pool/PoolDetail/PoolHeader/PoolHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stack, Button, VStack, useDisclosure, HStack, Tooltip } from '@chakra-ui/react'
import { Stack, Button, VStack, useDisclosure, HStack, Tooltip, Text } from '@chakra-ui/react'
import { usePathname, useRouter } from 'next/navigation'
import PoolMetaBadges from './PoolMetaBadges'

Expand All @@ -19,6 +19,7 @@ import {
import { useState } from 'react'
import { getXavePoolLink } from '../../pool.utils'
import { PoolAdvancedOptions } from './PoolAdvancedOptions'
import { usePoolMetadata } from '../../metadata/usePoolMetadata'

export function PoolHeader() {
const pathname = usePathname()
Expand All @@ -28,6 +29,7 @@ export function PoolHeader() {
const [redirectPartnerUrl, setRedirectPartnerUrl] = useState<string>()
const partnerRedirectDisclosure = useDisclosure()
const isCowPool = isCowAmmPool(pool.type)
const { description } = usePoolMetadata(pool)

const isAddLiquidityBlocked = shouldBlockAddLiquidity(pool)

Expand All @@ -54,12 +56,22 @@ export function PoolHeader() {
<VStack align="start" spacing="md" w="full">
<PoolBreadcrumbs />
<Stack
direction={{ base: 'column', md: 'row' }}
align={{ base: 'start', lg: 'end' }}
direction={{ base: 'column', lg: 'row' }}
justify="space-between"
mt="xs"
spacing="md"
w="full"
>
<PoolMetaBadges />
<VStack align="start" spacing="md">
<PoolMetaBadges />
{description && (
<Text fontSize="sm" maxW="xl" mb="xxs" sx={{ textWrap: 'pretty' }} variant="secondary">
{description}
</Text>
)}
</VStack>

<Stack direction={{ base: 'column', md: 'row' }} spacing="md">
<PoolTags />
<HStack spacing="sm">
Expand Down
Loading