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
2 changes: 1 addition & 1 deletion apps/mobile/app/(main)/chat/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function CreateChatScreen(): ReactElement {
header: <AppHeader title={translate('TEXT_NEW_CHAT')} onGoBack={handleBackPress} />,
}}
safeAreaProps={{ edges: [] }}
keyBoardAvoidingProps={{ enabled: !isBottomSheetInputFocused }}>
keyBoardAvoidingProps={{ enabled: !isBottomSheetInputFocused, bottomOffset: 60 }}>
<NoConnectionBanner isVisible={isOfflineMode} />
<CreateChat
onChatCreated={handleChatCreated}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { ComponentType } from 'react';
import { ScrollViewProps, StyleProp, ViewStyle } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-controller';
import { commonStyle } from '@open-webui-react-native/mobile/shared/ui/styles';

export type AppKeyboardAvoidingViewProps = Omit<ScrollViewProps, 'onFocus'> & {
onFocus?: ((event: any) => void) | null;
contentContainerStyleKeyboardShown?: StyleProp<ViewStyle>;
enabled?: boolean;
bottomOffset?: number;
};

// TODO: Research how use nativewind here
export const AppKeyboardAvoidingView: ComponentType<AppKeyboardAvoidingViewProps> = ({ children, ...props }) => {
const { onFocus, ...restProps } = props;
const { onFocus, contentContainerStyle, bottomOffset, ...restProps } = props;

return (
<KeyboardAwareScrollView
keyboardShouldPersistTaps='handled'
showsVerticalScrollIndicator={false}
contentContainerStyle={commonStyle.fullFlex}
contentContainerStyle={[{ flexGrow: 1 }, contentContainerStyle]}
bottomOffset={bottomOffset}
onFocus={onFocus ?? undefined}
{...restProps}>
{children}
Expand Down
5 changes: 4 additions & 1 deletion libs/mobile/shared/ui/screen-wrapper/src/lib/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ export function ScreenWrapper({
keyBoardAvoidingProps,
}: PropsWithChildren<ScreenWrapperProps>): ReactElement {
const { header, ...restScreenProps } = screenProps || {};

const content = isKeyboardAvoiding ? (
<AppKeyboardAvoidingView {...keyBoardAvoidingProps}>
<AppScreen {...restScreenProps}>{children}</AppScreen>
<AppScreen scrollDisabled {...restScreenProps}>
{children}
</AppScreen>
</AppKeyboardAvoidingView>
) : (
<AppScreen {...restScreenProps}>{children}</AppScreen>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Expose } from 'class-transformer';
import { Expose, Type } from 'class-transformer';
import { Knowledge } from './knowledge';

export class KnowledgeResponse {
@Expose()
@Type(() => Knowledge)
public items: Array<Knowledge>;

@Expose()
Expand Down
Loading