Add button to move an email to trash.

This is the first time I'm modifying data instead of just displaying it.
And this commit is a mess, it's all over the place with duplicating
types and breaking my class layers.

But it works, technically, so, whatever, checkpoint!

I need to totally start reworking the base client library as I'm not
happy with it at all. Also, it turns out that we have very little type
protection on the "set" methods. I had a totally improper signature for
about an hour that led to useless debugging. Reading the standard, which
is excellent, helped me get sorted out, but they type checker should be
helping me.

Additionally, I should be creating this Account class type within the
client.
This commit is contained in:
Eli Ribble 2024-09-03 12:03:04 -07:00
parent dfca32eb36
commit 1e9dae15f1
3 changed files with 119 additions and 5 deletions

View file

@ -1,3 +1,7 @@
import { Trash } from "react-bootstrap-icons";
import Button from "react-bootstrap/Button";
import ButtonGroup from "react-bootstrap/ButtonGroup";
import ButtonToolbar from "react-bootstrap/ButtonToolbar";
import Placeholder from "react-bootstrap/Placeholder";
import React from "react";
@ -55,6 +59,21 @@ class EmailSummary extends React.Component<
stub.subject}
</span>
</a>
<ButtonToolbar>
<ButtonGroup className="me-2">
<Button
onClick={() => {
this.props.client.emailMoveTrash(
this.props.account,
this.props.emailId,
);
}}
>
<Trash />
</Button>
<Button>2</Button>
</ButtonGroup>
</ButtonToolbar>
</div>
);
}