2021-08-25 10:18:37 +00:00
|
|
|
import React from "react";
|
2022-01-19 16:24:01 +00:00
|
|
|
import BasePhoneInput, { Props as PhoneInputProps } from "react-phone-number-input";
|
2021-09-22 19:52:38 +00:00
|
|
|
import "react-phone-number-input/style.css";
|
|
|
|
|
2021-08-25 10:18:37 +00:00
|
|
|
import classNames from "@lib/classNames";
|
2022-01-19 16:24:01 +00:00
|
|
|
import { Optional } from "@lib/types/utils";
|
2021-08-25 10:18:37 +00:00
|
|
|
|
2022-01-19 16:24:01 +00:00
|
|
|
export const PhoneInput = (props: Optional<PhoneInputProps, "onChange">) => (
|
2021-08-25 10:18:37 +00:00
|
|
|
<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",
|
2021-08-25 10:18:37 +00:00
|
|
|
props.className
|
|
|
|
)}
|
|
|
|
onChange={() => {
|
|
|
|
/* DO NOT REMOVE: Callback required by PhoneInput, comment added to satisfy eslint:no-empty-function */
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default PhoneInput;
|