Skip to content

Commit f7a26f4

Browse files
feat(firstMile): Add MQTT create link to homepage (#5966)
* feat(firstMile): Add MQTT create link to homepage * chore: prettier * fix: svg * chore: correct test id
1 parent 46ba9e5 commit f7a26f4

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

src/homepageExperience/components/HomepageIcons.tsx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,86 @@ export const CLIIcon = (
483483
</svg>
484484
)
485485

486+
export const MQTTIcon = (
487+
<svg
488+
width="60"
489+
height="60"
490+
viewBox="0 0 60 60"
491+
fill="none"
492+
xmlns="http://www.w3.org/2000/svg"
493+
>
494+
<g filter="url(#filter0_b_1_823)">
495+
<circle cx="30" cy="30" r="30" fill="#F1F1F3" fillOpacity="0.1" />
496+
<g filter="url(#filter1_d_1_823)">
497+
<path
498+
d="M17.1408 31.31L17.0633 31.3104L17.1059 40.8879C17.109 41.579 17.7063 42.1441 18.4304 42.1409L28.7613 42.0948C28.6441 36.1093 23.4765 31.2818 17.1408 31.31V31.31ZM17.1056 23.4111L17.0281 23.4114L17.0462 27.4843C25.5671 27.4834 32.5267 33.9938 32.6532 42.0775L37.0752 42.0578C36.9515 31.7154 28.0313 23.3624 17.1056 23.4111ZM43.3406 40.7833L43.3021 32.1314C40.2711 25.1345 34.2082 19.6198 26.6844 17.0738L18.3188 17.1111C17.5948 17.1143 17.0025 17.6847 17.0056 18.3758L17.0111 19.5977C30.1221 19.5763 40.8341 29.6123 40.9671 42.0528L42.0274 42.048C42.7643 42.0324 43.3437 41.4744 43.3406 40.7833V40.7833ZM39.7979 20.5082C41.0185 21.663 42.2663 23.1261 43.2677 24.4176L43.2402 18.2466C43.24 18.0827 43.2058 17.9206 43.1397 17.7694C43.0736 17.6182 42.9768 17.4811 42.8549 17.3657C42.733 17.2504 42.5884 17.1593 42.4295 17.0975C42.2705 17.0357 42.1003 17.0046 41.9287 17.0058L35.2698 17.0355C36.826 18.053 38.4345 19.2184 39.7979 20.5082Z"
499+
fill="white"
500+
/>
501+
</g>
502+
</g>
503+
<defs>
504+
<filter
505+
id="filter0_b_1_823"
506+
x="-10"
507+
y="-10"
508+
width="80"
509+
height="80"
510+
filterUnits="userSpaceOnUse"
511+
colorInterpolationFilters="sRGB"
512+
>
513+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
514+
<feGaussianBlur in="BackgroundImageFix" stdDeviation="5" />
515+
<feComposite
516+
in2="SourceAlpha"
517+
operator="in"
518+
result="effect1_backgroundBlur_1_823"
519+
/>
520+
<feBlend
521+
mode="normal"
522+
in="SourceGraphic"
523+
in2="effect1_backgroundBlur_1_823"
524+
result="shape"
525+
/>
526+
</filter>
527+
<filter
528+
id="filter1_d_1_823"
529+
x="-4"
530+
y="0"
531+
width="68"
532+
height="68"
533+
filterUnits="userSpaceOnUse"
534+
colorInterpolationFilters="sRGB"
535+
>
536+
<feFlood floodOpacity="0" result="BackgroundImageFix" />
537+
<feColorMatrix
538+
in="SourceAlpha"
539+
type="matrix"
540+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
541+
result="hardAlpha"
542+
/>
543+
<feOffset dy="4" />
544+
<feGaussianBlur stdDeviation="2" />
545+
<feComposite in2="hardAlpha" operator="out" />
546+
<feColorMatrix
547+
type="matrix"
548+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
549+
/>
550+
<feBlend
551+
mode="normal"
552+
in2="BackgroundImageFix"
553+
result="effect1_dropShadow_1_823"
554+
/>
555+
<feBlend
556+
mode="normal"
557+
in="SourceGraphic"
558+
in2="effect1_dropShadow_1_823"
559+
result="shape"
560+
/>
561+
</filter>
562+
</defs>
563+
</svg>
564+
)
565+
486566
export const TelegrafIcon = (
487567
<svg
488568
width="60"

src/homepageExperience/containers/HomepageContainer.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
ArduinoIcon,
2626
CLIIcon,
2727
GoIcon,
28+
MQTTIcon,
2829
NodejsIcon,
2930
PythonIcon,
3031
TelegrafIcon,
@@ -54,6 +55,7 @@ export const HomepageContainer: FC = () => {
5455
const arduinoLink = `/orgs/${org.id}/new-user-setup/arduino`
5556
const pythonWizardLink = `/orgs/${org.id}/new-user-setup/python`
5657
const cliPageLink = `/orgs/${org.id}/new-user-setup/cli`
58+
const mqttPageLink = `/orgs/${org.id}/load-data/subscriptions/create`
5759
const telegrafPageLink = `/orgs/${org.id}/load-data/telegrafs`
5860
const newTelegrafPageLink = `/orgs/${org.id}/load-data/telegrafs/new`
5961
const golangLink = `/orgs/${org.id}/new-user-setup/golang`
@@ -106,6 +108,10 @@ export const HomepageContainer: FC = () => {
106108
event('firstMile.CLIButton.clicked')
107109
}
108110

111+
const logMQTTButtonClick = () => {
112+
event('firstMile.MQTTButton.clicked')
113+
}
114+
109115
const logTelegrafButtonClick = () => {
110116
event('firstMile.telegrafButton.clicked')
111117
}
@@ -225,6 +231,31 @@ export const HomepageContainer: FC = () => {
225231
</Link>
226232
</FlexBox>
227233
<hr style={{marginTop: '8px'}} />
234+
<Link
235+
to={mqttPageLink}
236+
style={linkStyle}
237+
onClick={logMQTTButtonClick}
238+
>
239+
<div
240+
className="homepage-write-data-tile"
241+
data-testid="homepage-wizard-tile--mqtt"
242+
>
243+
<div className="tile-icon-text-wrapper">
244+
<div className="icon">{MQTTIcon}</div>
245+
<div>
246+
<h4>Native MQTT</h4>
247+
<h6>
248+
Connect to your MQTT subscription in the cloud.
249+
</h6>
250+
</div>
251+
</div>
252+
253+
<Icon
254+
glyph={IconFont.ArrowRight_New}
255+
className="arrow-button"
256+
/>
257+
</div>
258+
</Link>
228259
<Link
229260
to={cliPageLink}
230261
style={linkStyle}

0 commit comments

Comments
 (0)