|
1 | | -import {useEffect, useState} from 'react'; |
2 | 1 | import Link from '@docusaurus/Link'; |
3 | | -import CodeBlock from '@theme/CodeBlock'; |
4 | | -import {PLATFORMS, detectPlatform} from '@site/src/lib/installer'; |
5 | 2 | import styles from './styles.module.css'; |
6 | 3 |
|
7 | | -function quickStartSnippet(command) { |
8 | | - return `# Install\n${command}\n\n# Debug\nphp your-script.php`; |
9 | | -} |
10 | | - |
11 | | -/* Shows the command for the visitor's own OS. The page is prerendered without |
12 | | - knowing it, so this starts on the Unix command and corrects itself after |
13 | | - mounting -- detecting in an effect rather than during render keeps the first |
14 | | - client render identical to the server's, which is what hydration compares. */ |
15 | | -function QuickStartSnippet() { |
16 | | - const [platform, setPlatform] = useState('macos'); |
17 | | - |
18 | | - useEffect(() => { |
19 | | - const detected = detectPlatform(); |
20 | | - if (detected) { |
21 | | - setPlatform(detected); |
22 | | - } |
23 | | - }, []); |
24 | | - |
25 | | - const active = PLATFORMS.find((p) => p.id === platform) ?? PLATFORMS[0]; |
26 | | - |
27 | | - return ( |
28 | | - <CodeBlock language={active.language}> |
29 | | - {quickStartSnippet(active.command)} |
30 | | - </CodeBlock> |
31 | | - ); |
32 | | -} |
| 4 | +const quickStartSteps = [ |
| 5 | + 'Install it with one command', |
| 6 | + 'Start your editor listening', |
| 7 | + 'Set a breakpoint', |
| 8 | + 'Run your code as usual', |
| 9 | +]; |
33 | 10 |
|
34 | 11 | const keyFeatures = [ |
35 | 12 | 'Always on — no trigger to set', |
@@ -65,9 +42,15 @@ export default function HomeCards() { |
65 | 42 | title="Quick Start" |
66 | 43 | linkTo="/getting-started/quick-start" |
67 | 44 | linkLabel="View quick start guide"> |
68 | | - <p>Install it. There is nothing to configure.</p> |
69 | | - <QuickStartSnippet /> |
70 | | - <p>Start your editor listening, set a breakpoint, run your code.</p> |
| 45 | + <p>Four steps, and nothing to configure.</p> |
| 46 | + <ol className={styles.stepList}> |
| 47 | + {quickStartSteps.map((step, i) => ( |
| 48 | + <li key={step}> |
| 49 | + <span className={styles.step}>{i + 1}</span> |
| 50 | + {step} |
| 51 | + </li> |
| 52 | + ))} |
| 53 | + </ol> |
71 | 54 | </Card> |
72 | 55 | <Card |
73 | 56 | icon={ |
|
0 commit comments