Skip to content

Commit

Permalink
use single definition for DEFAULT_MESSAGE_INPUT_HEIGHT
Browse files Browse the repository at this point in the history
  • Loading branch information
patosullivan committed Jun 12, 2024
1 parent e0d124e commit 390a68a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/DetailView/DetailView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import AuthorRow from '../AuthorRow';
import Scroller from '../Channel/Scroller';
import { ChatMessage } from '../ChatMessage';
import { MessageInput } from '../MessageInput';
import { DEFAULT_MESSAGE_INPUT_HEIGHT } from '../MessageInput/index.native';
import { DEFAULT_MESSAGE_INPUT_HEIGHT } from '../MessageInput';

export interface DetailViewProps {
post: db.Post;
Expand Down
5 changes: 1 addition & 4 deletions packages/ui/src/components/MessageInput/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
useWindowDimensions,
} from 'tamagui';

import { DEFAULT_MESSAGE_INPUT_HEIGHT } from '.';
import { useReferences } from '../../contexts/references';
import { XStack } from '../../core';
import { MessageInputContainer, MessageInputProps } from './MessageInputBase';
Expand Down Expand Up @@ -88,10 +89,6 @@ const getInjectedJS = (bridgeExtensions: BridgeExtension[]) => {
return injectJS;
};

// 44 accounts for the 12px padding around the text within the input
// and the 20px line height of the text. 12 + 20 + 12 = 52
export const DEFAULT_MESSAGE_INPUT_HEIGHT = 44;

export interface MessageInputHandle {
editor: EditorBridge | null;
setEditor: (editor: EditorBridge) => void;
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';

// 44 accounts for the 12px padding around the text within the input
// and the 20px line height of the text. 12 + 20 + 12 = 52
export const DEFAULT_MESSAGE_INPUT_HEIGHT = 44;

export function MessageInput({
Expand Down

0 comments on commit 390a68a

Please sign in to comment.