|
| 1 | +import styles from './Hero.module.css'; |
| 2 | +import { Button } from '@callstack/rspress-theme'; |
| 3 | +import { CodeBlockRuntime } from '@rspress/core/theme'; |
| 4 | +import { transformerNotationHighlight } from '@shikijs/transformers'; |
| 5 | + |
| 6 | +export function Hero() { |
| 7 | + return ( |
| 8 | + <div className="rp-relative"> |
| 9 | + <div |
| 10 | + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions |
| 11 | + className={`rp-overflow-hidden rp-max-w-6xl ${styles.container}`} |
| 12 | + > |
| 13 | + <div className={styles.heroMain}> |
| 14 | + <h1 className={styles.heroName}> |
| 15 | + Create & build React Native libraries |
| 16 | + </h1> |
| 17 | + </div> |
| 18 | + |
| 19 | + <div className={styles.featureList}> |
| 20 | + <div className={styles.feature}> |
| 21 | + <h2 className={styles.featureTitle}>Create</h2> |
| 22 | + <p className={styles.featureDescription}> |
| 23 | + Scaffold a new React Native library with everything |
| 24 | + pre-configured. Choose between templates such as Turbo Modules or |
| 25 | + Nitro Modules. |
| 26 | + </p> |
| 27 | + <div className={styles.codeBlock}> |
| 28 | + <CodeBlockRuntime |
| 29 | + lang="sh" |
| 30 | + code={`npx create-react-native-library@latest`} |
| 31 | + shikiOptions={{ |
| 32 | + transformers: [transformerNotationHighlight()], |
| 33 | + }} |
| 34 | + /> |
| 35 | + </div> |
| 36 | + <Button href="/create">Learn more</Button> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div className={styles.feature}> |
| 40 | + <h2 className={styles.featureTitle}>Build</h2> |
| 41 | + <p className={styles.featureDescription}> |
| 42 | + Compile your React Native library to work with multiple tools. |
| 43 | + Support Metro, Webpack, Vite, NodeJS & more with a single build. |
| 44 | + </p> |
| 45 | + <div className={styles.codeBlock}> |
| 46 | + <CodeBlockRuntime |
| 47 | + lang="sh" |
| 48 | + code={`npx react-native-builder-bob@latest init`} |
| 49 | + shikiOptions={{ |
| 50 | + transformers: [transformerNotationHighlight()], |
| 51 | + }} |
| 52 | + /> |
| 53 | + </div> |
| 54 | + <Button href="/build">Learn more</Button> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + ); |
| 60 | +} |
0 commit comments