2022-05-19 23:16:38 +00:00
|
|
|
import { useLoaderData } from "superjson-remix";
|
2022-05-14 10:22:06 +00:00
|
|
|
|
2022-05-19 23:16:38 +00:00
|
|
|
import messagesLoader, { type MessagesLoaderData } from "~/features/messages/loaders/messages";
|
2022-05-14 10:22:06 +00:00
|
|
|
import PageTitle from "~/features/core/components/page-title";
|
|
|
|
import MissingTwilioCredentials from "~/features/core/components/missing-twilio-credentials";
|
|
|
|
import ConversationsList from "~/features/messages/components/conversations-list";
|
2022-05-19 23:16:38 +00:00
|
|
|
import NewMessageButton from "~/features/messages/components/new-message-button";
|
2022-05-14 10:22:06 +00:00
|
|
|
|
2022-05-19 23:16:38 +00:00
|
|
|
export const loader = messagesLoader;
|
2022-05-14 10:22:06 +00:00
|
|
|
|
|
|
|
export default function MessagesPage() {
|
|
|
|
const { user } = useLoaderData<MessagesLoaderData>();
|
|
|
|
|
2022-05-17 23:54:06 +00:00
|
|
|
if (!user.hasPhoneNumber) {
|
2022-05-14 10:22:06 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<MissingTwilioCredentials />
|
|
|
|
<PageTitle className="filter blur-sm select-none absolute top-0" title="Messages" />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageTitle title="Messages" />
|
|
|
|
<section className="flex flex-grow flex-col">
|
|
|
|
<ConversationsList />
|
|
|
|
</section>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|