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}
|
emailId={e}
|
||||||
email={this.props.client!.email(e)}
|
email={this.props.client!.email(e)}
|
||||||
key={e}
|
key={e}
|
||||||
|
mailbox={this.props.mailbox}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import Placeholder from "react-bootstrap/Placeholder";
|
||||||
|
|
||||||
import Client from "./client/Client";
|
import Client from "./client/Client";
|
||||||
import { IAccount, IEmail } from "./client/types";
|
import { IAccount, IEmail, IMailbox } from "./client/types";
|
||||||
|
|
||||||
type EmailSummaryProps = {
|
type EmailSummaryProps = {
|
||||||
account: IAccount | null;
|
account: IAccount | null;
|
||||||
client: Client | null;
|
client: Client | null;
|
||||||
email: IEmail | null;
|
email: IEmail | null;
|
||||||
emailId: string;
|
emailId: string;
|
||||||
|
mailbox: IMailbox | null;
|
||||||
};
|
};
|
||||||
type EmailSummaryState = {};
|
type EmailSummaryState = {};
|
||||||
|
|
||||||
|
@ -28,11 +31,27 @@ class EmailSummary extends React.Component<
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
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 (
|
return (
|
||||||
<div className="p-2 border" key={this.props.emailId}>
|
<div className="p-2 border" key={this.props.emailId}>
|
||||||
{this.props.email != null
|
<a className="btn" href={href}>
|
||||||
? this.props.email.subject
|
{this.props.email != null
|
||||||
: this.props.emailId}
|
? this.props.email.subject
|
||||||
|
: this.props.emailId}
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue