InstantMessageComposeDialog
Bottom-sheet launcher for the InstantMessageComposer, wired to the Docyrus SMS / WhatsApp messaging API.
Installation
pnpm dlx @docyrus/cli add @docyrus/rn-instant-message-compose-dialogpnpm add @tanstack/react-query @docyrus/api-clientA full-height bottom sheet with the InstantMessageComposer, wired through useDocyrusInstantMessageComposer. The form mounts only while the sheet is open, so the SMS / WhatsApp account queries only run while it is visible. A successful send shows a toast, calls onSent and closes the sheet. A QueryClientProvider must be mounted above it.
Phone value renderers and form fields open this dialog when you pass them a client (and no onSendMessage).
Usage
import { InstantMessageComposeDialog } from '@/components/docyrus-native/instant-message-compose-dialog';
<InstantMessageComposeDialog client={client} to={['+905551234567']} />
<InstantMessageComposeDialog
client={client}
channel="whatsapp"
availableChannels={['whatsapp']}
body="Your order has shipped."
trigger={null}
open={open}
onOpenChange={setOpen} />API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
client | RestApiClient | - | Authenticated Docyrus REST client (required) |
to | string[] | - | Pre-filled recipient phone numbers |
body | string | - | Pre-filled body |
channel | 'sms' | 'whatsapp' | 'sms' | Initial channel |
availableChannels | ReadonlyArray<InstantMessageChannel> | ['sms', 'whatsapp'] | Channels in the switcher |
trigger | ReactNode | null | - | Trigger node (default: message icon button); null renders none |
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Open state change callback |
title | string | 'Send message' | Sheet title |
disabled | boolean | - | Disables the default trigger |
onSent | (result: DocyrusInstantMessageSendResult) => void | - | Called after a successful send |
className | string | - | Trigger classes |
Type Exports
| Type | Description |
|---|---|
InstantMessageComposeDialogProps | Props |
ImageEditor
Gesture-driven image crop editor with pan and pinch zoom, resizable crop box, circle stencil, rotate and flip, returning the edited image file.
InstantMessageComposer
SMS and WhatsApp composer with a channel switcher, phone recipient chips, SMS segment counter, emoji and WhatsApp attachments.