@@ -13,6 +13,7 @@ import type {
13
13
14
14
import SvgButtonLink from "@/components/Buttons/SvgButtonLink"
15
15
import { ChevronNext } from "@/components/Chevron"
16
+ import CodeModal from "@/components/CodeModal"
16
17
import HomeHero from "@/components/Hero/HomeHero"
17
18
import BentoCard from "@/components/Homepage/BentoCard"
18
19
import { useHome } from "@/components/Homepage/useHome"
@@ -24,7 +25,7 @@ import MainArticle from "@/components/MainArticle"
24
25
import PageMetadata from "@/components/PageMetadata"
25
26
import Swiper from "@/components/Swiper"
26
27
import { TranslatathonBanner } from "@/components/Translatathon/TranslatathonBanner"
27
- import { Button , ButtonLink } from "@/components/ui/buttons/Button"
28
+ import { ButtonLink } from "@/components/ui/buttons/Button"
28
29
import {
29
30
Card ,
30
31
CardBanner ,
@@ -355,44 +356,8 @@ const HomePage = ({
355
356
356
357
{ /* Builders - Blockchain's biggest builder community */ }
357
358
< Section id = "builders" variant = "responsiveFlex" >
358
- < SectionBanner
359
- className = { cn (
360
- "relative transition-[max-width] duration-500 ease-linear md:max-w-96 lg:max-w-128" ,
361
- isModalOpen && "duration-300 md:max-w-[50%] lg:max-w-[50%]"
362
- ) }
363
- >
359
+ < SectionBanner className = "relative" >
364
360
< TwImage src = { BuildersImage } alt = "" />
365
-
366
- { isModalOpen && (
367
- < div className = "absolute inset-0.5 my-auto h-fit max-h-[75%] overflow-y-auto rounded-4xl bg-background-highlight pb-0.5 transition-all max-md:hidden" >
368
- < div
369
- className = "sticky top-0 z-10 bg-background-highlight py-1"
370
- style = { {
371
- mask : "linear-gradient(to bottom, white 90%, transparent)" ,
372
- } }
373
- >
374
- < Button
375
- onClick = { ( ) => setModalOpen ( false ) }
376
- className = "me-4 ms-auto block"
377
- variant = "ghost"
378
- >
379
- { t ( "close" ) }
380
- </ Button >
381
- </ div >
382
- < div className = "z-0 max-h-[calc(100%_-_128px)] overflow-auto" >
383
- < Suspense fallback = { < SkeletonLines noOfLines = { 32 } /> } >
384
- < Codeblock
385
- codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
386
- allowCollapse = { false }
387
- fromHomepage
388
- className = "[&>div]:mb-0 [&>div]:max-h-[calc(100%_-_128px)] [&>div]:rounded-[calc(theme('borderRadius.4xl')_-_2px)] [&>div]:p-2 [&_*]:!text-sm [&_pre]:py-2"
389
- >
390
- { codeExamples [ activeCode ] . code }
391
- </ Codeblock >
392
- </ Suspense >
393
- </ div >
394
- </ div >
395
- ) }
396
361
</ SectionBanner >
397
362
398
363
< SectionContent >
@@ -473,6 +438,25 @@ const HomePage = ({
473
438
) }
474
439
</ Accordion >
475
440
</ WindowBox >
441
+ { isModalOpen && (
442
+ // TODO: Migrate CodeModal, CodeBlock from Chakra-UI to tailwind/shad-cn
443
+ < CodeModal
444
+ isOpen = { isModalOpen }
445
+ setIsOpen = { setModalOpen }
446
+ title = { codeExamples [ activeCode ] . title }
447
+ >
448
+ < Suspense fallback = { < SkeletonLines noOfLines = { 16 } /> } >
449
+ < Codeblock
450
+ codeLanguage = { codeExamples [ activeCode ] . codeLanguage }
451
+ allowCollapse = { false }
452
+ className = "[&_pre]:p-6"
453
+ fromHomepage
454
+ >
455
+ { codeExamples [ activeCode ] . code }
456
+ </ Codeblock >
457
+ </ Suspense >
458
+ </ CodeModal >
459
+ ) }
476
460
</ div >
477
461
</ SectionContent >
478
462
</ Section >
0 commit comments