Booking page improvements (#2260)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Omar López 2022-03-23 19:27:35 -07:00 committed by GitHub
parent 87dcdec044
commit 1a27edd462
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -6,13 +6,13 @@ import { useSession } from "next-auth/react";
import dynamic from "next/dynamic";
import Head from "next/head";
import { useRouter } from "next/router";
import React, { useEffect, useMemo, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import { Controller, useForm, useWatch } from "react-hook-form";
import { FormattedNumber, IntlProvider } from "react-intl";
import { ReactMultiEmail } from "react-multi-email";
import { useMutation } from "react-query";
import { v4 as uuidv4 } from "uuid";
import { HttpError } from "@calcom/lib/http-error";
import { createPaymentLink } from "@calcom/stripe/client";
import { Button } from "@calcom/ui/Button";
import { EmailInput, Form } from "@calcom/ui/form/fields";
@ -361,6 +361,7 @@ const BookingPage = ({ eventType, booking, profile }: BookingPageProps) => {
required
className="focus:border-brand block w-full rounded-sm border-gray-300 shadow-sm focus:ring-black dark:border-gray-900 dark:bg-black dark:text-white dark:selection:bg-green-500 sm:text-sm"
placeholder="you@example.com"
type="search" // Disables annoying 1password intrusive popup (non-optimal, I know I know...)
/>
</div>
</div>
@ -549,7 +550,8 @@ const BookingPage = ({ eventType, booking, profile }: BookingPageProps) => {
</div>
<div className="ltr:ml-3 rtl:mr-3">
<p className="text-sm text-yellow-700">
{rescheduleUid ? t("reschedule_fail") : t("booking_fail")}
{rescheduleUid ? t("reschedule_fail") : t("booking_fail")}{" "}
{(mutation.error as HttpError)?.message}
</p>
</div>
</div>

View File

@ -5,7 +5,11 @@ async function http<T>(path: string, config: RequestInit): Promise<T> {
const response: Response = await fetch(request);
if (!response.ok) {
const err = HttpError.fromRequest(request, response);
const errJson = await response.json();
const err = HttpError.fromRequest(request, {
...response,
statusText: errJson.message || response.statusText,
});
throw err;
}
// may error if there is no body, return empty array