5a478b4eef
Changes: - Migrate to TypeScript. `react-intl` natively supports TypeScript now. - Upgrade corresponding `formatjs` packages. - Dynamically polyfill Intl API per locale since those polyfills are huge. - Migrate to recommended workflow per https://formatjs.io/docs/getting-started/application-workflow
34 lines
647 B
TypeScript
34 lines
647 B
TypeScript
import * as React from 'react';
|
|
import {FormattedMessage} from 'react-intl';
|
|
import Link from 'next/link';
|
|
|
|
export default function Nav() {
|
|
return (
|
|
<nav>
|
|
<li>
|
|
<Link href="/">
|
|
<a>
|
|
<FormattedMessage defaultMessage="Home" />
|
|
</a>
|
|
</Link>
|
|
</li>
|
|
<li>
|
|
<Link href="/about">
|
|
<a>
|
|
<FormattedMessage defaultMessage="About" />
|
|
</a>
|
|
</Link>
|
|
</li>
|
|
|
|
<style jsx>{`
|
|
nav {
|
|
display: flex;
|
|
}
|
|
li {
|
|
list-style: none;
|
|
margin-right: 1rem;
|
|
}
|
|
`}</style>
|
|
</nav>
|
|
);
|
|
}
|