diff options
| author | MohamedBassem <me@mbassem.com> | 2024-08-26 13:41:13 +0300 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-08-26 16:17:35 +0300 |
| commit | b094b2cecb0da1bcdf4c63dd081638d87793c53c (patch) | |
| tree | 332db48228a83a43e3336aa8e818c70e58b4f85d /apps/mobile/components/ui/Input.tsx | |
| parent | 8410a6d3c125cf27daa4e3abeb4c4a4d228e2cfd (diff) | |
| download | karakeep-b094b2cecb0da1bcdf4c63dd081638d87793c53c.tar.zst | |
feature(mobile): Change the view bookmark page to be a modal and add tags and
notes
Diffstat (limited to 'apps/mobile/components/ui/Input.tsx')
| -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> ), ); |
