This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
59 lines (53 loc) · 1.6 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import Router from "next/router";
import Link from "next/link";
import styles from "./InboxLayout.module.css";
import Button from "../../components/Button";
import nylasLogo from "../../assets/nylas.svg";
import inboxZeroLogo from "../../assets/inbox_zero.svg";
Router.events.on("routeChangeComplete", url => {
const mainElement = document.querySelector(`.${styles.Content}`);
if (mainElement) {
mainElement.scrollTo(0, 0);
}
});
export default function InboxLayout({ children }) {
return <div className={styles.InboxLayout}>{children}</div>;
}
export function Content({ children }) {
return <main className={styles.Content}>{children}</main>;
}
export function Sidebar({ children }) {
return (
<aside className={styles.Sidebar}>
<div className={styles.Sidebar__content}>{children}</div>
<a
href="http://nylas.com/docs"
target="_blank"
className={styles.Sidebar__fixedLink}
>
Learn more about Nylas »
</a>
</aside>
);
}
export function Header({ account }) {
return (
<header className={styles.Header}>
<Link href="/">
<a className={styles.Header__logos}>
<img src={nylasLogo} alt="Nylas" />
<div className={styles.Header__logosDivider} />
<img src={inboxZeroLogo} alt="Inbox Zero" />
</a>
</Link>
<div className={styles.Header__profile}>
<div className={styles.Header__emailAddress}>
{account.emailAddress}
</div>
<Button variant="secondary" href="/api/logout" prefetch={false}>
Log out
</Button>
</div>
</header>
);
}