|
| 1 | +import { SectionLabel } from "@/app/conf/_design-system/section-label" |
| 2 | + |
| 3 | +import GiftIcon from "@/app/conf/_design-system/pixelarticons/gift.svg?svgr" |
| 4 | +import TournamentIcon from "@/app/conf/_design-system/pixelarticons/tournament.svg?svgr" |
| 5 | +import ZapIcon from "@/app/conf/_design-system/pixelarticons/zap.svg?svgr" |
| 6 | +import BullseyeIcon from "@/app/conf/_design-system/pixelarticons/bullseye.svg?svgr" |
| 7 | +import SearchIcon from "@/app/conf/_design-system/pixelarticons/search.svg?svgr" |
| 8 | + |
| 9 | +const items = [ |
| 10 | + { |
| 11 | + icon: GiftIcon, |
| 12 | + title: "Product-centric", |
| 13 | + description: |
| 14 | + "GraphQL is unapologetically built for front-end engineers, aligning with their way of thinking, how views are structured and how data is consumed.", |
| 15 | + }, |
| 16 | + { |
| 17 | + icon: TournamentIcon, |
| 18 | + title: "Hierarchical", |
| 19 | + description: |
| 20 | + "Most product development involves the creation and manipulation of view hierarchies. GraphQL queries mirror UI structures, ensuring a natural way to request data that matches the shape of the response.", |
| 21 | + }, |
| 22 | + { |
| 23 | + icon: ZapIcon, |
| 24 | + title: "Strong-typing", |
| 25 | + description: |
| 26 | + "Every GraphQL service defines a type system, enabling tools to syntactically validate queries before execution and ensuring predictable responses.", |
| 27 | + }, |
| 28 | + { |
| 29 | + icon: BullseyeIcon, |
| 30 | + title: "Client-specified response", |
| 31 | + description: |
| 32 | + "A GraphQL service publishes the capabilities that its clients are allowed to consume. It is the client who control the data they receive, requesting only what they need at a field level, unlike traditional fixed endpoints.", |
| 33 | + }, |
| 34 | + { |
| 35 | + icon: SearchIcon, |
| 36 | + title: "Self-documenting", |
| 37 | + description: |
| 38 | + "GraphQL APIs can describe themselves, allowing tools and clients to query the schema for available types and capabilities. It serves as a powerful platform for building common tools and client software libraries.", |
| 39 | + }, |
| 40 | +] |
| 41 | + |
| 42 | +export function FivePillars() { |
| 43 | + return ( |
| 44 | + <section className="gql-container gql-section xl:py-20"> |
| 45 | + <SectionLabel className="mb-6">design principles</SectionLabel> |
| 46 | + <h2 className="typography-h2 mb-6 max-sm:text-center lg:mb-16"> |
| 47 | + Five Pillars of GraphQL |
| 48 | + </h2> |
| 49 | + |
| 50 | + <div className="gql-radial-gradient gap-px"> |
| 51 | + {items.map(({ title, icon: Icon, description }, index) => ( |
| 52 | + <div key={title}> |
| 53 | + <div className="flex flex-col gap-2 bg-neu-0 py-6 max-sm:text-center lg:flex-row lg:items-center lg:gap-8 lg:py-8"> |
| 54 | + <div className="flex items-center max-sm:flex-col lg:w-[430px] lg:shrink-0 xl:w-[520px]"> |
| 55 | + <div className="pr-4 max-sm:p-6 md:max-lg:p-6"> |
| 56 | + <Icon className="size-6 text-pri-base" /> |
| 57 | + </div> |
| 58 | + <h3 className="typography-h3 sm:items-center lg:flex lg:h-[86px] lg:flex-1 lg:p-4"> |
| 59 | + {title} |
| 60 | + </h3> |
| 61 | + </div> |
| 62 | + <p className="typography-body-lg mt-6 lg:mt-0 lg:flex-1"> |
| 63 | + {description} |
| 64 | + </p> |
| 65 | + </div> |
| 66 | + {index < items.length - 1 && <Separator />} |
| 67 | + </div> |
| 68 | + ))} |
| 69 | + </div> |
| 70 | + </section> |
| 71 | + ) |
| 72 | +} |
| 73 | + |
| 74 | +function Separator() { |
| 75 | + return ( |
| 76 | + <div |
| 77 | + className="h-px w-full" |
| 78 | + style={{ |
| 79 | + background: `linear-gradient(90deg, hsl(var(--color-neu-100) / 0) 0%, hsl(var(--color-neu-300) / 0.75) 25%, hsl(var(--color-neu-400)) 50%, hsl(var(--color-neu-300) / 0.75) 75%, hsl(var(--color-neu-100) / 0) 100%)`, |
| 80 | + }} |
| 81 | + /> |
| 82 | + ) |
| 83 | +} |
0 commit comments