Last active
April 6, 2020 11:02
-
-
Save theodesp/66c02cf7b202da9e789f6e61b3abd9ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React from 'react'; | |
import { graphql } from 'gatsby'; | |
import { Translation } from 'react-i18next'; | |
import { Link } from '@wapps/gatsby-plugin-i18next'; | |
import Layout from '../components/layout'; | |
const SecondPage = () => ( | |
<Translation> | |
{t => ( | |
<Layout> | |
<h1>{t('Hi from the second page')}</h1> | |
<p>{t('Welcome to page 2')}</p> | |
<Link to="/">{t('Go back to the homepage')}</Link> | |
</Layout> | |
)} | |
</Translation> | |
); | |
export default withI18next()(SecondPage); | |
export const query = graphql` | |
query($lng: String!) { | |
locales: allLocale(filter: { lng: { eq: $lng }, ns: { eq: "messages" } }) { | |
...LocaleFragment | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment