diff --git a/packages/common/models/clientModels/conversationData.ts b/packages/common/models/clientModels/conversationData.ts new file mode 100644 index 0000000..f3f61e0 --- /dev/null +++ b/packages/common/models/clientModels/conversationData.ts @@ -0,0 +1,32 @@ +export default class ConversationData { + // want all of the contents of a conversation in one place for the frontend + // need all of the content items in the conversation for the past week + // can be audio clip or link for now + // if user wants more data, click button to fetch further back + // see if this convo is a priority one + // all users in the conversation: userId's perhaps, but the actual user we can get from the relevantUsersCache map +} + +// one map: all relevant users, a map we build based on where the user visits + +// one map: conversation id -> conversationData as above to get everything relevant +// fetch only all convos in last 90 days +// search for any other ones in the search bar + +// filter selector to get live convos +// filter selector to get all priority convos +// filter selector to get all later convos +// filter selector to get all done convos + +// filter selector to get a map of default "inbox" conversations: +// go through all conversations in the conversation map and place in right category +/** + * { + * "Today": [if latest message was today], + * "Last 7 Days": [if convo last message was > day - 7], + * "earlier this month": [...not in above two, but still > day - 30], + * "mm yyyy": [create these if convo is older than the last threshold] + * } + */ + +// diff --git a/packages/common/models/conversation.ts b/packages/common/models/conversation.ts index d272fc0..b98f5cf 100644 --- a/packages/common/models/conversation.ts +++ b/packages/common/models/conversation.ts @@ -6,12 +6,11 @@ export default class Conversation { name: string; // engineering, general, arjun and jacob... - createdDate: Timestamp = Timestamp.now() - createdByUserId: string + createdDate: Timestamp = Timestamp.now(); + createdByUserId: string; - - constructor(name: string createdByUserId: string) { - this.name = name; - this.createdByUserId = createdByUserId + constructor(_name: string, _createdByUserId: string) { + this.name = _name; + this.createdByUserId = _createdByUserId; } } diff --git a/packages/common/models/user.ts b/packages/common/models/user.ts index b79b053..cbe05f2 100644 --- a/packages/common/models/user.ts +++ b/packages/common/models/user.ts @@ -37,4 +37,8 @@ export enum UserStatus { online = "online", offline = "offline", busy = "busy", + + // new statuses + inLiveRoom = "inLiveRoom", + focusMode = "focusMode", } diff --git a/packages/common/models/usersConverations.ts b/packages/common/models/usersConverations.ts index e69de29..2a8483f 100644 --- a/packages/common/models/usersConverations.ts +++ b/packages/common/models/usersConverations.ts @@ -0,0 +1,31 @@ +import { v4 as uuid } from "uuid"; +import { Timestamp } from "firebase/firestore"; + +export default class UserConversation { + id: string = uuid(); + + userId: string; + conversationId: string; + state: UserConversationState; + + createdDate: Timestamp = Timestamp.now(); + lastUpdatedDate?: Timestamp; + + constructor( + _userId: string, + _conversationId: string, + _state: UserConversationState + ) { + this.userId = _userId; + this.conversationId = _conversationId; + this.state = _state; + } +} + +export enum UserConversationState { + default = "default", + priority = "priority", + later = "later", + done = "done", + // blocked = "blocked" +} diff --git a/packages/web/components/v2/Header.tsx b/packages/web/components/v2/Header.tsx index 49457c0..5496c9a 100644 --- a/packages/web/components/v2/Header.tsx +++ b/packages/web/components/v2/Header.tsx @@ -93,6 +93,10 @@ export default function Header() { /> + + {/* controls */}