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

View File

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