Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Nikolai.berestevich/feat/add about us page #2310

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 4 additions & 34 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing thispiece of code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's for redirection from /landing/ebooks (to fix 403 error and redirect to 404) But then this redirection was made inside deriv config for all 403 pages to 404 page

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({
Expand Down Expand Up @@ -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,
})
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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,
})
Expand Down
2 changes: 1 addition & 1 deletion src/common/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ 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') {
Expand Down
6 changes: 6 additions & 0 deletions src/components/custom/other-platforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ NavMarket.propTypes = {

export const NavCompany = ({ onClick }) => (
<Flex direction="column" wrap="wrap" jc="flex-start" max_width="42rem">
<CardLink
icon={() => <img src={Story} alt="" width="24" height="24" />}
title={localize('About us')}
onClick={onClick}
to="/about-us/"
/>
<CardLink
icon={() => <img src={Story} alt="" width="24" height="24" />}
title={localize('Our story')}
Expand Down
6 changes: 6 additions & 0 deletions src/components/elements/off-canvas-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ export const OffCanvasMenuWrapper = (props) => {
header_style={header_style}
style={content_style}
>
<StyledLink to="/about-us" onClick={handleArrowClick}>
<div>
<img src={Story} alt="" width="24" height="24" />
</div>
<span>{localize('About us')}</span>
</StyledLink>
<StyledLink to="/story/" onClick={handleArrowClick}>
<div>
<img src={Story} alt="" width="24" height="24" />
Expand Down
3 changes: 3 additions & 0 deletions src/components/layout/footer/main-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const MainLinksSection = ({ is_ppc, is_ppc_redirect, is_eu_country }) => {
<LinkWrapper>
<Title>{localize('ABOUT')}</Title>
</LinkWrapper>
<LinkWrapper first_child="true">
<Link to="/about-us/">{localize('About us')}</Link>
</LinkWrapper>
<LinkWrapper first_child="true">
<Link to="/story/">{localize('Our story')}</Link>
</LinkWrapper>
Expand Down
31 changes: 31 additions & 0 deletions src/pages/about-us/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react'
import styled from 'styled-components'
import { localize, WithIntl } from 'components/localization'
import { SEO } from 'components/containers'
import Layout from 'components/layout/layout'

const StyledDiv = styled.div`
font-size: 330%;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this declared in %?

background-color: white;
`

const AboutUs = () => {
return (
<Layout>
<SEO
// title and description from story page, needs new?
title={localize('About Us | An Online Trading Platform | Deriv.com')}
description={localize(
'Deriv.com - A Binary.com brand, is a pioneer and award-winning online trading platform in the trading market.',
)}
/>
<StyledDiv>About Us new page</StyledDiv>{' '}
</Layout>
)
}

AboutUs.propTypes = {
// data: PropTypes.object,
}

export default WithIntl()(AboutUs)