Skip to content

Commit 0828639

Browse files
committed
fix(mobile): center dictation in the split composer
1 parent a17de0d commit 0828639

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/mobile/src/features/threads/ThreadComposer.tsx‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
571571
const [compactRowWidth, setCompactRowWidth] = useState(0);
572572
const compactAttachmentLimit = compactRowWidth >= 500 ? 3 : 1;
573573
const compactEditor = useCompactComposerEditor(bodyText, draftMessage);
574+
const composerVerticalPadding = usesLargeControls
575+
? 9
576+
: splitAndroidComposer
577+
? Math.max(2, (fabSize - compactEditor.compactRowHeight) / 2)
578+
: 2;
574579
const showsCompactDictation = isVoiceInputPresented;
575580
const isToolbarVisible = isVoiceInputPresented;
576581
const hasEditingAttachments =
@@ -860,11 +865,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
860865
borderRadius: usesLargeControls ? 31 : 27,
861866
borderCurve: "circular",
862867
overflow: "hidden",
863-
paddingVertical: usesLargeControls
864-
? 9
865-
: splitAndroidComposer
866-
? Math.max(2, (fabSize - compactEditor.compactRowHeight) / 2)
867-
: 2,
868+
paddingVertical: composerVerticalPadding,
868869
}}
869870
>
870871
{isExpanded ? editingAttachments : null}
@@ -1115,7 +1116,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
11151116
collapsable={false}
11161117
importantForAccessibility={isToolbarVisible ? "auto" : "no-hide-descendants"}
11171118
pointerEvents={isToolbarVisible ? "auto" : "none"}
1118-
style={{ position: "absolute", bottom: usesLargeControls ? 9 : 2, left: 0, right: 0 }}
1119+
style={{ position: "absolute", bottom: composerVerticalPadding, left: 0, right: 0 }}
11191120
>
11201121
<ComposerDictationToolbar
11211122
showsDictation={isVoiceInputPresented}

0 commit comments

Comments
 (0)