cal/packages/ui/form/PhoneInput.tsx
sean-brydon 015ed6d4f9
Public Booking Pages (#4063)
* Teams + /book

* Consitant hoverstate across event-type cards

* Fix darkmode hover on book a team member

* Fix mobile wrapping

* Fix mobile looking awful with long links

* Fix storybook

* Fix SB

* Phone Input darkmode

* Location radio styles darkmode

* Off Topic: NIT add disable guests

* Update highlights on /book and [user]/[type]

* Fix preview URL

* Fix hover state

* Fix spacing for locations
2022-09-02 21:16:36 +00:00

31 lines
1.0 KiB
TypeScript

import BasePhoneInput, { Props } from "react-phone-number-input/react-hook-form";
import "react-phone-number-input/style.css";
export type PhoneInputProps<FormValues> = Props<
{
value: string;
id: string;
placeholder: string;
required: boolean;
},
FormValues
>;
function PhoneInput<FormValues>({ control, name, className, ...rest }: PhoneInputProps<FormValues>) {
return (
<BasePhoneInput
{...rest}
international
name={name}
control={control}
countrySelectProps={{ className: "text-black" }}
numberInputProps={{
className: "border-0 text-sm focus:ring-0 dark:bg-darkgray-100 dark:placeholder:text-darkgray-600",
}}
className={`${className} border-1 focus-within:border-brand dark:bg-darkgray-100 dark:border-darkgray-300 block w-full rounded-md rounded-sm border border-gray-300 py-px pl-3 ring-black focus-within:ring-1 disabled:text-gray-500 disabled:opacity-50 dark:text-white dark:selection:bg-green-500 disabled:dark:text-gray-500`}
/>
);
}
export default PhoneInput;