|
| 1 | +'use client' |
| 2 | +import { useColorMode } from '@chakra-ui/react' |
| 3 | + |
| 4 | +import { useState, useEffect } from 'react' |
| 5 | +import { usePathname } from 'next/navigation' |
| 6 | +import {Box, Container, Heading as ChakraHeading, Text, Link} from '@chakra-ui/react' |
| 7 | +import NextLink from 'next/link' |
| 8 | +import { MarkdownContent } from '@/components/MarkdownContent' |
| 9 | +import { TableOfContents } from '@/components/TableOfContents' |
| 10 | +import { PageNavigation } from '@/components/PageNavigation' |
| 11 | +import { extractHeadings, HeadingItem } from '@/lib/extractHeadings' |
| 12 | +import colors from '@/theme/colors' |
| 13 | + |
| 14 | +export default function Page() { |
| 15 | + const { colorMode } = useColorMode() |
| 16 | + const themeColors = colors[colorMode as 'light' | 'dark'] |
| 17 | + const content = `# Traditional Bridges vs. Intent-Based Swaps |
| 18 | +
|
| 19 | +| Feature | Traditional Bridges 🏗️ | Intent-Based Swaps ⚡ | |
| 20 | +| ------------------------ | ----------------------------------------------- | --------------------------------------------------------- | |
| 21 | +| Scalability | Limited by locked TVL, leading to bottlenecks | Access to a global liquidity network, infinitely scalable | |
| 22 | +| Slippage & MEV | Prone to slippage and MEV front-running attacks | Zero slippage, immune to MEV exploitation | |
| 23 | +| Security | Centralized TVL pools create honeypot risks | No locked TVL, minimizing security vulnerabilities | |
| 24 | +| User Experience (UX) | Slow transaction speeds, high gas fees | Ultra-fast swaps, no wait for network finality | |
| 25 | +| Liquidity Requirements | Requires heavy incentives to attract liquidity | No need for liquidity bootstrapping or incentives | |
| 26 | +
|
| 27 | +### Why Intent-Based Swaps Are Better 🏅 |
| 28 | +
|
| 29 | +Intent-based swaps revolutionize cross-chain transactions by eliminating the traditional limitations of bridges. They prioritize security, efficiency, and user experience, making them the future of blockchain interoperability. |
| 30 | +
|
| 31 | +` |
| 32 | + const hideFirstHeading = true |
| 33 | + const pathname = usePathname() |
| 34 | + const [headings, setHeadings] = useState<HeadingItem[]>([]) |
| 35 | + |
| 36 | + useEffect(() => { |
| 37 | + const extracted = extractHeadings(content) |
| 38 | + setHeadings(extracted) |
| 39 | + }, [content]) |
| 40 | + |
| 41 | + |
| 42 | + return ( |
| 43 | + <Box display="flex" flex="1" overflow="hidden" flexDirection={{ base: "column", xl: "row" }}> |
| 44 | + <Box flex="1" bg={themeColors.body.bg} overflowY="auto" overflowX="hidden" data-scroll-container> |
| 45 | + <Container maxW="5xl" py={{ base: 4, md: 8 }} px={{ base: 4, md: 7 }}> |
| 46 | + {hideFirstHeading && ( |
| 47 | + <Link as={NextLink} href={pathname} _hover={{ textDecoration: 'none' }}><ChakraHeading as="h1" size={{ base: "xl", md: "2xl" }} mb={4}> |
| 48 | + Traditional Bridges vs. Intent-Based Swaps |
| 49 | + </ChakraHeading></Link> |
| 50 | + )} |
| 51 | + |
| 52 | + <MarkdownContent content={content} hideFirstHeading={hideFirstHeading} /> |
| 53 | + |
| 54 | + <PageNavigation /> |
| 55 | + </Container> |
| 56 | + </Box> |
| 57 | + <TableOfContents headings={headings} /> |
| 58 | + </Box> |
| 59 | + ) |
| 60 | +} |
0 commit comments