cal.pub0.org/apps/web/components/ui/form/PhoneInput.tsx

22 lines
779 B
TypeScript
Raw Normal View History

import React from "react";
2022-01-19 16:24:01 +00:00
import BasePhoneInput, { Props as PhoneInputProps } from "react-phone-number-input";
import "react-phone-number-input/style.css";
import classNames from "@lib/classNames";
2022-01-19 16:24:01 +00:00
import { Optional } from "@lib/types/utils";
2022-01-19 16:24:01 +00:00
export const PhoneInput = (props: Optional<PhoneInputProps, "onChange">) => (
<BasePhoneInput
{...props}
className={classNames(
2022-02-09 22:32:31 +00:00
"border-1 focus-within:border-brand block w-full rounded-sm border border-gray-300 py-px px-3 shadow-sm ring-black focus-within:ring-1 dark:border-black dark:bg-black dark:text-white",
props.className
)}
onChange={() => {
/* DO NOT REMOVE: Callback required by PhoneInput, comment added to satisfy eslint:no-empty-function */
}}
/>
);
export default PhoneInput;