Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ToastService } from '@open-webui-react-native/shared/utils/toast-servic
import { AppBottomSheet } from '../bottom-sheet';
import { AppButton } from '../button';
import { AppText } from '../text';
import { AppBottomSheetTextInput, AppBottomSheetTextInputRef } from '../text-input';
import { BottomSheetTextInput, BottomSheetTextInputRef } from '../text-input';
import { View } from '../view';

export type ActionButtonsModalMethods = {
Expand Down Expand Up @@ -37,7 +37,7 @@ export function ActionButtonsModal({
}: ActionButtonsModalProps): ReactElement {
const translate = useTranslation('SHARED.ACTION_BUTTONS_MODAL');
const modalRef = useRef<BottomSheetModal>(null);
const inputRef = useRef<AppBottomSheetTextInputRef>(null);
const inputRef = useRef<BottomSheetTextInputRef>(null);

const [value, setValue] = useState('');

Expand Down Expand Up @@ -82,7 +82,7 @@ export function ActionButtonsModal({
) : (
description
))}
{withInput && <AppBottomSheetTextInput
{withInput && <BottomSheetTextInput
ref={inputRef}
value={value}
onChangeText={setValue} />}
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion libs/mobile/shared/ui/ui-kit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export * from './zoom';
export * from './toast';
export * from './math-svg';
export * from './pressable';
export * from './bottom-sheet-text-input';
export * from './floated-label-input';
export * from './form-floated-label-input';
export * from './search-input';
Expand Down
5 changes: 2 additions & 3 deletions libs/mobile/shared/ui/ui-kit/src/search-input/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import { useTranslation } from '@ronas-it/react-native-common-modules/i18n';
import { ReactElement } from 'react';
import { Platform } from 'react-native';
import { cn } from '@open-webui-react-native/mobile/shared/ui/styles';
import { AppBottomSheetTextInput } from '../bottom-sheet-text-input';
import { Icon } from '../icon';
import { GestureAppPressable, AppPressable } from '../pressable';
import { AppText } from '../text';
import { AppTextInput, AppInputProps } from '../text-input';
import { BottomSheetTextInput, AppTextInput, AppInputProps } from '../text-input';
import { View } from '../view';

interface SearchInputProps extends AppInputProps {
Expand All @@ -25,7 +24,7 @@ export function SearchInput({
}: SearchInputProps): ReactElement {
const translate = useTranslation('SHARED.SEARCH_INPUT');

const InputComponent = isInBottomSheet ? AppBottomSheetTextInput : AppTextInput;
const InputComponent = isInBottomSheet ? BottomSheetTextInput : AppTextInput;

//NOTE: AppPressable does not work correctly in modal on IOS, but GestureAppPressable does not work correctly in modal on Android
const PressableComponent = Platform.OS === 'ios' ? GestureAppPressable : AppPressable;
Expand Down
14 changes: 7 additions & 7 deletions libs/mobile/shared/ui/ui-kit/src/text-input/component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BottomSheetTextInput } from '@gorhom/bottom-sheet';
import { BottomSheetTextInput as BottomSheetTextInputComponent } from '@gorhom/bottom-sheet';
import { ComponentRef, ReactElement, Ref } from 'react';
import { Platform, TextInput, TextInputProps, View } from 'react-native';
import { cn, colors } from '@open-webui-react-native/mobile/shared/ui/styles';
Expand Down Expand Up @@ -55,13 +55,13 @@ export const AppTextInput = ({
);
};

export type AppBottomSheetTextInputRef = ComponentRef<typeof BottomSheetTextInput>;
export type BottomSheetTextInputRef = ComponentRef<typeof BottomSheetTextInputComponent>;

export type AppBottomSheetInputProps = Omit<AppInputProps, 'ref'> & {
ref?: Ref<AppBottomSheetTextInputRef>;
export type BottomSheetTextInputProps = Omit<AppInputProps, 'ref'> & {
ref?: Ref<BottomSheetTextInputRef>;
};

export const AppBottomSheetTextInput = ({
export const BottomSheetTextInput = ({
onFocus,
onBlur,
label,
Expand All @@ -74,15 +74,15 @@ export const AppBottomSheetTextInput = ({
hitSlop,
ref,
...inputProps
}: AppBottomSheetInputProps): ReactElement => {
}: BottomSheetTextInputProps): ReactElement => {
const isIos = Platform.OS === 'ios';

return (
<View className={cn(baseClasses.containerClasses, className)}>
{accessoryTop}
<View className={`flex-row gap-12 items-center max-h-[${maxHeight}]`}>
{accessoryLeft}
<BottomSheetTextInput
<BottomSheetTextInputComponent
ref={ref}
className={cn(baseClasses.textClasses, isIos && '!leading-[0]', textClassName)}
placeholderTextColor={colors.textSecondary}
Expand Down
Loading