diff --git a/packages/web/components/Conversations/ConversationMemberStateIcon.tsx b/packages/web/components/Conversations/ConversationMemberStateIcon.tsx
new file mode 100644
index 0000000..60f4d25
--- /dev/null
+++ b/packages/web/components/Conversations/ConversationMemberStateIcon.tsx
@@ -0,0 +1,19 @@
+import { ConversationMemberState } from "@nirvana/common/models/conversation";
+import { FaStream, FaRegClock, FaRocket, FaCheck } from "react-icons/fa";
+
+export default function ConversationMemberStateIcon(props: {
+ convoUserAssocState: ConversationMemberState;
+}) {
+ switch (props.convoUserAssocState) {
+ case ConversationMemberState.default:
+ return ;
+ case ConversationMemberState.later:
+ return ;
+ case ConversationMemberState.priority:
+ return ;
+ case ConversationMemberState.done:
+ return ;
+ default:
+ return ;
+ }
+}
diff --git a/packages/web/components/MainTabsOrPages/ViewConvo.tsx b/packages/web/components/MainTabsOrPages/ViewConvo.tsx
index 0169ef0..434dd68 100644
--- a/packages/web/components/MainTabsOrPages/ViewConvo.tsx
+++ b/packages/web/components/MainTabsOrPages/ViewConvo.tsx
@@ -14,16 +14,23 @@ import {
FaPlay,
FaRegClock,
FaRocket,
+ FaStream,
} from "react-icons/fa";
import LinkIcon from "../Drawer/LinkIcon";
import UserAvatar, { UserAvatarSizes } from "../UserDetails/UserAvatar";
import { useRecoilValue } from "recoil";
-import { allRelevantConversationsAtom } from "../../recoil/main";
+import {
+ allRelevantConversationsAtom,
+ userConvoAssociationSelector,
+} from "../../recoil/main";
import { useRouter } from "next/router";
import Conversation from "@nirvana/common/models/conversation";
import { useAuth } from "../../contexts/authContext";
import { QueryRoutes, Routes } from "@nirvana/common/helpers/routes";
import { MasterAvatarGroupWithUserFetch } from "../UserDetails/MasterAvatarGroup";
+import { ConversationMemberState } from "../../../common/models/conversation";
+import { conversationService } from "@nirvana/common/services";
+import ConversationMemberStateIcon from "../Conversations/ConversationMemberStateIcon";
const testDrawerItems: {
linkType: LinkType;
@@ -129,6 +136,10 @@ export default function ViewConvo(props: { conversationId: string }) {
props.conversationId
);
+ const userConvoAssoc = useRecoilValue(
+ userConvoAssociationSelector(props.conversationId)
+ );
+
useEffect(() => {
if (!convo || !convo.activeMembers.includes(currUser!.uid)) {
toast.error("Not authorized for this conversation");
@@ -140,6 +151,24 @@ export default function ViewConvo(props: { conversationId: string }) {
}
}, []);
+ const handleOrganizeConversation = async (
+ toState: ConversationMemberState
+ ) => {
+ try {
+ // use service to make change in database which will change local data
+ await conversationService.updateUserConvoRelationship(
+ currUser!.uid,
+ props.conversationId,
+ toState
+ );
+
+ toast.success("Moved conversation to " + toState);
+ } catch (error) {
+ console.error(error);
+ toast.error("Problem in moving conversation");
+ }
+ };
+
return (
<>
@@ -151,21 +180,20 @@ export default function ViewConvo(props: { conversationId: string }) {
{convo?.name}
+
+
+
- {convo?.tldr && (
-
- tldr: {convo?.tldr}
-
- )}
-
-
-
+ >
+
+ Later
+
+ )}
-
+ >
+
+ Priority
+
+ )}
+
+ {userConvoAssoc?.state == ConversationMemberState.done ? (
+
+ ) : (
+
+ )}
+ {convo?.tldr && (
+
+ tldr: {convo?.tldr}
+
+ )}
+
{/* have one row, but just translate it along y downward to put it in it's own place */}
{testAudioClips.map((audClip, index) => {
diff --git a/packages/web/recoil/main.tsx b/packages/web/recoil/main.tsx
index 7e21bce..412335b 100644
--- a/packages/web/recoil/main.tsx
+++ b/packages/web/recoil/main.tsx
@@ -23,6 +23,8 @@ export enum RecoilActions {
ALL_COMPLETE_CONVERSATIONS = "ALL_COMPLETE_CONVERSATIONS",
ALL_USERS_CONVERSATION_RELATIONSHIPS = "ALL_USERS_CONVERSATION_RELATIONSHIPS",
+ USER_CONVO_ASSOCIATION_SELECTOR = "USER_CONVO_ASSOCIATION_SELECTOR",
+
ALL_RELEVANT_CONVERSATIONS = "ALL_RELEVANT_CONVERSATIONS",
SORTED_CONVERSATIONS = "SORTED_CONVERSATIONS",
@@ -66,11 +68,23 @@ import { earlierThisMonth } from "@nirvana/common/helpers/dateTime";
// approach: fill in all "bottom" level atoms, and then build the tree later with selectors
// convo id -> userMember object
-export const allUsersConversationsAtom = atom({
+export const allUsersConversationsAtom = atom