|
1 | 1 | import React from 'react'; |
2 | | -import clsx from 'clsx'; |
3 | 2 | import Layout from '@theme/Layout'; |
4 | 3 | import Link from '@docusaurus/Link'; |
5 | | -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; |
| 4 | +import ExtIcon from '../components/ExtIcon'; |
6 | 5 | import styles from './index.module.css'; |
7 | 6 |
|
8 | | -function HomepageHeader() { |
9 | | - const {siteConfig} = useDocusaurusContext(); |
| 7 | +const EXT_LINK = { target: '_blank', rel: 'noopener noreferrer' }; |
| 8 | + |
| 9 | +function Hero() { |
10 | 10 | return ( |
11 | | - <header className={clsx('hero hero--primary', styles.heroBanner)}> |
12 | | - <div className="container"> |
13 | | - <h1 className="hero__title">{siteConfig.title}</h1> |
14 | | - <p className="hero__subtitle">{siteConfig.tagline}</p> |
15 | | - <div className={styles.buttons}> |
16 | | - <Link |
17 | | - className="button button--secondary button--lg" |
18 | | - to="https://leanpub.com/graphql-java/"> |
19 | | - Buy the GraphQL Java book now |
20 | | - </Link> |
21 | | - </div> |
| 11 | + <section className={styles.hero}> |
| 12 | + <h1 className={styles.heroTitle}>GraphQL Java</h1> |
| 13 | + <p className={styles.heroSubtitle}>The Java implementation of GraphQL</p> |
| 14 | + <div className={styles.trustBar}> |
| 15 | + <span>Spring GraphQL</span> |
| 16 | + <span className={styles.dot}>·</span> |
| 17 | + <span>Netflix DGS</span> |
| 18 | + <span className={styles.dot}>·</span> |
| 19 | + <span>Atlassian</span> |
| 20 | + <span className={styles.dot}>·</span> |
| 21 | + <span>1M+ downloads/month</span> |
| 22 | + </div> |
| 23 | + <div className={styles.ctaRow}> |
| 24 | + <Link className={styles.ctaPrimary} to="/documentation/getting-started"> |
| 25 | + Get started → |
| 26 | + </Link> |
| 27 | + <a className={styles.ctaSecondary} href="https://feddi.dev" {...EXT_LINK}> |
| 28 | + JVM-native GraphQL federation <ExtIcon /> |
| 29 | + </a> |
| 30 | + </div> |
| 31 | + </section> |
| 32 | + ); |
| 33 | +} |
| 34 | + |
| 35 | +function Card({ title, description, to, href, external }) { |
| 36 | + const content = ( |
| 37 | + <> |
| 38 | + <div className={styles.cardTitle}> |
| 39 | + {title}{external && <ExtIcon />} |
22 | 40 | </div> |
23 | | - </header> |
| 41 | + <div className={styles.cardDesc}>{description}</div> |
| 42 | + </> |
| 43 | + ); |
| 44 | + if (to) { |
| 45 | + return <Link className={styles.card} to={to}>{content}</Link>; |
| 46 | + } |
| 47 | + return ( |
| 48 | + <a className={styles.card} href={href} {...(external ? EXT_LINK : {})}> |
| 49 | + {content} |
| 50 | + </a> |
24 | 51 | ); |
25 | 52 | } |
26 | 53 |
|
27 | 54 | export default function Home() { |
28 | | - const {siteConfig} = useDocusaurusContext(); |
29 | 55 | return ( |
30 | | - <Layout |
31 | | - title={`Hello from ${siteConfig.title}`} |
32 | | - description="GraphQL Java home page"> |
33 | | - <HomepageHeader /> |
| 56 | + <Layout title="GraphQL Java" description="The Java implementation of GraphQL"> |
| 57 | + <Hero /> |
| 58 | + <main className={styles.content}> |
| 59 | + <section className={styles.section}> |
| 60 | + <div className={styles.sectionLabel}>Documentation</div> |
| 61 | + <div className={styles.cardGrid}> |
| 62 | + <Card title="Documentation" description="Full reference for GraphQL Java" to="/documentation/getting-started" /> |
| 63 | + <Card title="3 min tutorial" description="Get a GraphQL server running fast" to="/tutorials/getting-started-with-spring-boot" /> |
| 64 | + <Card title="GraphQL with Java and Spring" description="Book from the maintainers" href="https://leanpub.com/graphql-java/" external /> |
| 65 | + <Card title="JavaDoc" description="Full API reference" href="https://javadoc.io/doc/com.graphql-java/graphql-java/" external /> |
| 66 | + </div> |
| 67 | + </section> |
| 68 | + |
| 69 | + <section className={styles.section}> |
| 70 | + <div className={styles.sectionLabel}>Federation</div> |
| 71 | + <div className={styles.federationCard}> |
| 72 | + <div className={styles.federationText}> |
| 73 | + <div className={styles.federationTitle}>JVM-native GraphQL federation</div> |
| 74 | + <div className={styles.federationBody}> |
| 75 | + Andreas Marek, creator of GraphQL Java, is building feddi — a JVM-native federation gateway for any team running GraphQL on the JVM. |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + <a className={styles.federationBtn} href="https://feddi.dev" {...EXT_LINK}> |
| 79 | + feddi.dev <ExtIcon /> |
| 80 | + </a> |
| 81 | + </div> |
| 82 | + </section> |
| 83 | + |
| 84 | + <section className={styles.section}> |
| 85 | + <div className={styles.sectionLabel}>Community</div> |
| 86 | + <div className={styles.cardGrid}> |
| 87 | + <Card title="GitHub Discussions" description="Ask questions, share ideas" href="https://github.com/graphql-java/graphql-java/discussions" external /> |
| 88 | + <Card title="Releases" description="Changelog and release notes" href="https://github.com/graphql-java/graphql-java/releases" external /> |
| 89 | + </div> |
| 90 | + </section> |
| 91 | + </main> |
34 | 92 | </Layout> |
35 | 93 | ); |
36 | 94 | } |
0 commit comments