Skip to content

Commit 5f905af

Browse files
feat(firstmile): tabbed page for arduino prepare IDE page (#5467)
1 parent a7bfb4f commit 5f905af

File tree

1 file changed

+76
-31
lines changed

1 file changed

+76
-31
lines changed
Lines changed: 76 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
// Libraries
2-
import React from 'react'
2+
import React, {useState} from 'react'
3+
import {
4+
Button,
5+
ButtonGroup,
6+
ComponentColor,
7+
Orientation,
8+
} from '@influxdata/clockface'
39

410
const listStyle = {
511
fontSize: '16px',
612
fontWeight: 'normal',
713
}
814

915
export const PrepareIde = () => {
16+
type CurrentBoardSelection = 'ESP8266' | 'ESP32'
17+
const [currentSelection, setCurrentSelection] = useState<
18+
CurrentBoardSelection
19+
>('ESP8266')
1020
return (
1121
<>
1222
<h1>Prepare Arduino IDE</h1>
@@ -18,36 +28,71 @@ export const PrepareIde = () => {
1828
If you haven't already, add the board you wish to use (ESP8266 or ESP32)
1929
to the Arduino IDE by following these steps:
2030
</p>
21-
<p>
22-
<b>For ESP8266:</b>
23-
</p>
24-
<ol style={listStyle}>
25-
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
26-
<li>
27-
Look for "Additional Boards Manager URLs" input box and paste
28-
"http://arduino.esp8266.com/stable/package_esp8266com_index.json" in
29-
it.
30-
</li>
31-
<li>Click OK.</li>
32-
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
33-
<li>Search for ESP8266 in the boards.</li>
34-
<li>Install the ESP8266 board by ESP8266 Community.</li>
35-
</ol>
36-
<p>
37-
<b>For ESP32:</b>
38-
</p>
39-
<ol style={listStyle}>
40-
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
41-
<li>
42-
Look for "Additional Boards Manager URLs" input box and paste
43-
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
44-
in it.
45-
</li>
46-
<li>Click OK.</li>
47-
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
48-
<li>Search for ESP32 in the boards.</li>
49-
<li>Install the ESP32 board by ESP32 Community.</li>
50-
</ol>
31+
<ButtonGroup
32+
orientation={Orientation.Horizontal}
33+
style={{margin: '32px 0px'}}
34+
>
35+
<Button
36+
text="ESP8266"
37+
color={
38+
currentSelection === 'ESP8266'
39+
? ComponentColor.Primary
40+
: ComponentColor.Default
41+
}
42+
onClick={() => {
43+
setCurrentSelection('ESP8266')
44+
}}
45+
/>
46+
<Button
47+
text="ESP32"
48+
color={
49+
currentSelection === 'ESP32'
50+
? ComponentColor.Primary
51+
: ComponentColor.Default
52+
}
53+
onClick={() => {
54+
setCurrentSelection('ESP32')
55+
}}
56+
/>
57+
</ButtonGroup>
58+
{currentSelection === 'ESP8266' && (
59+
<>
60+
<p>
61+
<b>For ESP8266:</b>
62+
</p>
63+
<ol style={listStyle}>
64+
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
65+
<li>
66+
Look for "Additional Boards Manager URLs" input box and paste
67+
"http://arduino.esp8266.com/stable/package_esp8266com_index.json"
68+
in it.
69+
</li>
70+
<li>Click OK.</li>
71+
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
72+
<li>Search for ESP8266 in the boards.</li>
73+
<li>Install the ESP8266 board by ESP8266 Community.</li>
74+
</ol>
75+
</>
76+
)}
77+
{currentSelection === 'ESP32' && (
78+
<>
79+
<p>
80+
<b>For ESP32:</b>
81+
</p>
82+
<ol style={listStyle}>
83+
<li>Open the Arduino Preferences (Arduino &rarr; Preferences) </li>
84+
<li>
85+
Look for "Additional Boards Manager URLs" input box and paste
86+
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
87+
in it.
88+
</li>
89+
<li>Click OK.</li>
90+
<li>Then under Tools &rarr; Boards: , click on Boards Manager.</li>
91+
<li>Search for ESP32 in the boards.</li>
92+
<li>Install the ESP32 board by ESP32 Community.</li>
93+
</ol>
94+
</>
95+
)}
5196
</>
5297
)
5398
}

0 commit comments

Comments
 (0)