showing later and done convos
This commit is contained in:
@@ -1,19 +1,34 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { FaCheck } from "react-icons/fa";
|
import { FaCheck } from "react-icons/fa";
|
||||||
|
import { useRecoilValue } from "recoil";
|
||||||
|
import { doneConvosSelector } from "../../recoil/main";
|
||||||
|
import ConversationFullRow from "../Conversations/ConversationFullRow";
|
||||||
|
|
||||||
export default function Done() {
|
export default function Done() {
|
||||||
return (
|
const doneConvos = useRecoilValue(doneConvosSelector);
|
||||||
<div className="mx-auto my-auto flex flex-col">
|
|
||||||
<img
|
|
||||||
src="/illustrations/undraw_scooter_re_lrsb.svg"
|
|
||||||
className="h-[15rem] mx-auto my-auto"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<span></span>
|
return (
|
||||||
<span className="text-slate-400 text-center mt-5">
|
<>
|
||||||
Add things to <FaCheck className="inline" /> done to <br></br> clear
|
{doneConvos?.length > 0 ? (
|
||||||
your mind.
|
<span className="flex flex-col w-full items-stretch">
|
||||||
</span>
|
{doneConvos.map((tRoom) => (
|
||||||
</div>
|
<ConversationFullRow key={tRoom.id} conversation={tRoom} />
|
||||||
|
))}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<div className="mx-auto my-auto flex flex-col">
|
||||||
|
<img
|
||||||
|
src="/illustrations/undraw_scooter_re_lrsb.svg"
|
||||||
|
className="h-[15rem] mx-auto my-auto"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span></span>
|
||||||
|
<span className="text-slate-400 text-center mt-5">
|
||||||
|
Add things to <FaCheck className="inline" /> done to <br></br> clear
|
||||||
|
your mind.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,35 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { FaRegClock } from "react-icons/fa";
|
import { FaRegClock } from "react-icons/fa";
|
||||||
|
import { useRecoilValue } from "recoil";
|
||||||
|
import { laterConvosSelector } from "../../recoil/main";
|
||||||
|
import ConversationFullRow from "../Conversations/ConversationFullRow";
|
||||||
|
|
||||||
export default function Later() {
|
export default function Later() {
|
||||||
console.log("re-rendering later");
|
const laterConvos = useRecoilValue(laterConvosSelector);
|
||||||
return (
|
|
||||||
<div className="mx-auto my-auto flex flex-col">
|
|
||||||
<img
|
|
||||||
src="/illustrations/undraw_season_change_f99v.svg"
|
|
||||||
className="h-[15rem] mx-auto my-auto"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<span></span>
|
return (
|
||||||
<span className="text-slate-400 text-center mt-5">
|
<>
|
||||||
Focusing right now? <br></br> No worries, go through low-priority{" "}
|
{laterConvos?.length > 0 ? (
|
||||||
<br></br>
|
<span className="flex flex-col w-full items-stretch">
|
||||||
conversations <FaRegClock className="inline" /> later.
|
{laterConvos.map((tRoom) => (
|
||||||
</span>
|
<ConversationFullRow key={tRoom.id} conversation={tRoom} />
|
||||||
</div>
|
))}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
<div className="mx-auto my-auto flex flex-col">
|
||||||
|
<img
|
||||||
|
src="/illustrations/undraw_season_change_f99v.svg"
|
||||||
|
className="h-[15rem] mx-auto my-auto"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<span></span>
|
||||||
|
<span className="text-slate-400 text-center mt-5">
|
||||||
|
Focusing right now? <br></br> No worries, go through low-priority{" "}
|
||||||
|
<br></br>
|
||||||
|
conversations <FaRegClock className="inline" /> later.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ export enum RecoilActions {
|
|||||||
|
|
||||||
SORTED_CONVERSATIONS = "SORTED_CONVERSATIONS",
|
SORTED_CONVERSATIONS = "SORTED_CONVERSATIONS",
|
||||||
LIVE_ROOMS = "LIVE_ROOMS",
|
LIVE_ROOMS = "LIVE_ROOMS",
|
||||||
|
LATER_CONVERSATIONS_SELECTOR = "LATER_CONVERSATIONS_SELECTOR",
|
||||||
|
PRIORITY_CONVERSATIONS_SELECTOR = "PRIORITY_CONVERSATIONS_SELECTOR",
|
||||||
|
DONE_CONVERSATIONS_SELECTOR = "DONE_CONVERSATIONS_SELECTOR",
|
||||||
RELATIVE_TIME_SECTIONS_CONVOS = "RELATIVE_TIME_SECTIONS_CONVOS",
|
RELATIVE_TIME_SECTIONS_CONVOS = "RELATIVE_TIME_SECTIONS_CONVOS",
|
||||||
|
|
||||||
CHECK_INCOMING_MESSAGE = "CHECK_INCOMING_MESSAGE",
|
CHECK_INCOMING_MESSAGE = "CHECK_INCOMING_MESSAGE",
|
||||||
@@ -113,6 +116,65 @@ export const liveRoomsSelector = selector<Conversation[]>({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const laterConvosSelector = selector<Conversation[]>({
|
||||||
|
key: RecoilActions.LATER_CONVERSATIONS_SELECTOR,
|
||||||
|
get: ({ get }) => {
|
||||||
|
const sortedConvos = get(sortedRoomSelector);
|
||||||
|
const convoUserMap = get(allUsersConversationsAtom);
|
||||||
|
|
||||||
|
const laterConvos: Conversation[] = sortedConvos.filter((conv) => {
|
||||||
|
// get the userconvoAssoc and see the state
|
||||||
|
if (convoUserMap.get(conv.id)?.state == ConversationMemberState.later) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return laterConvos;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const priorityConvosSelector = selector<Conversation[]>({
|
||||||
|
key: RecoilActions.PRIORITY_CONVERSATIONS_SELECTOR,
|
||||||
|
get: ({ get }) => {
|
||||||
|
const sortedConvos = get(sortedRoomSelector);
|
||||||
|
const convoUserMap = get(allUsersConversationsAtom);
|
||||||
|
|
||||||
|
const priorityConvos: Conversation[] = sortedConvos.filter((conv) => {
|
||||||
|
// get the userconvoAssoc and see the state
|
||||||
|
if (
|
||||||
|
convoUserMap.get(conv.id)?.state == ConversationMemberState.priority
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return priorityConvos;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const doneConvosSelector = selector<Conversation[]>({
|
||||||
|
key: RecoilActions.DONE_CONVERSATIONS_SELECTOR,
|
||||||
|
get: ({ get }) => {
|
||||||
|
const sortedConvos = get(sortedRoomSelector);
|
||||||
|
const convoUserMap = get(allUsersConversationsAtom);
|
||||||
|
|
||||||
|
const doneConvos: Conversation[] = sortedConvos.filter((conv) => {
|
||||||
|
// get the userconvoAssoc and see the state
|
||||||
|
if (convoUserMap.get(conv.id)?.state == ConversationMemberState.done) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return doneConvos;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export enum RelativeTimeConvosSections {
|
export enum RelativeTimeConvosSections {
|
||||||
today = "TODAY",
|
today = "TODAY",
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user