From d4ea753e640dc8e9532a98b48dbcfbfb8b71193f Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Tue, 7 Dec 2021 12:30:00 +0300 Subject: [PATCH 1/4] dasfs --- deriv.com.conf | 4 ++-- i18n-config.js | 4 ++-- src/common/utility.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deriv.com.conf b/deriv.com.conf index 7ecf30e8dd3..3d369be1db3 100644 --- a/deriv.com.conf +++ b/deriv.com.conf @@ -29,11 +29,11 @@ server { return 301 https://$http_host/careers/besquare/; } - location ~* "^/([\w]{2}|zh-tw|zh-cn)/careers" { + location ~* "^/([\w]{2}|zh/tw|zh/cn)/careers" { return 301 https://$http_host/careers/; } - location ~* "^/([\w]{2}|zh-tw|zh-cn)/academy" { + location ~* "^/([\w]{2}|zh/tw|zh/cn)/academy" { return 301 https://$http_host/academy/; } diff --git a/i18n-config.js b/i18n-config.js index 87e8587129d..4b0196d59a4 100644 --- a/i18n-config.js +++ b/i18n-config.js @@ -56,7 +56,7 @@ module.exports = { affiliate_lang: 3, }, zh_cn: { - path: 'zh-cn', + path: 'zh/cn', display_name: '简体中文', short_name: '简体', affiliate_lang: 10, @@ -68,7 +68,7 @@ module.exports = { affiliate_lang: 5, }, zh_tw: { - path: 'zh-tw', + path: 'zh/tw', display_name: '繁體中文', short_name: '繁體', affiliate_lang: 11, diff --git a/src/common/utility.js b/src/common/utility.js index 38c1711e51e..1e92fb8249a 100644 --- a/src/common/utility.js +++ b/src/common/utility.js @@ -314,13 +314,13 @@ export const addScript = (settings) => { // Function to get the user selected language, can be used in the future once need to check other languages export const isChoosenLanguage = () => ({ english: getLanguage() === 'en' }) -// Function to manually replace server's locale ("zh_tw" or "zh_cn") to "zh-tw"/"zh-cn" +// Function to manually replace server's locale ("zh_tw" or "zh_cn") to "zh/tw"/"zh/cn" export const replaceLocale = (locale) => { let checked_locale = locale if (locale === 'zh_tw') { - checked_locale = 'zh-tw' + checked_locale = 'zh/tw' } else if (locale === 'zh_cn') { - checked_locale = 'zh-cn' + checked_locale = 'zh/cn' } return checked_locale } From bed47e0e5b3f6fe0f9006aff38772624ad154bde Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Wed, 8 Dec 2021 15:09:53 +0300 Subject: [PATCH 2/4] nikolai.berestevich/feat:add new about-us page, make links in footer and header --- gatsby-node.js | 38 +++------------------- src/components/custom/other-platforms.js | 6 ++++ src/components/elements/off-canvas-menu.js | 6 ++++ src/components/layout/footer/main-links.js | 3 ++ src/pages/about-us/index.js | 18 ++++++++++ 5 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 src/pages/about-us/index.js diff --git a/gatsby-node.js b/gatsby-node.js index affeaf1702c..fcbea8c0c9c 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -16,22 +16,6 @@ exports.onCreatePage = ({ page, actions }) => { const is_story = /story/g.test(page.path) const is_market = /markets/g.test(page.path) const is_cfds = /cfds/g.test(page.path) - const is_landing_ebooks =/landing\/ebooks/g.test(page.path) - - if (is_landing_ebooks) { - createRedirect({ - fromPath: `/landing/ebooks/`, - toPath: `/404/`, - redirectInBrowser: true, - isPermanent: true, - }) - createRedirect({ - fromPath: `/landing/ebooks`, - toPath: `/404`, - redirectInBrowser: true, - isPermanent: true, - }) - } if (is_responsible_trading) { createRedirect({ @@ -87,13 +71,13 @@ exports.onCreatePage = ({ page, actions }) => { if (is_story) { createRedirect({ fromPath: `/about/`, - toPath: `/story/`, + toPath: `/about-us/`, redirectInBrowser: true, isPermanent: true, }) createRedirect({ fromPath: `/about`, - toPath: `/story/`, + toPath: `/about-us/`, redirectInBrowser: true, isPermanent: true, }) @@ -191,20 +175,6 @@ exports.onCreatePage = ({ page, actions }) => { isPermanent: true, }) } - if (is_landing_ebooks) { - createRedirect({ - fromPath: `/${lang}/landing/ebooks/`, - toPath: `/${lang}/404/`, - redirectInBrowser: true, - isPermanent: true, - }) - createRedirect({ - fromPath: `/${lang}/landing/ebooks`, - toPath: `/${lang}/404`, - redirectInBrowser: true, - isPermanent: true, - }) - } if (is_contact_us) { createRedirect({ @@ -245,13 +215,13 @@ exports.onCreatePage = ({ page, actions }) => { if (is_story) { createRedirect({ fromPath: `/${lang}/about/`, - toPath: `/${lang}/story/`, + toPath: `/${lang}/about-us/`, redirectInBrowser: true, isPermanent: true, }) createRedirect({ fromPath: `/${lang}/about`, - toPath: `/${lang}/story/`, + toPath: `/${lang}/about-us/`, redirectInBrowser: true, isPermanent: true, }) diff --git a/src/components/custom/other-platforms.js b/src/components/custom/other-platforms.js index a2ac2109a52..989e9104004 100644 --- a/src/components/custom/other-platforms.js +++ b/src/components/custom/other-platforms.js @@ -469,6 +469,12 @@ NavMarket.propTypes = { export const NavCompany = ({ onClick }) => ( + } + title={localize('About us')} + onClick={onClick} + to="/about-us/" + /> } title={localize('Our story')} diff --git a/src/components/elements/off-canvas-menu.js b/src/components/elements/off-canvas-menu.js index a6007514fe2..012a139f54a 100644 --- a/src/components/elements/off-canvas-menu.js +++ b/src/components/elements/off-canvas-menu.js @@ -362,6 +362,12 @@ export const OffCanvasMenuWrapper = (props) => { header_style={header_style} style={content_style} > + +
+ +
+ {localize('About us')} +
diff --git a/src/components/layout/footer/main-links.js b/src/components/layout/footer/main-links.js index 3ad09bcb7c2..e42c40be511 100644 --- a/src/components/layout/footer/main-links.js +++ b/src/components/layout/footer/main-links.js @@ -14,6 +14,9 @@ const MainLinksSection = ({ is_ppc, is_ppc_redirect, is_eu_country }) => { Codestin Search App + + {localize('About us')} + {localize('Our story')} diff --git a/src/pages/about-us/index.js b/src/pages/about-us/index.js new file mode 100644 index 00000000000..bcf0972af28 --- /dev/null +++ b/src/pages/about-us/index.js @@ -0,0 +1,18 @@ +import React from 'react' +import styled from 'styled-components' +import { WithIntl } from 'components/localization' + +const StyledDiv = styled.div` + font-size: 330%; + background-color: white; +` + +const AboutUs = () => { + return About Us new page +} + +AboutUs.propTypes = { + // data: PropTypes.object, +} + +export default WithIntl()(AboutUs) From 5ecbcb9b11bd856e69c85f8af8d0e20a1758de96 Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Thu, 9 Dec 2021 09:15:07 +0300 Subject: [PATCH 3/4] nikolai.berestevich/feat/add header and footer --- src/pages/about-us/index.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pages/about-us/index.js b/src/pages/about-us/index.js index bcf0972af28..bc7616c634e 100644 --- a/src/pages/about-us/index.js +++ b/src/pages/about-us/index.js @@ -1,6 +1,8 @@ import React from 'react' import styled from 'styled-components' -import { WithIntl } from 'components/localization' +import { localize, WithIntl } from 'components/localization' +import { SEO } from 'components/containers' +import Layout from 'components/layout/layout' const StyledDiv = styled.div` font-size: 330%; @@ -8,7 +10,18 @@ const StyledDiv = styled.div` ` const AboutUs = () => { - return About Us new page + return ( + + + About Us new page{' '} + + ) } AboutUs.propTypes = { From 9cd98474f664079f2a70d2c7ec00ce3adf3eba36 Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Thu, 9 Dec 2021 09:27:30 +0300 Subject: [PATCH 4/4] nikolai.berestevich/fix/SEO --- deriv.com.conf | 4 ++-- i18n-config.js | 4 ++-- src/common/utility.js | 6 +++--- src/pages/about-us/index.js | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deriv.com.conf b/deriv.com.conf index 3d369be1db3..7ecf30e8dd3 100644 --- a/deriv.com.conf +++ b/deriv.com.conf @@ -29,11 +29,11 @@ server { return 301 https://$http_host/careers/besquare/; } - location ~* "^/([\w]{2}|zh/tw|zh/cn)/careers" { + location ~* "^/([\w]{2}|zh-tw|zh-cn)/careers" { return 301 https://$http_host/careers/; } - location ~* "^/([\w]{2}|zh/tw|zh/cn)/academy" { + location ~* "^/([\w]{2}|zh-tw|zh-cn)/academy" { return 301 https://$http_host/academy/; } diff --git a/i18n-config.js b/i18n-config.js index 4b0196d59a4..87e8587129d 100644 --- a/i18n-config.js +++ b/i18n-config.js @@ -56,7 +56,7 @@ module.exports = { affiliate_lang: 3, }, zh_cn: { - path: 'zh/cn', + path: 'zh-cn', display_name: '简体中文', short_name: '简体', affiliate_lang: 10, @@ -68,7 +68,7 @@ module.exports = { affiliate_lang: 5, }, zh_tw: { - path: 'zh/tw', + path: 'zh-tw', display_name: '繁體中文', short_name: '繁體', affiliate_lang: 11, diff --git a/src/common/utility.js b/src/common/utility.js index 1e92fb8249a..d4db141639c 100644 --- a/src/common/utility.js +++ b/src/common/utility.js @@ -314,13 +314,13 @@ export const addScript = (settings) => { // Function to get the user selected language, can be used in the future once need to check other languages export const isChoosenLanguage = () => ({ english: getLanguage() === 'en' }) -// Function to manually replace server's locale ("zh_tw" or "zh_cn") to "zh/tw"/"zh/cn" +// Function to manually replace server's locale ("zh_tw" or "zh_cn") to "zh-tw"/"zh-cn" export const replaceLocale = (locale) => { let checked_locale = locale if (locale === 'zh_tw') { - checked_locale = 'zh/tw' + checked_locale = 'zh-tw' } else if (locale === 'zh_cn') { - checked_locale = 'zh/cn' + checked_locale = 'zh-cn' } return checked_locale } diff --git a/src/pages/about-us/index.js b/src/pages/about-us/index.js index bc7616c634e..8d0b7893bfb 100644 --- a/src/pages/about-us/index.js +++ b/src/pages/about-us/index.js @@ -13,11 +13,11 @@ const AboutUs = () => { return ( About Us new page{' '}