Allow selecting an email, and adding it to the hash.
We don't do anything with it yet, though
This commit is contained in:
parent
e68a21dcc4
commit
d6b675f7b6
|
@ -42,6 +42,7 @@ class EmailList extends React.Component<EmailListProps, EmailListState> {
|
|||
emailId={e}
|
||||
email={this.props.client!.email(e)}
|
||||
key={e}
|
||||
mailbox={this.props.mailbox}
|
||||
/>
|
||||
))}
|
||||
</Stack>
|
||||
|
|
|
@ -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 (
|
||||
<div className="p-2 border pe-auto" key={this.props.emailId}>
|
||||
<Placeholder animation="glow" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const href =
|
||||
"#" +
|
||||
this.props.account.id +
|
||||
"/" +
|
||||
this.props.mailbox.id +
|
||||
"/" +
|
||||
this.props.emailId;
|
||||
return (
|
||||
<div className="p-2 border" key={this.props.emailId}>
|
||||
{this.props.email != null
|
||||
? this.props.email.subject
|
||||
: this.props.emailId}
|
||||
<a className="btn" href={href}>
|
||||
{this.props.email != null
|
||||
? this.props.email.subject
|
||||
: this.props.emailId}
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue