email compose
This commit is contained in:
parent
2af0724938
commit
f95901d596
6 changed files with 639 additions and 274 deletions
|
|
@ -37,7 +37,7 @@ import CompanySecurity from "./CompanySecurity";
|
|||
import CompanyOverview from "./CompanyOverview";
|
||||
import CompanyOverviewSetup, { isOrgSetupComplete } from "./CompanyOverviewSetup";
|
||||
import ChangePasswordModal from "./ChangePasswordModal";
|
||||
import ComposeModal from "./ComposeModal";
|
||||
import ComposeDock, { triggerOpenCompose } from "./ComposeDock";
|
||||
import MailboxView from "./MailboxView";
|
||||
|
||||
const mailItems = [
|
||||
|
|
@ -107,7 +107,6 @@ export default function DashboardPage() {
|
|||
const [domainError, setDomainError] = useState("");
|
||||
const [active, setActive] = useState("Inbox");
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
const [composeWindows, setComposeWindows] = useState([]);
|
||||
const [notice, setNotice] = useState("");
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [mailRefreshKey, setMailRefreshKey] = useState(0);
|
||||
|
|
@ -206,15 +205,10 @@ export default function DashboardPage() {
|
|||
}
|
||||
|
||||
function openCompose() {
|
||||
setComposeWindows((windows) => [...windows, { id: `compose-${Date.now()}-${windows.length}` }]);
|
||||
triggerOpenCompose();
|
||||
}
|
||||
|
||||
function closeCompose(windowId) {
|
||||
setComposeWindows((windows) => windows.filter((window) => window.id !== windowId));
|
||||
}
|
||||
|
||||
function emailSent(windowId) {
|
||||
closeCompose(windowId);
|
||||
function emailSent() {
|
||||
setActive("Outbox");
|
||||
setMailRefreshKey((key) => key + 1);
|
||||
setNotice("Message accepted by the mail server. Delivery can take a few minutes — check spam if it does not arrive.");
|
||||
|
|
@ -515,16 +509,7 @@ export default function DashboardPage() {
|
|||
}}
|
||||
/>
|
||||
)}
|
||||
{composeWindows.map((window, index) => (
|
||||
<ComposeModal
|
||||
key={window.id}
|
||||
windowId={window.id}
|
||||
stackIndex={index}
|
||||
account={account}
|
||||
onClose={() => closeCompose(window.id)}
|
||||
onSent={() => emailSent(window.id)}
|
||||
/>
|
||||
))}
|
||||
<ComposeDock account={account} onSent={emailSent} agentOpen={!companyActive} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue