Upgrade gatsby-plugin-react-i18next to new release

This commit is contained in:
Kevin Kandlbinder 2021-02-12 08:58:37 +01:00
parent ad2bcd3312
commit 37b12abb78
14 changed files with 421 additions and 49 deletions

View file

@ -39,7 +39,7 @@ Layout.propTypes = {
title: PropTypes.string.isRequired,
module: PropTypes.string.isRequired,
transparentTopbar: PropTypes.bool,
children: PropTypes.object.isRequired
children: PropTypes.any.isRequired
}
export default Layout;

View file

@ -1,35 +1,45 @@
import React, { useState } from "react"
import Layout from "../layouts/default";
import { useStaticQuery, graphql } from "gatsby";
import { graphql } from "gatsby";
import { Trans, useI18next, I18nextContext } from "gatsby-plugin-react-i18next"
import PropTypes from "prop-types"
import styles from "./donate.module.scss";
export default function DonatePage() {
export const query = graphql`
query ($language: String!) {
site {
siteMetadata {
title
siteUrl
payPalMail
}
}
file(relativePath: {eq: "images/pplogo.png"}) {
childImageSharp {
resize(width: 240, height: 240, fit: CONTAIN) {
src
}
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`;
function DonatePage(props) {
const [amount, setAmount] = useState(5);
const { t } = useI18next();
const { path } = React.useContext(I18nextContext);
const { site, file } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
siteUrl
payPalMail
}
}
file(relativePath: {eq: "images/pplogo.png"}) {
childImageSharp {
resize(width: 240, height: 240, fit: CONTAIN) {
src
}
}
}
}
`
)
const { site, file } = props.data;
return (
<Layout module="donate" title={t("donate")} description={t("donationCatchphrase")}>
@ -50,4 +60,10 @@ export default function DonatePage() {
</section>
</Layout>
);
}
}
DonatePage.propTypes = {
data: PropTypes.object.isRequired
};
export default DonatePage;

View file

@ -1,20 +1,30 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { useStaticQuery, graphql } from "gatsby";
import { graphql } from "gatsby";
import PropTypes from "prop-types"
export default function ImprintPage() {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
contactEmail
}
}
}
`
)
export const query = graphql`
query GetThankYouPage($language: String!) {
site {
siteMetadata {
contactEmail
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
function ThankYouPage(props) {
const { site } = props.data
let contactEmail = site.siteMetadata.contactEmail;
const { t } = useI18next();
@ -29,4 +39,10 @@ export default function ImprintPage() {
</section>
</Layout>
);
}
}
ThankYouPage.propTypes = {
data: PropTypes.object.isRequired
};
export default ThankYouPage;

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./friends.module.scss";
export const query = graphql`
query AllFriendsQuery {
query AllFriendsQuery($language: String!) {
allFriendsJson {
nodes {
name
@ -16,6 +16,15 @@ query AllFriendsQuery {
imageURL
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -38,6 +38,15 @@ export const query = graphql`
featured
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`;

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function ImprintPage() {

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function DataSecPage() {

View file

@ -1,6 +1,21 @@
import React from "react"
import Layout from "../../layouts/default";
import { Trans, useI18next } from "gatsby-plugin-react-i18next"
import { graphql } from "gatsby";
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`
export default function DisclaimerPage() {

View file

@ -23,6 +23,15 @@ query GetProjects($language: String) {
shortDescription
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./social.module.scss";
export const query = graphql`
query AllSocialsQuery {
query AllSocialsQuery($language: String!) {
allSocialsJson {
nodes {
image
@ -16,6 +16,15 @@ query AllSocialsQuery {
url
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`

View file

@ -7,7 +7,7 @@ import PropTypes from "prop-types"
import styles from "./project.module.scss";
export const query = graphql`
query GetProject($urlname: String!, $lang: String!) {
query GetProject($urlname: String!, $lang: String!, $language: String!) {
allProjectsJson(filter: {urlname: {eq: $urlname}, lang: {eq: $lang}}) {
nodes {
lang
@ -24,6 +24,15 @@ query GetProject($urlname: String!, $lang: String!) {
shortDescription
}
}
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`