diff options
Diffstat (limited to 'apps/mobile/components/ui')
| -rw-r--r-- | apps/mobile/components/ui/Input.tsx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/mobile/components/ui/Input.tsx b/apps/mobile/components/ui/Input.tsx index 57d16f5d..dc84f54f 100644 --- a/apps/mobile/components/ui/Input.tsx +++ b/apps/mobile/components/ui/Input.tsx @@ -1,5 +1,5 @@ import { forwardRef } from "react"; -import { Text, TextInput, View } from "react-native"; +import { ActivityIndicator, Text, TextInput, View } from "react-native"; import { cn } from "@/lib/utils"; import { TailwindResolver } from "../TailwindResolver"; @@ -11,8 +11,14 @@ export interface InputProps inputClasses?: string; } -const Input = forwardRef<React.ElementRef<typeof TextInput>, InputProps>( - ({ className, label, labelClasses, inputClasses, ...props }, ref) => ( +const Input = forwardRef< + React.ElementRef<typeof TextInput>, + InputProps & { loading?: boolean } +>( + ( + { className, label, labelClasses, inputClasses, loading, ...props }, + ref, + ) => ( <View className={cn("flex flex-col gap-1.5", className)}> {label && <Text className={cn("text-base", labelClasses)}>{label}</Text>} <TailwindResolver @@ -30,6 +36,9 @@ const Input = forwardRef<React.ElementRef<typeof TextInput>, InputProps>( /> )} /> + {loading && ( + <ActivityIndicator className="absolute bottom-0 right-0 p-2" /> + )} </View> ), ); |
