-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathHero.tsx
More file actions
82 lines (77 loc) · 2.29 KB
/
Hero.tsx
File metadata and controls
82 lines (77 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { Button, HomeHero } from '@callstack/rspress-theme';
import { getCustomMDXComponent, HomeBackground } from '@rspress/core/theme';
import clsx from 'clsx';
import styles from './Hero.module.css';
export function Hero() {
return (
<>
<HomeBackground />
<HomeHero
afterHeroActions={
<div className={clsx('rp-home-feature', styles.featureList)}>
<Feature
title="Create"
description="Scaffold a new React Native library with everything pre-configured. Choose between templates such as Turbo Modules or Nitro Modules."
code={`npx create-react-native-library@latest`}
link="/react-native-builder-bob/create"
/>
<Feature
title="Build"
description="Compile your React Native library to work with multiple tools. Support Metro, Webpack, Vite, NodeJS & more with a single build."
code={`npx react-native-builder-bob@latest init`}
link="/react-native-builder-bob/build"
/>
</div>
}
/>
</>
);
}
const { pre: Pre } = getCustomMDXComponent();
function Feature({
title,
description,
code,
link,
}: {
title: string;
description: string;
code: string;
link: string;
}) {
return (
<div className={styles.feature}>
<h2 className={styles.featureTitle}>{title}</h2>
<p className={styles.featureDescription}>{description}</p>
<div className={styles.codeBlock}>
<Pre
lang="bash"
className="shiki css-variables"
style={{
backgroundColor: 'var(--shiki-background)',
color: 'var(--shiki-foreground)',
}}
>
<code style={{ whiteSpace: 'pre' }}>
{code.split(' ').map((part, index) => {
return (
<span
key={index}
style={{
color:
index === 0
? 'var(--shiki-token-function)'
: 'var(--shiki-token-string)',
}}
>
{part}{' '}
</span>
);
})}
</code>
</Pre>
</div>
<Button href={link}>Learn more</Button>
</div>
);
}