diff --git a/packages/desktop/src/components/User/userAvatarWithStatus.tsx b/packages/desktop/src/components/User/userAvatarWithStatus.tsx
new file mode 100644
index 0000000..92aab57
--- /dev/null
+++ b/packages/desktop/src/components/User/userAvatarWithStatus.tsx
@@ -0,0 +1,36 @@
+import { User, UserStatus } from "@nirvana/core/models";
+
+export default function UserAvatarWithStatus(props: { user: User }) {
+ return (
+
+
+
+
+
+ );
+}
+
+export function UserStatusBubble(props: { status: UserStatus }) {
+ switch (props.status) {
+ case UserStatus.ONLINE:
+ return (
+
+ );
+ case UserStatus.OFFLINE:
+ return (
+
+ );
+ case UserStatus.FLOW_STATE:
+ return (
+
+ );
+ default:
+ return (
+
+ );
+ }
+}
diff --git a/packages/desktop/src/components/User/userStatusText.tsx b/packages/desktop/src/components/User/userStatusText.tsx
new file mode 100644
index 0000000..571957e
--- /dev/null
+++ b/packages/desktop/src/components/User/userStatusText.tsx
@@ -0,0 +1,16 @@
+import { UserStatus } from "@nirvana/core/models";
+
+export default function UserStatusText(props: { status: UserStatus }) {
+ switch (props.status) {
+ case UserStatus.ONLINE:
+ return ONLINE;
+ case UserStatus.OFFLINE:
+ return <>>;
+ case UserStatus.FLOW_STATE:
+ return (
+ FLOW STATE
+ );
+ default:
+ return <>>;
+ }
+}
diff --git a/packages/desktop/src/pages/Home/conversations/index.tsx b/packages/desktop/src/pages/Home/conversations/index.tsx
index 117d879..67068ad 100644
--- a/packages/desktop/src/pages/Home/conversations/index.tsx
+++ b/packages/desktop/src/pages/Home/conversations/index.tsx
@@ -1,23 +1,32 @@
import { Add, LinkRounded } from "@mui/icons-material";
+import { $selectedConversation } from "../../../controller/recoil";
import { Avatar } from "antd";
import { FaVolumeUp } from "react-icons/fa";
import SkeletonLoader from "../../../components/loading/skeleton";
+import UserAvatarWithStatus from "../../../components/User/userAvatarWithStatus";
+import UserStatusText from "../../../components/User/userStatusText";
import { useGetAllContactBasicDetails } from "../../../controller";
+import { useRecoilState } from "recoil";
export default function Conversations() {
const { data: contactDetailsListResponse, isLoading } =
useGetAllContactBasicDetails();
+ const [selectedConvo, setSelectedConvo] = useRecoilState(
+ $selectedConversation
+ );
- /** Data we need: have this huge data store client side to be able to access
- * for now, need a simple list of contacts
- * - first list is the live/pinned
- * - second list is the pending invites, out going or incoming? or this on a separate page?
- * - third list is just the rest of my contacts
- *
- * web sockets for all of my active contacts
- * - actually play messages if pinned contact for me
- */
+ // todo: show conversations with activity/new content for me first...then the rest of the contacts
+
+ const selectContact = async (googleUserId: string) => {
+ // if this person is already selected, unselect
+ if (selectedConvo === googleUserId) {
+ setSelectedConvo(null);
+ return;
+ }
+
+ setSelectedConvo(googleUserId);
+ };
return (
<>
@@ -48,16 +57,28 @@ export default function Conversations() {
{isLoading ? : null}
+
+
+ Inbox
+
+
+
{contactDetailsListResponse?.contactsDetails.map((contactDetail) => {
return (
-
-
+
selectContact(contactDetail.otherUser.googleId)}
+ className="flex flex-row items-center hover:bg-slate-600 group border-t border-t-slate-500
+ py-4 px-2 cursor-pointer"
+ >
+
{contactDetail.otherUser.name}
- {contactDetail.otherUser.status}
+
+
+
speaking...
diff --git a/packages/desktop/src/pages/Home/header/index.tsx b/packages/desktop/src/pages/Home/header/index.tsx
index b31988c..fbb93db 100644
--- a/packages/desktop/src/pages/Home/header/index.tsx
+++ b/packages/desktop/src/pages/Home/header/index.tsx
@@ -5,6 +5,7 @@ import { useRecoilState, useSetRecoilState } from "recoil";
import { GlobalHotKeys } from "react-hotkeys";
import { STORE_ITEMS } from "../../../electron/constants";
+import UserAvatarWithStatus from "../../../components/User/userAvatarWithStatus";
import { useGetUserDetails } from "../../../controller/index";
import { useRef } from "react";
@@ -48,7 +49,7 @@ export default function Header() {
<>
-