mirror of https://github.com/vector-im/riot-web
parent
ffb3e98e3e
commit
047767bab0
|
@ -34,7 +34,7 @@ const newIssueUrl = "https://github.com/vector-im/element-web/issues/new/choose"
|
||||||
interface IProps extends IDialogProps {}
|
interface IProps extends IDialogProps {}
|
||||||
|
|
||||||
const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
||||||
const [rating, setRating] = useState<string>();
|
const [rating, setRating] = useState<Rating>();
|
||||||
const [comment, setComment] = useState<string>("");
|
const [comment, setComment] = useState<string>("");
|
||||||
|
|
||||||
const onDebugLogsLinkClick = (): void => {
|
const onDebugLogsLinkClick = (): void => {
|
||||||
|
@ -45,7 +45,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
||||||
const hasFeedback = CountlyAnalytics.instance.canEnable();
|
const hasFeedback = CountlyAnalytics.instance.canEnable();
|
||||||
const onFinished = (sendFeedback: boolean): void => {
|
const onFinished = (sendFeedback: boolean): void => {
|
||||||
if (hasFeedback && sendFeedback) {
|
if (hasFeedback && sendFeedback) {
|
||||||
CountlyAnalytics.instance.reportFeedback((parseInt(rating) as Rating), comment);
|
CountlyAnalytics.instance.reportFeedback(rating, comment);
|
||||||
Modal.createTrackedDialog('Feedback sent', '', InfoDialog, {
|
Modal.createTrackedDialog('Feedback sent', '', InfoDialog, {
|
||||||
title: _t('Feedback sent'),
|
title: _t('Feedback sent'),
|
||||||
description: _t('Thank you!'),
|
description: _t('Thank you!'),
|
||||||
|
@ -68,8 +68,8 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
||||||
|
|
||||||
<StyledRadioGroup
|
<StyledRadioGroup
|
||||||
name="feedbackRating"
|
name="feedbackRating"
|
||||||
value={rating}
|
value={String(rating)}
|
||||||
onChange={setRating}
|
onChange={(r) => setRating(parseInt(r, 10) as Rating)}
|
||||||
definitions={[
|
definitions={[
|
||||||
{ value: "1", label: "😠" },
|
{ value: "1", label: "😠" },
|
||||||
{ value: "2", label: "😞" },
|
{ value: "2", label: "😞" },
|
||||||
|
@ -141,7 +141,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
||||||
{ countlyFeedbackSection }
|
{ countlyFeedbackSection }
|
||||||
</React.Fragment>}
|
</React.Fragment>}
|
||||||
button={hasFeedback ? _t("Send feedback") : _t("Go back")}
|
button={hasFeedback ? _t("Send feedback") : _t("Go back")}
|
||||||
buttonDisabled={hasFeedback && rating === ""}
|
buttonDisabled={hasFeedback && !rating}
|
||||||
onFinished={onFinished}
|
onFinished={onFinished}
|
||||||
/>);
|
/>);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue