Skip to content

Commit 20b878c

Browse files
alexjw3alex wang
andauthored
feat: add install dependencies page for Arduino wizard (#5397)
Co-authored-by: alex wang <alexwang@alexs-MacBook-Pro.local>
1 parent 08688aa commit 20b878c

File tree

1 file changed

+20
-107
lines changed

1 file changed

+20
-107
lines changed
Lines changed: 20 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,28 @@
1-
import {
2-
ComponentColor,
3-
Button,
4-
ButtonGroup,
5-
Orientation,
6-
} from '@influxdata/clockface'
7-
8-
import React, {FC, useEffect, useState} from 'react'
9-
import {useDispatch} from 'react-redux'
10-
import {getBuckets} from 'src/buckets/actions/thunks'
11-
import {event} from 'src/cloud/utils/reporting'
12-
import {keyboardCopyTriggered, userSelection} from 'src/utils/crossPlatform'
1+
import React, {FC} from 'react'
2+
import {SafeBlankLink} from 'src/utils/SafeBlankLink'
133

144
export const InstallDependencies: FC = () => {
15-
const dispatch = useDispatch()
16-
17-
useEffect(() => {
18-
dispatch(getBuckets())
19-
}, [])
20-
21-
const headingWithMargin = {marginTop: '48px', marginBottom: '0px'}
22-
23-
const logCopyCodeSnippet = OS => {
24-
event(`firstMile.cliWizard.installDependencies${OS}.code.copied`)
25-
}
26-
27-
type CurrentOSSelection = 'Linux' | 'Mac' | 'Windows'
28-
const [currentSelection, setCurrentSelection] = useState<CurrentOSSelection>(
29-
'Mac'
30-
)
31-
32-
useEffect(() => {
33-
const fireKeyboardCopyEvent = event => {
34-
if (
35-
keyboardCopyTriggered(event) &&
36-
userSelection().includes('brew install')
37-
) {
38-
logCopyCodeSnippet('Mac')
39-
}
40-
if (
41-
keyboardCopyTriggered(event) &&
42-
(userSelection().includes('Expand-Archive') ||
43-
userSelection().includes('mv'))
44-
) {
45-
logCopyCodeSnippet('Windows')
46-
}
47-
if (
48-
keyboardCopyTriggered(event) &&
49-
(userSelection().includes('wget') ||
50-
userSelection().includes('tar') ||
51-
userSelection().includes('sudo'))
52-
) {
53-
logCopyCodeSnippet('Linux')
54-
}
55-
}
56-
document.addEventListener('keydown', fireKeyboardCopyEvent)
57-
return () => document.removeEventListener('keydown', fireKeyboardCopyEvent)
58-
}, [])
59-
605
return (
616
<>
627
<h1>Install Dependencies</h1>
63-
<ButtonGroup orientation={Orientation.Horizontal}>
64-
<Button
65-
text="mac OS"
66-
color={
67-
currentSelection === 'Mac'
68-
? ComponentColor.Primary
69-
: ComponentColor.Default
70-
}
71-
onClick={() => {
72-
setCurrentSelection('Mac')
73-
}}
74-
/>
75-
<Button
76-
text="windows"
77-
color={
78-
currentSelection === 'Windows'
79-
? ComponentColor.Primary
80-
: ComponentColor.Default
81-
}
82-
onClick={() => {
83-
setCurrentSelection('Windows')
84-
}}
85-
/>
86-
<Button
87-
text="linux"
88-
color={
89-
currentSelection === 'Linux'
90-
? ComponentColor.Primary
91-
: ComponentColor.Default
92-
}
93-
onClick={() => {
94-
setCurrentSelection('Linux')
95-
}}
96-
/>
97-
</ButtonGroup>
98-
{currentSelection === 'Mac' && (
99-
<>
100-
<h2 style={headingWithMargin}>Use Homebrew</h2>
101-
</>
102-
)}
103-
{currentSelection === 'Windows' && (
104-
<>
105-
<h2 style={headingWithMargin}>Download the CLI package</h2>
106-
</>
107-
)}
108-
{currentSelection === 'Linux' && (
109-
<>
110-
<h2 style={headingWithMargin}>Download from the command line</h2>
111-
</>
112-
)}
8+
<p>
9+
You can install the required InfluxDB Client for Arduino library from
10+
the library manager
11+
</p>
12+
<ol style={{fontSize: '16px', fontWeight: 'normal'}}>
13+
<li>
14+
Under Sketch &rarr; Include Libraries, click on Manage Libraries.
15+
</li>
16+
<li>Search for 'influxdb' in the search box.</li>
17+
<li>Install 'InfluxDB Client for Arduino' library.</li>
18+
</ol>
19+
<p>
20+
You'll need to have{' '}
21+
<SafeBlankLink href="https://www.arduino.cc/en/software">
22+
Arduino
23+
</SafeBlankLink>{' '}
24+
installed.
25+
</p>
11326
</>
11427
)
11528
}

0 commit comments

Comments
 (0)