This commit is contained in:
Leandro Facchinetti 2020-03-18 13:52:56 -04:00
parent 56936d209b
commit 9e6cc02ef6
1 changed files with 103 additions and 112 deletions

View File

@ -7,8 +7,7 @@ export type Inbox = {
token: string;
};
export class Layout extends React.Component {
render() {
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
@ -49,7 +48,7 @@ export class Layout extends React.Component {
/>
</p>
</header>
<main>{this.props.children}</main>
<main>{children}</main>
<footer>
<p>
By <a href="https://www.leafac.com">Leandro Facchinetti</a> ·{" "}
@ -57,19 +56,15 @@ export class Layout extends React.Component {
Source
</a>{" "}
·{" "}
<a href="mailto:kill-the-newsletter@leafac.com">
Report an Issue
</a>
<a href="mailto:kill-the-newsletter@leafac.com">Report an Issue</a>
</p>
</footer>
</body>
</html>
);
}
}
export class Form extends React.Component {
render() {
export function Form() {
return (
<form method="POST" action="/">
<p>
@ -85,12 +80,9 @@ export class Form extends React.Component {
</p>
</form>
);
}
}
export class Created extends React.Component<{ inbox: Inbox }> {
render() {
const { name, token } = this.props.inbox;
export function Created({ inbox: { name, token } }: { inbox: Inbox }) {
return (
<>
<h1>{name} Inbox Created</h1>
@ -122,7 +114,6 @@ export class Created extends React.Component<{ inbox: Inbox }> {
</p>
</>
);
}
}
// https://validator.w3.org/feed/docs/atom.html