-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
feedbackSurveyLink.tsx
36 lines (32 loc) · 1.08 KB
/
feedbackSurveyLink.tsx
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
import React from "react";
import { useSelector } from "react-redux";
import externalLinkIcon from "!!raw-loader!assets/external-link.svg";
import { trustIcon } from "src/util/trust";
import {
singleVersionSelector,
clusterIdSelector,
} from "../../../../redux/nodes";
import "./feedbackSurveyLink.styl";
const FeedBackSurveyLink = () => {
const singleVersion = useSelector(singleVersionSelector);
const clusterId = useSelector(clusterIdSelector);
const feedbackLink = new URL("https://www.cockroachlabs.com/survey/");
feedbackLink.searchParams.append("clusterId", clusterId);
feedbackLink.searchParams.append("clusterVersion", singleVersion);
return clusterId && singleVersion ? (
<div
className="feedback-survey-link"
onClick={() => window.open(feedbackLink.toString())}
>
<div
className="image-container"
title="Share Feedback"
dangerouslySetInnerHTML={trustIcon(externalLinkIcon)}
/>
<div className="feedback-survey-link__title">Share feedback</div>
</div>
) : (
<></>
);
};
export default FeedBackSurveyLink;