From 78a15e9b57a5fd3f70b7a774ecb519748b17309a Mon Sep 17 00:00:00 2001 From: Kurzdor Date: Sat, 16 Mar 2019 18:02:36 +0200 Subject: [PATCH 1/4] chore: translate title and splash --- src/pages/index.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 790efd439..9ca9bdea4 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -9,14 +9,14 @@ import Container from 'components/Container'; import Flex from 'components/Flex'; import CodeExample from 'components/CodeExample'; import PropTypes from 'prop-types'; -import React, {Component} from 'react'; -import {graphql} from 'gatsby'; +import React, { Component } from 'react'; +import { graphql } from 'gatsby'; import TitleAndMetaTags from 'components/TitleAndMetaTags'; import Layout from 'components/Layout'; -import {colors, media, sharedStyles} from 'theme'; +import { colors, media, sharedStyles } from 'theme'; import loadScript from 'utils/loadScript'; import createOgUrl from 'utils/createOgUrl'; -import {babelURL} from 'site-constants'; +import { babelURL } from 'site-constants'; import logoWhiteSvg from 'icons/logo-white.svg'; class Home extends Component { @@ -38,11 +38,11 @@ class Home extends Component { } render() { - const {babelLoaded} = this.state; - const {data, location} = this.props; - const {codeExamples, examples, marketing} = data; + const { babelLoaded } = this.state; + const { data, location } = this.props; + const { codeExamples, examples, marketing } = data; - const code = codeExamples.edges.reduce((lookup, {node}) => { + const code = codeExamples.edges.reduce((lookup, { node }) => { lookup[node.mdAbsolutePath] = node; return lookup; }, {}); @@ -50,10 +50,10 @@ class Home extends Component { return ( -
+
- A JavaScript library for building user interfaces + JavaScript-бібліотека для створення користувацьких інтерфейсів

- Get Started + Початок роботи - Take the Tutorial + Перейти до введення @@ -190,7 +190,7 @@ class Home extends Component { whiteSpace: 'nowrap', }, }}> - {marketing.edges.map(({node: column}, index) => ( + {marketing.edges.map(({ node: column }, index) => (
{column.frontmatter.title} -
+
))}
@@ -255,7 +255,7 @@ class Home extends Component { />
- {examples.edges.map(({node}, index) => { + {examples.edges.map(({ node }, index) => { const snippet = code[node.fileAbsolutePath]; return (

{node.frontmatter.title}

-
+
); })} @@ -309,7 +309,7 @@ Home.propTypes = { }).isRequired, }; -const CtaItem = ({children, primary = false}) => ( +const CtaItem = ({ children, primary = false }) => (
Date: Sat, 16 Mar 2019 18:03:35 +0200 Subject: [PATCH 2/4] chore: translate site metadata in gatsby config --- gatsby-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 456396f92..177dfda0b 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -8,10 +8,10 @@ module.exports = { siteMetadata: { - title: 'React: A JavaScript library for building user interfaces', + title: 'React: JavaScript-бібліотека для створення користувацьких інтерфейсів', siteUrl: 'https://reactjs.org', rssFeedTitle: 'React', - rssFeedDescription: 'A JavaScript library for building user interfaces', + rssFeedDescription: 'JavaScript-бібліотека для створення користувацьких інтерфейсів', }, mapping: { 'MarkdownRemark.frontmatter.author': 'AuthorYaml', From 40d775aa955730ee3446df1379f5e9ca855038bf Mon Sep 17 00:00:00 2001 From: Kurzdor Date: Sun, 17 Mar 2019 23:22:13 +0200 Subject: [PATCH 3/4] fix: revert codestyle broken by Prettier --- src/pages/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 9ca9bdea4..3173c2f28 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -9,14 +9,14 @@ import Container from 'components/Container'; import Flex from 'components/Flex'; import CodeExample from 'components/CodeExample'; import PropTypes from 'prop-types'; -import React, { Component } from 'react'; -import { graphql } from 'gatsby'; +import React, {Component} from 'react'; +import {graphql} from 'gatsby'; import TitleAndMetaTags from 'components/TitleAndMetaTags'; import Layout from 'components/Layout'; -import { colors, media, sharedStyles } from 'theme'; +import {colors, media, sharedStyles} from 'theme'; import loadScript from 'utils/loadScript'; import createOgUrl from 'utils/createOgUrl'; -import { babelURL } from 'site-constants'; +import {babelURL} from 'site-constants'; import logoWhiteSvg from 'icons/logo-white.svg'; class Home extends Component { @@ -38,11 +38,11 @@ class Home extends Component { } render() { - const { babelLoaded } = this.state; - const { data, location } = this.props; - const { codeExamples, examples, marketing } = data; + const {babelLoaded} = this.state; + const {data, location} = this.props; + const {codeExamples, examples, marketing} = data; - const code = codeExamples.edges.reduce((lookup, { node }) => { + const code = codeExamples.edges.reduce((lookup, {node}) => { lookup[node.mdAbsolutePath] = node; return lookup; }, {}); @@ -53,7 +53,7 @@ class Home extends Component { title="React – JavaScript-бібліотека для створення користувацьких інтерфейсів" ogUrl={createOgUrl('index.html')} /> -
+
- {marketing.edges.map(({ node: column }, index) => ( + {marketing.edges.map(({node: column}, index) => (
{column.frontmatter.title} -
+
))}
@@ -255,7 +255,7 @@ class Home extends Component { />
- {examples.edges.map(({ node }, index) => { + {examples.edges.map(({node}, index) => { const snippet = code[node.fileAbsolutePath]; return (

{node.frontmatter.title}

-
+
); })} @@ -309,7 +309,7 @@ Home.propTypes = { }).isRequired, }; -const CtaItem = ({ children, primary = false }) => ( +const CtaItem = ({children, primary = false}) => (
Date: Sun, 17 Mar 2019 23:24:19 +0200 Subject: [PATCH 4/4] chore: change siteUrl to ukranian site of React docs --- gatsby-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gatsby-config.js b/gatsby-config.js index 177dfda0b..3b4492051 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -9,7 +9,7 @@ module.exports = { siteMetadata: { title: 'React: JavaScript-бібліотека для створення користувацьких інтерфейсів', - siteUrl: 'https://reactjs.org', + siteUrl: 'https://uk.reactjs.org', rssFeedTitle: 'React', rssFeedDescription: 'JavaScript-бібліотека для створення користувацьких інтерфейсів', },