diff options
author | dan <dan.abramov@gmail.com> | 2024-06-06 01:10:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-06 01:10:21 +0100 |
commit | 1f954c106562bd79385248a3d1c119f5cbe48a9a (patch) | |
tree | 235226d70b1e547a3a5aedd8e54ba82754ba47bf /src | |
parent | 5d2119ffe5971941900704f306786c5c127d0fd3 (diff) | |
download | voidsky-1f954c106562bd79385248a3d1c119f5cbe48a9a.tar.zst |
Split ShareViaChatDialog (#4383)
Diffstat (limited to 'src')
-rw-r--r-- | src/components/dms/dialogs/ShareViaChatDialog.tsx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/components/dms/dialogs/ShareViaChatDialog.tsx b/src/components/dms/dialogs/ShareViaChatDialog.tsx index d353eebe6..d2fefd33b 100644 --- a/src/components/dms/dialogs/ShareViaChatDialog.tsx +++ b/src/components/dms/dialogs/ShareViaChatDialog.tsx @@ -15,8 +15,24 @@ export function SendViaChatDialog({ control: Dialog.DialogControlProps onSelectChat: (chatId: string) => void }) { - const {_} = useLingui() + return ( + <Dialog.Outer + control={control} + testID="sendViaChatChatDialog" + nativeOptions={{sheet: {snapPoints: ['100%']}}}> + <SendViaChatDialogInner control={control} onSelectChat={onSelectChat} /> + </Dialog.Outer> + ) +} +function SendViaChatDialogInner({ + control, + onSelectChat, +}: { + control: Dialog.DialogControlProps + onSelectChat: (chatId: string) => void +}) { + const {_} = useLingui() const {mutate: createChat} = useGetConvoForMembers({ onSuccess: data => { onSelectChat(data.convo.id) @@ -39,15 +55,10 @@ export function SendViaChatDialog({ ) return ( - <Dialog.Outer - control={control} - testID="sendViaChatChatDialog" - nativeOptions={{sheet: {snapPoints: ['100%']}}}> - <SearchablePeopleList - title={_(msg`Send post to...`)} - onSelectChat={onCreateChat} - showRecentConvos - /> - </Dialog.Outer> + <SearchablePeopleList + title={_(msg`Send post to...`)} + onSelectChat={onCreateChat} + showRecentConvos + /> ) } |