Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created September 3, 2019 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwojciec/01525c7abfec71bd9a835f93d2194b1e to your computer and use it in GitHub Desktop.
Save fwojciec/01525c7abfec71bd9a835f93d2194b1e to your computer and use it in GitHub Desktop.
How to build a multilingual website in Next.js #10
// 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