diff --git a/nym-connect/desktop/src/pages/menu/reporting/UserFeedback.tsx b/nym-connect/desktop/src/pages/menu/reporting/UserFeedback.tsx index 1295d2159b..d82ed27d82 100644 --- a/nym-connect/desktop/src/pages/menu/reporting/UserFeedback.tsx +++ b/nym-connect/desktop/src/pages/menu/reporting/UserFeedback.tsx @@ -1,9 +1,11 @@ import React, { useState } from 'react'; -import { Alert, Box, Button, FormControl, Snackbar, Stack, TextField, Typography } from '@mui/material'; -import * as Sentry from '@sentry/browser'; +import { Link as RouterLink } from 'react-router-dom'; +import { Alert, Box, Button, FormControl, Link, Snackbar, Stack, TextField, Typography } from '@mui/material'; +import * as Sentry from '@sentry/react'; import { Controller, SubmitHandler, useForm } from 'react-hook-form'; import { object, string } from 'yup'; import { yupResolver } from '@hookform/resolvers/yup'; +import { useClientContext } from '../../../context/main'; type FormValues = { email?: string; @@ -17,6 +19,7 @@ const schema = object({ export const UserFeedback = () => { const [isBusy, setIsBusy] = useState(false); + const { userData } = useClientContext(); const { handleSubmit, @@ -33,8 +36,9 @@ export const UserFeedback = () => { }); const onSubmit: SubmitHandler = (data) => { + const eventId = Sentry.captureMessage('user feedback'); Sentry.captureUserFeedback({ - event_id: 'user_feedback', + event_id: eventId, name: 'nym', email: data.email, comments: data.feedback, @@ -47,6 +51,20 @@ export const UserFeedback = () => { setIsBusy(false); }; + if (!userData?.monitoring) { + return ( + + + The error reporting option must be enabled in order to report feedback. Turn it on{' '} + + here + + . + + + ); + } + return ( @@ -92,7 +110,7 @@ export const UserFeedback = () => { name="feedback" control={control} /> -