|
1 | 1 | 'use client'; |
2 | 2 |
|
3 | | -import Link from 'next/link'; |
4 | 3 | import { ArrowRight } from 'lucide-react'; |
5 | 4 | import { CopyButton } from '@/components/ui/copy-button'; |
6 | 5 | import { Features } from '@/components/landing'; |
| 6 | +import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs'; |
| 7 | +import { |
| 8 | + FeaturedSection, |
| 9 | + ElementExamplesSection, |
| 10 | + HooksExamplesSection, |
| 11 | + TransactionsSection, |
| 12 | +} from '@/components/playground'; |
| 13 | +import { Blocks, Code2, Anchor, Zap } from 'lucide-react'; |
| 14 | +import { Button } from '@/components/ui/button'; |
7 | 15 |
|
8 | 16 | export default function Home() { |
9 | | - const npmCommand = 'npm install @solana/connector'; |
| 17 | + const npmCommand = 'npm i @solana/connector'; |
| 18 | + |
| 19 | + const scrollToPlayground = () => { |
| 20 | + const playgroundSection = document.getElementById('playground'); |
| 21 | + if (playgroundSection) { |
| 22 | + playgroundSection.scrollIntoView({ behavior: 'smooth', block: 'start' }); |
| 23 | + } |
| 24 | + }; |
10 | 25 |
|
11 | 26 | return ( |
12 | 27 | <div className="max-w-7xl mx-auto min-h-[calc(100vh-4rem)] border-r border-l border-sand-200"> |
@@ -43,20 +58,98 @@ export default function Home() { |
43 | 58 | iconClassNameCheck="text-green-600" |
44 | 59 | /> |
45 | 60 |
|
46 | | - <Link |
47 | | - href="/playground" |
48 | | - className="inline-flex items-center gap-2 px-5 py-2.5 bg-sand-1500 hover:bg-sand-1400 text-white rounded-lg transition-colors font-inter-medium text-body-md" |
| 61 | + <Button |
| 62 | + onClick={scrollToPlayground} |
| 63 | + variant="default" |
| 64 | + size="sm" |
| 65 | + className="gap-2" |
49 | 66 | > |
50 | 67 | View Playground |
51 | 68 | <ArrowRight className="h-4 w-4" /> |
52 | | - </Link> |
| 69 | + </Button> |
53 | 70 | </div> |
54 | 71 | </div> |
55 | 72 | </div> |
56 | 73 | </section> |
57 | 74 |
|
58 | 75 | {/* Features */} |
59 | 76 | <Features /> |
| 77 | + {/* Playground Section */} |
| 78 | + <section |
| 79 | + id="playground" |
| 80 | + className="py-12 border-b border-sand-200" |
| 81 | + style={{ |
| 82 | + backgroundImage: `repeating-linear-gradient( |
| 83 | + 45deg, |
| 84 | + transparent, |
| 85 | + transparent 10px, |
| 86 | + rgba(233, 231, 222, 0.5) 10px, |
| 87 | + rgba(233, 231, 222, 0.5) 11px |
| 88 | + )`, |
| 89 | + }} |
| 90 | + > |
| 91 | + <div className="max-w-7xl mx-auto px-4 lg:px-6"> |
| 92 | + <h1 className="text-h2 text-sand-1500 mb-3 text-center">Playground</h1> |
| 93 | + <p className="text-body-xl text-sand-800 text-center max-w-xl mx-auto"> |
| 94 | + Explore components, elements, hooks, and test transactions. Copy any example and customize it |
| 95 | + for your app. |
| 96 | + </p> |
| 97 | + </div> |
| 98 | + </section> |
| 99 | + |
| 100 | + {/* Tabbed Navigation */} |
| 101 | + <Tabs defaultValue="components" className="w-full"> |
| 102 | + <div className="sticky top-16 z-40 bg-bg1/95 backdrop-blur-sm border-b border-sand-200"> |
| 103 | + <div className="max-w-7xl mx-auto"> |
| 104 | + <TabsList className="h-14 w-full justify-start gap-0 bg-transparent p-0 rounded-none"> |
| 105 | + <TabsTrigger |
| 106 | + value="components" |
| 107 | + className="h-14 px-4 rounded-none border-b-2 border-transparent data-[state=active]:border-sand-1500 data-[state=active]:bg-transparent data-[state=active]:shadow-none gap-2" |
| 108 | + > |
| 109 | + <Blocks className="h-4 w-4" /> |
| 110 | + <span className="hidden sm:inline">Components</span> |
| 111 | + </TabsTrigger> |
| 112 | + <TabsTrigger |
| 113 | + value="elements" |
| 114 | + className="h-14 px-4 rounded-none border-b-2 border-transparent data-[state=active]:border-sand-1500 data-[state=active]:bg-transparent data-[state=active]:shadow-none gap-2" |
| 115 | + > |
| 116 | + <Code2 className="h-4 w-4" /> |
| 117 | + <span className="hidden sm:inline">Elements</span> |
| 118 | + </TabsTrigger> |
| 119 | + <TabsTrigger |
| 120 | + value="hooks" |
| 121 | + className="h-14 px-4 rounded-none border-b-2 border-transparent data-[state=active]:border-sand-1500 data-[state=active]:bg-transparent data-[state=active]:shadow-none gap-2" |
| 122 | + > |
| 123 | + <Anchor className="h-4 w-4" /> |
| 124 | + <span className="hidden sm:inline">Hooks</span> |
| 125 | + </TabsTrigger> |
| 126 | + <TabsTrigger |
| 127 | + value="transactions" |
| 128 | + className="h-14 px-4 rounded-none border-b-2 border-transparent data-[state=active]:border-sand-1500 data-[state=active]:bg-transparent data-[state=active]:shadow-none gap-2" |
| 129 | + > |
| 130 | + <Zap className="h-4 w-4" /> |
| 131 | + <span className="hidden sm:inline">Transactions</span> |
| 132 | + </TabsTrigger> |
| 133 | + </TabsList> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + |
| 137 | + <TabsContent value="components" className="mt-0"> |
| 138 | + <FeaturedSection /> |
| 139 | + </TabsContent> |
| 140 | + |
| 141 | + <TabsContent value="elements" className="mt-0"> |
| 142 | + <ElementExamplesSection /> |
| 143 | + </TabsContent> |
| 144 | + |
| 145 | + <TabsContent value="hooks" className="mt-0"> |
| 146 | + <HooksExamplesSection /> |
| 147 | + </TabsContent> |
| 148 | + |
| 149 | + <TabsContent value="transactions" className="mt-0"> |
| 150 | + <TransactionsSection /> |
| 151 | + </TabsContent> |
| 152 | + </Tabs> |
60 | 153 | </div> |
61 | 154 | ); |
62 | 155 | } |
0 commit comments