diff --git a/app/messages/components/conversations-list.tsx b/app/messages/components/conversations-list.tsx index 82757a8..340ec7f 100644 --- a/app/messages/components/conversations-list.tsx +++ b/app/messages/components/conversations-list.tsx @@ -5,6 +5,7 @@ import getConversationsQuery from "../queries/get-conversations"; import { formatRelativeDate } from "../../core/helpers/date-formatter"; import { useEffect } from "react"; import PhoneInitLoader from "../../core/components/phone-init-loader"; +import EmptyMessages from "./empty-messages"; export default function ConversationsList() { const [conversations, query] = useQuery(getConversationsQuery, {}); @@ -17,11 +18,12 @@ export default function ConversationsList() { }, [conversations, query]); if (!conversations) { + // we're still importing messages from twilio return ; } if (Object.keys(conversations).length === 0) { - return
empty state
; + return ; } return ( diff --git a/app/messages/components/empty-messages.tsx b/app/messages/components/empty-messages.tsx new file mode 100644 index 0000000..d027f8f --- /dev/null +++ b/app/messages/components/empty-messages.tsx @@ -0,0 +1,43 @@ +import { HiPlus } from "react-icons/hi"; +import { useAtom } from "jotai"; +import { bottomSheetOpenAtom } from "../pages/messages"; + +export default function EmptyMessages() { + const setIsBottomSheetOpen = useAtom(bottomSheetOpenAtom)[1]; + const openNewMessageArea = () => setIsBottomSheetOpen(true); + + return ( +
+ +

No messages

+

+ Get started by sending a message +
+ to someone you know. +

+
+ +
+
+ ); +}