Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native: reduce space within/between chat messages, fix keyboard offset in thread view #3606

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions packages/ui/src/components/ChatMessage/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ const ChatMessage = ({
<YStack
onLongPress={handleLongPress}
key={post.id}
gap="$l"
paddingVertical="$m"
gap="$s"
paddingVertical="$xs"
paddingRight="$l"
>
{showAuthor ? (
<View paddingLeft="$l">
<View paddingLeft="$l" paddingTop="$s">
<AuthorRow
author={post.author}
authorId={post.authorId}
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/MessageInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useState } from 'react';
import { TextArea } from '../../core';
import { MessageInputContainer, MessageInputProps } from './MessageInputBase';

export const DEFAULT_MESSAGE_INPUT_HEIGHT = 44;
patosullivan marked this conversation as resolved.
Show resolved Hide resolved

export function MessageInput({
shouldBlur,
setShouldBlur,
Expand Down
6 changes: 4 additions & 2 deletions packages/ui/src/components/PostScreenView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import UploadedImagePreview from './Channel/UploadedImagePreview';
import { ChatMessage } from './ChatMessage';
import { NotebookDetailView } from './DetailView';
import GalleryDetailView from './DetailView/GalleryDetailView';
import { MessageInput } from './MessageInput';
import { DEFAULT_MESSAGE_INPUT_HEIGHT, MessageInput } from './MessageInput';

export function PostScreenView({
currentUserId,
Expand Down Expand Up @@ -96,7 +96,9 @@ export function PostScreenView({
<KeyboardAvoidingView
//TODO: Standardize this component, account for tab bar in a better way
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
// keyboardVerticalOffset={70}
keyboardVerticalOffset={
Platform.OS === 'ios' ? -bottom : DEFAULT_MESSAGE_INPUT_HEIGHT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to extract this wrapper component and use across multiple screens? I'm guessing we have similar in other places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked for that, afaict this is the only place with this exact offset.

}
style={{ flex: 1 }}
>
{parentPost && channel.type === 'gallery' && (
Expand Down