From d6b675f7b6badb17825881015193bf4644ccd254 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 28 Aug 2024 10:16:11 -0700 Subject: [PATCH] Allow selecting an email, and adding it to the hash. We don't do anything with it yet, though --- src/EmailList.tsx | 1 + src/EmailSummary.tsx | 27 +++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/EmailList.tsx b/src/EmailList.tsx index 7ff49b4..fc9151a 100644 --- a/src/EmailList.tsx +++ b/src/EmailList.tsx @@ -42,6 +42,7 @@ class EmailList extends React.Component { emailId={e} email={this.props.client!.email(e)} key={e} + mailbox={this.props.mailbox} /> ))} diff --git a/src/EmailSummary.tsx b/src/EmailSummary.tsx index afc7c97..5520ba1 100644 --- a/src/EmailSummary.tsx +++ b/src/EmailSummary.tsx @@ -1,12 +1,15 @@ import React from "react"; +import Placeholder from "react-bootstrap/Placeholder"; + import Client from "./client/Client"; -import { IAccount, IEmail } from "./client/types"; +import { IAccount, IEmail, IMailbox } from "./client/types"; type EmailSummaryProps = { account: IAccount | null; client: Client | null; email: IEmail | null; emailId: string; + mailbox: IMailbox | null; }; type EmailSummaryState = {}; @@ -28,11 +31,27 @@ class EmailSummary extends React.Component< } render() { + if (this.props.account == null || this.props.mailbox == null) { + return ( +
+ +
+ ); + } + const href = + "#" + + this.props.account.id + + "/" + + this.props.mailbox.id + + "/" + + this.props.emailId; return (
- {this.props.email != null - ? this.props.email.subject - : this.props.emailId} + + {this.props.email != null + ? this.props.email.subject + : this.props.emailId} +
); }