import { Suspense, useRef, useState } from "react"; import BottomSheet from "react-modal-sheet"; import { useAtom } from "jotai"; import NewMessageArea from "./new-message-area"; import { bottomSheetOpenAtom } from "~/routes/__app/messages"; export default function NewMessageBottomSheet() { const [isOpen, setIsOpen] = useAtom(bottomSheetOpenAtom); const [recipient, setRecipient] = useState(""); const recipientRef = useRef(null); return ( { // doesn't work with iOS safari *sigh* recipientRef.current?.focus(); }} onClose={() => setIsOpen(false)} snapPoints={[0.5]} >
New Message
To: setRecipient(event.target.value)} className="bg-none border-none outline-none flex-1 text-black" type="tel" />
setIsOpen(false)} recipient={recipient} />
setIsOpen(false)} />
); }