Add success message

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2023-05-05 19:36:23 +02:00
parent 4c1168aaf7
commit 6cad89b20c
No known key found for this signature in database
GPG Key ID: D1D45825D60C24D2

View File

@ -30,7 +30,7 @@ interface Props {
export function FeedbackSettingsTab({ roomId }: Props) {
const { t } = useTranslation();
const { submitRageshake, sending, error } = useSubmitRageshake();
const { submitRageshake, sending, sent, error } = useSubmitRageshake();
const sendRageshakeRequest = useRageshakeRequest();
const onSubmitFeedback = useCallback(
@ -72,27 +72,30 @@ export function FeedbackSettingsTab({ roomId }: Props) {
name="description"
label={t("Your feedback")}
type="textarea"
disabled={sending || sent}
/>
</FieldRow>
<FieldRow>
<InputField
id="sendLogs"
name="sendLogs"
label={t("Include debug logs")}
type="checkbox"
defaultChecked
/>
</FieldRow>
{error && (
{sent ? (
<Body> {t("Thanks, we received your feedback!")}</Body>
) : (
<FieldRow>
<ErrorMessage error={error} />
<InputField
id="sendLogs"
name="sendLogs"
label={t("Include debug logs")}
type="checkbox"
defaultChecked
/>
{error && (
<FieldRow>
<ErrorMessage error={error} />
</FieldRow>
)}
<Button type="submit" disabled={sending}>
{sending ? t("Submitting…") : t("Submit")}
</Button>
</FieldRow>
)}
<FieldRow>
<Button type="submit" disabled={sending}>
{sending ? t("Submitting…") : t("Submit")}
</Button>
</FieldRow>
</form>
</div>
);