@@ -2,13 +2,11 @@ import { BottomSheetModal } from '@gorhom/bottom-sheet';
22import { useTranslation } from '@ronas-it/react-native-common-modules/i18n' ;
33import { delay } from 'lodash-es' ;
44import { ForwardedRef , ReactElement , useImperativeHandle , useRef , useState } from 'react' ;
5- import { TextInput } from 'react-native' ;
6- import { AppKeyboardAvoidingView } from '@open-webui-react-native/mobile/shared/ui/keyboard-avoiding-view' ;
75import { ToastService } from '@open-webui-react-native/shared/utils/toast-service' ;
86import { AppBottomSheet } from '../bottom-sheet' ;
97import { AppButton } from '../button' ;
108import { AppText } from '../text' ;
11- import { AppTextInput } from '../text-input' ;
9+ import { AppBottomSheetTextInput , AppBottomSheetTextInputRef } from '../text-input' ;
1210import { View } from '../view' ;
1311
1412export type ActionButtonsModalMethods = {
@@ -39,7 +37,7 @@ export function ActionButtonsModal({
3937} : ActionButtonsModalProps ) : ReactElement {
4038 const translate = useTranslation ( 'SHARED.ACTION_BUTTONS_MODAL' ) ;
4139 const modalRef = useRef < BottomSheetModal > ( null ) ;
42- const inputRef = useRef < TextInput > ( null ) ;
40+ const inputRef = useRef < AppBottomSheetTextInputRef > ( null ) ;
4341
4442 const [ value , setValue ] = useState ( '' ) ;
4543
@@ -74,40 +72,36 @@ export function ActionButtonsModal({
7472 onOpen = { ( ) => inputRef . current ?. focus ( ) }
7573 withoutKeyboardExtraPadding
7674 content = {
77- < AppKeyboardAvoidingView
78- scrollEnabled = { isScrollable }
79- contentContainerStyleKeyboardShown = { { paddingBottom : 16 } } >
80- < View className = 'gap-12 pt-20 pb-safe android:pb-24' >
81- < AppText className = 'text-h3-sm sm:text-h3 font-medium mb-4' numberOfLines = { 1 } >
82- { title }
83- </ AppText >
84- { description &&
85- ( typeof description === 'string' ? (
86- < AppText className = 'text-text-secondary' > { description } </ AppText >
87- ) : (
88- description
89- ) ) }
90- { withInput && < AppTextInput
91- ref = { inputRef }
92- value = { value }
93- onChangeText = { setValue } /> }
94- < View className = 'flex-row gap-8' >
95- < AppButton
96- variant = 'outline'
97- text = { translate ( 'BUTTON_CANCEL' ) }
98- onPress = { closeModal }
99- disabled = { isConfirming }
100- className = 'flex-1'
101- />
102- < AppButton
103- text = { translate ( 'BUTTON_CONFIRM' ) }
104- onPress = { handleConfirm }
105- isLoading = { isConfirming }
106- className = 'flex-1'
107- />
108- </ View >
75+ < View className = 'gap-12 pt-20 pb-safe android:pb-24' >
76+ < AppText className = 'text-h3-sm sm:text-h3 font-medium mb-4' numberOfLines = { 1 } >
77+ { title }
78+ </ AppText >
79+ { description &&
80+ ( typeof description === 'string' ? (
81+ < AppText className = 'text-text-secondary' > { description } </ AppText >
82+ ) : (
83+ description
84+ ) ) }
85+ { withInput && < AppBottomSheetTextInput
86+ ref = { inputRef }
87+ value = { value }
88+ onChangeText = { setValue } /> }
89+ < View className = 'flex-row gap-8' >
90+ < AppButton
91+ variant = 'outline'
92+ text = { translate ( 'BUTTON_CANCEL' ) }
93+ onPress = { closeModal }
94+ disabled = { isConfirming }
95+ className = 'flex-1'
96+ />
97+ < AppButton
98+ text = { translate ( 'BUTTON_CONFIRM' ) }
99+ onPress = { handleConfirm }
100+ isLoading = { isConfirming }
101+ className = 'flex-1'
102+ />
109103 </ View >
110- </ AppKeyboardAvoidingView >
104+ </ View >
111105 }
112106 />
113107 ) ;
0 commit comments