From 34f1477701b3016f2536afc92eac2883c6725f5e Mon Sep 17 00:00:00 2001 From: Jul Guga Date: Sat, 9 Nov 2024 14:56:46 +0100 Subject: [PATCH] update & fix phone-input from latest modification from shadcn components --- components/ui/phone-input.tsx | 56 ++++++++++++++-------------- content/snippets/phone-input.mdx | 64 ++++++++++++++++---------------- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/components/ui/phone-input.tsx b/components/ui/phone-input.tsx index 05aa88f..f97f978 100644 --- a/components/ui/phone-input.tsx +++ b/components/ui/phone-input.tsx @@ -15,7 +15,7 @@ import { CommandItem, CommandList, } from "@/components/ui/command"; -import { Input, InputProps } from "@/components/ui/input"; +import { Input } from "@/components/ui/input"; import { Popover, PopoverContent, @@ -36,38 +36,38 @@ type PhoneInputProps = Omit< const PhoneInput: React.ForwardRefExoticComponent = React.forwardRef, PhoneInputProps>( ({ className, onChange, ...props }, ref) => { - return ( + return ( onChange?.(value || ("" as RPNInput.Value))} - {...props} - /> - ); + {...props} + /> + ); }, ); PhoneInput.displayName = "PhoneInput"; -const InputComponent = React.forwardRef( - ({ className, ...props }, ref) => ( - >( +({ className, ...props }, ref) => ( + + {...props} + ref={ref} + /> ), ); InputComponent.displayName = "InputComponent"; @@ -100,7 +100,7 @@ const CountrySelect = ({