|
| 1 | +import { SectionLabel } from "@/app/conf/_design-system/section-label" |
| 2 | + |
| 3 | +import CheckIcon from "@/icons/check.svg?svgr" |
| 4 | +import GlobeIcon from "@/icons/globe.svg?svgr" |
| 5 | +import CodeIcon from "@/icons/code.svg?svgr" |
| 6 | +import StarIcon from "@/icons/star.svg?svgr" |
| 7 | +import MagnifyingGlassIcon from "@/icons/magnifying-glass.svg?svgr" |
| 8 | + |
| 9 | +const pillars = [ |
| 10 | + { |
| 11 | + icon: CheckIcon, |
| 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: GlobeIcon, |
| 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: CodeIcon, |
| 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: StarIcon, |
| 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: MagnifyingGlassIcon, |
| 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-lg:text-center lg:mb-16"> |
| 47 | + Five Pillars of GraphQL |
| 48 | + </h2> |
| 49 | + |
| 50 | + <div className="gql-radial-gradient gap-px"> |
| 51 | + {pillars.map((pillar, index) => ( |
| 52 | + <div key={pillar.title}> |
| 53 | + <div className="flex flex-col items-center gap-2 bg-neu-0 py-6 max-lg:text-center lg:flex-row lg:items-center lg:gap-8 lg:py-8"> |
| 54 | + <div className="flex items-center max-lg:flex-col lg:w-[520px] lg:shrink-0"> |
| 55 | + <div className="p-6"> |
| 56 | + <pillar.icon className="size-6 text-pri-base" /> |
| 57 | + </div> |
| 58 | + <h3 className="typography-h3 lg:flex lg:h-[86px] lg:flex-1 lg:items-center lg:p-4"> |
| 59 | + {pillar.title} |
| 60 | + </h3> |
| 61 | + </div> |
| 62 | + <div className="lg:flex-1"> |
| 63 | + <p className="typography-body-lg mt-6 lg:mt-0"> |
| 64 | + {pillar.description} |
| 65 | + </p> |
| 66 | + </div> |
| 67 | + </div> |
| 68 | + {index < pillars.length - 1 && <Separator />} |
| 69 | + </div> |
| 70 | + ))} |
| 71 | + </div> |
| 72 | + </section> |
| 73 | + ) |
| 74 | +} |
| 75 | + |
| 76 | +function Separator() { |
| 77 | + return ( |
| 78 | + <div |
| 79 | + className="h-px w-full" |
| 80 | + style={{ |
| 81 | + 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%)`, |
| 82 | + }} |
| 83 | + /> |
| 84 | + ) |
| 85 | +} |
0 commit comments