Split ShareViaChatDialog (#4383)
parent
5d2119ffe5
commit
1f954c1065
|
@ -15,8 +15,24 @@ export function SendViaChatDialog({
|
||||||
control: Dialog.DialogControlProps
|
control: Dialog.DialogControlProps
|
||||||
onSelectChat: (chatId: string) => void
|
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({
|
const {mutate: createChat} = useGetConvoForMembers({
|
||||||
onSuccess: data => {
|
onSuccess: data => {
|
||||||
onSelectChat(data.convo.id)
|
onSelectChat(data.convo.id)
|
||||||
|
@ -39,15 +55,10 @@ export function SendViaChatDialog({
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog.Outer
|
<SearchablePeopleList
|
||||||
control={control}
|
title={_(msg`Send post to...`)}
|
||||||
testID="sendViaChatChatDialog"
|
onSelectChat={onCreateChat}
|
||||||
nativeOptions={{sheet: {snapPoints: ['100%']}}}>
|
showRecentConvos
|
||||||
<SearchablePeopleList
|
/>
|
||||||
title={_(msg`Send post to...`)}
|
|
||||||
onSelectChat={onCreateChat}
|
|
||||||
showRecentConvos
|
|
||||||
/>
|
|
||||||
</Dialog.Outer>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue