Add the ability to select a mailbox.
Just log the mailbox ID for now.
This commit is contained in:
parent
bab5d421d4
commit
656495904b
6 changed files with 104 additions and 9 deletions
10
src/App.tsx
10
src/App.tsx
|
@ -2,7 +2,7 @@ import "./App.css";
|
|||
import "bootstrap/dist/css/bootstrap.min.css";
|
||||
|
||||
import Client, { IAuth } from "./client/Client";
|
||||
import { AccountIdMap, IAccount } from "./client/types";
|
||||
import { AccountIdMap, IAccount, IMailbox } from "./client/types";
|
||||
import AppLayout from "./AppLayout";
|
||||
import AuthModal from "./AuthModal";
|
||||
import React from "react";
|
||||
|
@ -16,6 +16,7 @@ type AppState = {
|
|||
account: IAccount | null;
|
||||
accounts: AccountIdMap;
|
||||
location: ILocation;
|
||||
mailbox: IMailbox | null;
|
||||
};
|
||||
|
||||
type AppProps = {};
|
||||
|
@ -30,6 +31,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
accounts: {},
|
||||
auth: { email: "", password: "" },
|
||||
location: { accountId: "" },
|
||||
mailbox: null,
|
||||
};
|
||||
|
||||
onHashChange() {
|
||||
|
@ -56,6 +58,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.client.doLogin({ email, password });
|
||||
}
|
||||
|
||||
onMailboxSelect(mailboxId: string) {
|
||||
console.log("Mailbox", mailboxId);
|
||||
}
|
||||
|
||||
// Load up auth credentials from the local store
|
||||
loadAuth() {
|
||||
const data = localStorage.getItem("auth");
|
||||
|
@ -106,6 +112,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||
account={this.state.account}
|
||||
accounts={this.state.accounts}
|
||||
client={this.client}
|
||||
mailbox={this.state.mailbox}
|
||||
onMailboxSelect={this.onMailboxSelect}
|
||||
/>
|
||||
<AuthModal
|
||||
show={this.client.state.session == null}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue