Created
September 3, 2019 13:43
-
-
Save fwojciec/01525c7abfec71bd9a835f93d2194b1e to your computer and use it in GitHub Desktop.
How to build a multilingual website in Next.js #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// components/Layout.tsx | |
import React from 'react' | |
import Head from 'next/head' | |
import useTranslation from '../hooks/useTranslation' | |
import Navigation from './Navigation' | |
interface Props { | |
titleKey: string | |
} | |
const Layout: React.FC<Props> = ({ titleKey, children }) => { | |
const { t } = useTranslation() | |
return ( | |
<> | |
<Head> | |
<title>{t(titleKey)}</title> | |
</Head> | |
<Navigation /> | |
<>{children}</> | |
</> | |
) | |
} | |
export default Layout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment