-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Archived folder to ui and finalized SQL queries for archived items
- Loading branch information
Showing
8 changed files
with
182 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { | ||
ResizableHandle, | ||
ResizablePanel, | ||
ResizablePanelGroup, | ||
} from "@shadcn/resizable"; | ||
import { Separator } from "@shadcn/separator"; | ||
|
||
import { MailDisplay } from "@components/mail-display"; | ||
import { MailList } from "@components/mail-list"; | ||
|
||
import { useArchivedMessages } from "@hooks"; | ||
import { useEffect } from "react"; | ||
import { EmptyBox, ModeToggle } from "@components"; | ||
|
||
export function Archived() { | ||
const { query, selectedMessage, setSelectedMessageId } = | ||
useArchivedMessages(); | ||
|
||
useEffect(() => { | ||
setSelectedMessageId(""); | ||
}, []); | ||
|
||
return ( | ||
<ResizablePanelGroup | ||
direction="horizontal" | ||
className="items-stretch" | ||
autoSaveId="post-list-panels" | ||
> | ||
<ResizablePanel minSize={30} id="list" order={3}> | ||
<div className="flex h-[56px] items-center justify-between px-4"> | ||
<h1 className="text-xl font-bold">Archived</h1> | ||
<ModeToggle /> | ||
</div> | ||
<Separator /> | ||
<div className="h-full py-4"> | ||
{query.data?.length ? ( | ||
<MailList | ||
mailbox="archived" | ||
messages={query.data ?? []} | ||
selectedMessage={selectedMessage} | ||
setSelectedMessageId={setSelectedMessageId} | ||
/> | ||
) : ( | ||
<EmptyBox>No archived messages</EmptyBox> | ||
)} | ||
</div> | ||
</ResizablePanel> | ||
<ResizableHandle withHandle /> | ||
<ResizablePanel id="message" order={4}> | ||
<MailDisplay message={selectedMessage} mailbox="archived" /> | ||
</ResizablePanel> | ||
</ResizablePanelGroup> | ||
); | ||
} | ||
|
||
export default Archived; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export type Mailbox = "inbox" | "sent" | "drafts"; | ||
export type Mailbox = "inbox" | "sent" | "drafts" | "archived"; |