diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml
index 824977bf921..bc4443485fa 100644
--- a/.github/workflows/production.yml
+++ b/.github/workflows/production.yml
@@ -18,6 +18,7 @@ env:
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}
+ GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
jobs:
release-production:
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index ae231723e16..b6d91167eb1 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -22,6 +22,7 @@ env:
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}
+ GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}
jobs:
release-staging:
diff --git a/gatsby-config.js b/gatsby-config.js
index c35e816cae0..0ad6bdf7964 100644
--- a/gatsby-config.js
+++ b/gatsby-config.js
@@ -11,6 +11,21 @@ const href = isBrowser && window.location.href
const site_url =
origin === 'https://deriv.com' || origin === 'https://eu.deriv.com' ? href : 'https://deriv.com'
+const strapi_preview_param = {
+ publicationState: 'live',
+}
+
+const strapi_config = [
+ {
+ singularName: 'who-we-are-page',
+ queryParams: strapi_preview_param,
+ },
+ {
+ singularName: 'cfd-warning-banner',
+ queryParams: strapi_preview_param,
+ },
+]
+
module.exports = {
// pathPrefix: process.env.PATH_PREFIX || '/deriv-com/', // For non CNAME GH-pages deployment
flags: {
@@ -352,6 +367,14 @@ module.exports = {
generateStatsFile: process.env.GENERATE_JSON_STATS === 'true',
},
},
+ {
+ resolve: 'gatsby-source-strapi',
+ options: {
+ apiURL: 'https://chief-skinny-instrument.strapiapp.com',
+ accessToken: process.env.GATSBY_STRAPI_TOKEN,
+ collectionTypes: strapi_config,
+ },
+ },
{
resolve: 'gatsby-plugin-env-variables',
options: {
diff --git a/package-lock.json b/package-lock.json
index 68c1d5394f3..79f71be6073 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -48,6 +48,7 @@
"gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-plugin-use-query-params": "^1.0.1",
"gatsby-source-filesystem": "^5.11.0",
+ "gatsby-source-strapi": "^3.3.1",
"gatsby-transformer-sharp": "^5.11.0",
"i18next": "^21.6.5",
"install": "^0.13.0",
@@ -21380,6 +21381,28 @@
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg=="
},
+ "node_modules/commonmark": {
+ "version": "0.30.0",
+ "resolved": "https://registry.npmjs.org/commonmark/-/commonmark-0.30.0.tgz",
+ "integrity": "sha512-j1yoUo4gxPND1JWV9xj5ELih0yMv1iCWDG6eEQIPLSWLxzCXiFoyS7kvB+WwU+tZMf4snwJMMtaubV0laFpiBA==",
+ "dependencies": {
+ "entities": "~2.0",
+ "mdurl": "~1.0.1",
+ "minimist": ">=1.2.2",
+ "string.prototype.repeat": "^0.2.0"
+ },
+ "bin": {
+ "commonmark": "bin/commonmark"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/commonmark/node_modules/entities": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
+ "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ=="
+ },
"node_modules/compare-func": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz",
@@ -28351,6 +28374,34 @@
"node": ">=18.0.0"
}
},
+ "node_modules/gatsby-source-strapi": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/gatsby-source-strapi/-/gatsby-source-strapi-3.3.1.tgz",
+ "integrity": "sha512-juyW2AqEKg3Q4kJOqf+XH/zTDBap0PuRdqjOTt2m/aw3MseynU9ES9P3WQuT24GMXo204LolEo8qQFFzzpnJ8Q==",
+ "dependencies": {
+ "axios": "1.4.0",
+ "commonmark": "^0.30.0",
+ "gatsby-source-filesystem": "^5.10.0",
+ "lodash": "^4.17.21",
+ "qs": "^6.11.2"
+ },
+ "peerDependencies": {
+ "gatsby": "^4.0.0 || ^5.0.0",
+ "gatsby-plugin-image": "^2.5.1 || ^3.0.0",
+ "gatsby-plugin-sharp": "^4.5.1 || ^5.0.0",
+ "gatsby-transformer-sharp": "^4.5.1 || ^5.0.0"
+ }
+ },
+ "node_modules/gatsby-source-strapi/node_modules/axios": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
+ "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
+ "dependencies": {
+ "follow-redirects": "^1.15.0",
+ "form-data": "^4.0.0",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
"node_modules/gatsby-telemetry": {
"version": "4.12.0",
"resolved": "https://registry.npmjs.org/gatsby-telemetry/-/gatsby-telemetry-4.12.0.tgz",
@@ -37307,8 +37358,7 @@
"node_modules/mdurl": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
- "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==",
- "dev": true
+ "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g=="
},
"node_modules/meant": {
"version": "1.0.3",
@@ -43696,6 +43746,11 @@
"node": ">= 0.10"
}
},
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
"node_modules/prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@@ -43819,7 +43874,6 @@
"version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
"integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
- "dev": true,
"dependencies": {
"side-channel": "^1.0.4"
},
@@ -47281,6 +47335,11 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/string.prototype.repeat": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-0.2.0.tgz",
+ "integrity": "sha512-1BH+X+1hSthZFW+X+JaUkjkkUPwIlLEMJBLANN3hOob3RhEk5snLWNECDnYbgn/m5c5JV7Ersu1Yubaf+05cIA=="
+ },
"node_modules/string.prototype.trim": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz",
diff --git a/package.json b/package.json
index 332dfc32b08..3737bb2575d 100644
--- a/package.json
+++ b/package.json
@@ -43,6 +43,7 @@
"gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-plugin-use-query-params": "^1.0.1",
"gatsby-source-filesystem": "^5.11.0",
+ "gatsby-source-strapi": "^3.3.1",
"gatsby-transformer-sharp": "^5.11.0",
"i18next": "^21.6.5",
"install": "^0.13.0",
diff --git a/scripts/extract-translations.js b/scripts/extract-translations.js
index 5b3e364ad81..02b96c33c52 100644
--- a/scripts/extract-translations.js
+++ b/scripts/extract-translations.js
@@ -8,6 +8,7 @@ const fs = require('fs')
const glob = require('glob')
const translated_keys = require('../src/translations/ach.json')
const DISABLE_TRANSLATION = 'disable-translation'
+const strap_data = require('../public/page-data/404/page-data.json')
@@ -72,11 +73,17 @@ const new_find_keys = (file) => {
*/
extractTranslations();
+function getStrapiStrings(strapi_obj_data) {
+ return strapi_obj_data instanceof Array ? strapi_obj_data.map((array) => getStrapiStrings(array)).flat() :
+ strapi_obj_data instanceof Object ? Object.values(strapi_obj_data).map((object) => getStrapiStrings(object)).flat() :
+ strapi_obj_data;
+}
+
function extractTranslations() {
(async () => {
try {
const file_paths = [];
- const messages = [];
+ const pre_messages = [];
const messages_json = {};
// Find all file types listed in `globs`
@@ -94,13 +101,17 @@ function extractTranslations() {
try {
const file = fs.readFileSync(file_paths[i], 'utf8');
if (!file.includes(DISABLE_TRANSLATION)) {
- messages.push(...old_find_keys(file));
- messages.push(...new_find_keys(file))
+ pre_messages.push(...old_find_keys(file));
+ pre_messages.push(...new_find_keys(file))
}
} catch (e) {
console.log(e);
}
}
+
+ const data_from_strapi = getStrapiStrings(strap_data.result.data.strapiWhoWeArePage)
+ const messages = new Array(...pre_messages, ...data_from_strapi)
+
const untranslated = []
// Hash the messages and set the key-value pair for json
for (let i = 0; i < messages.length; i++) {
diff --git a/src/common/constants.ts b/src/common/constants.ts
index 3f87360bf46..6c391da9e24 100644
--- a/src/common/constants.ts
+++ b/src/common/constants.ts
@@ -164,8 +164,6 @@ export const live_chat_key = 'live_chat_redirection'
export const reddit_url = 'https://www.reddit.com/user/Deriv_official/'
export const telegram_url = 'https://t.me/derivdotcomofficial'
export const youtube_url = 'https://www.youtube.com/@deriv'
-export const loss_percent = 72
-
export const contact_us_form_post_data = 'https://formkeep.com/f/7f4b8b55f10f'
export const cookie_key = 'browser_update_alert_modal_shown'
diff --git a/src/components/containers/seo.tsx b/src/components/containers/seo.tsx
index f3695545836..b3c459f2331 100644
--- a/src/components/containers/seo.tsx
+++ b/src/components/containers/seo.tsx
@@ -72,138 +72,147 @@ const SEO = ({
(description?.includes('_t_') ? localize(description as TString) : description) ||
queries.site.siteMetadata.description
const site_url = queries.site.siteMetadata.siteUrl
- const { locale, pathname: myPath } = pageContext
- const lang = locale || 'en'
- const pathname = myPath || ''
- const locale_pathname = pathname.charAt(0) === '/' ? pathname : `/${pathname}`
- const default_og_title = localize(
- '_t_Online trading with Deriv | Simple. Flexible. Reliable._t_',
- )
- const default_og_description = localize('_t_Trading platforms designed with you in mind._t_')
-
- // To block eu.deriv.com domain for search engines
- const block_eu = isBrowser() && eu_urls.includes(window.location.hostname)
-
- let is_ach_page = false
- let current_page = ''
- let organization_schema = {}
-
- const hreflang_codes = site_url.includes('eu.deriv.com')
- ? hreflang_codes_eu
- : hreflang_codes_row
-
- if (locale_pathname) {
- const path_array = locale_pathname.split('/')
- const current_lang = path_array[1]
- const check_lang = current_lang.replace('-', '_')
- current_page = locale_pathname
-
- if (languages.includes(check_lang)) {
- path_array.splice(1, 1)
- current_page = path_array.join('/')
+ if (pageContext && pageContext.locale) {
+ const { locale, pathname: myPath } = pageContext
+ const lang = locale || 'en'
+ const pathname = myPath || ''
+ const locale_pathname = pathname.charAt(0) === '/' ? pathname : `/${pathname}`
+ const default_og_title = localize(
+ '_t_Online trading with Deriv | Simple. Flexible. Reliable._t_',
+ )
+ const default_og_description = localize(
+ '_t_Trading platforms designed with you in mind._t_',
+ )
+
+ // To block eu.deriv.com domain for search engines
+ const block_eu = isBrowser() && eu_urls.includes(window.location.hostname)
+
+ let is_ach_page = false
+ let current_page = ''
+ let organization_schema = {}
+
+ const hreflang_codes = site_url.includes('eu.deriv.com')
+ ? hreflang_codes_eu
+ : hreflang_codes_row
+
+ if (locale_pathname) {
+ const path_array = locale_pathname.split('/')
+ const current_lang = path_array[1]
+ const check_lang = current_lang.replace('-', '_')
+ current_page = locale_pathname
+
+ if (languages.includes(check_lang)) {
+ path_array.splice(1, 1)
+ current_page = path_array.join('/')
+ }
+ if (current_lang === 'ach') is_ach_page = true
}
- if (current_lang === 'ach') is_ach_page = true
- }
- if (has_organization_schema) {
- organization_schema = {
- '@context': 'https://schema.org',
- '@type': 'Organization',
- name: 'Deriv',
- alternateName: 'Deriv.com',
- url: 'https://deriv.com',
- logo: TradingImage,
- sameAs: [
- 'https://www.facebook.com/derivdotcom',
- 'https://www.twitter.com/derivdotcom',
- 'https://www.instagram.com/deriv_official',
- 'https://youtube.com/c/Derivdotcom',
- 'https://www.linkedin.com/company/derivdotcom/',
- 'https://deriv.com',
- ],
+ if (has_organization_schema) {
+ organization_schema = {
+ '@context': 'https://schema.org',
+ '@type': 'Organization',
+ name: 'Deriv',
+ alternateName: 'Deriv.com',
+ url: 'https://deriv.com',
+ logo: TradingImage,
+ sameAs: [
+ 'https://www.facebook.com/derivdotcom',
+ 'https://www.twitter.com/derivdotcom',
+ 'https://www.instagram.com/deriv_official',
+ 'https://youtube.com/c/Derivdotcom',
+ 'https://www.linkedin.com/company/derivdotcom/',
+ 'https://deriv.com',
+ ],
+ }
}
- }
- const is_non_localized = non_localized_links.some((link) => current_page.includes(link))
- const meta_data = [
- { name: 'description', content: metaDescription },
- { name: 'google', content: 'notranslate' },
- {
- property: 'og:title',
- content:
- (meta_attributes?.og_title?.includes('_t_')
- ? localize(meta_attributes?.og_title as TString)
- : meta_attributes?.og_title) || default_og_title,
- },
- {
- property: 'og:site_name',
- content: title.includes('_t_') ? localize(title as TString) : title,
- },
- {
- property: 'og:description',
- content:
- (meta_attributes?.og_description?.includes('_t_')
- ? localize(meta_attributes?.og_description as TString)
- : meta_attributes?.og_description) || default_og_description,
- },
- { property: 'og:type', content: meta_attributes?.og_type || 'website' },
- { property: 'og:locale', content: lang },
- { property: 'og:image', content: TradingImage },
- { property: 'og:image:width', content: meta_attributes?.og_img_width || '600' },
- { property: 'og:image:height', content: meta_attributes?.og_img_height || '315' },
- { name: 'twitter:card', content: 'summary' },
- { name: 'twitter:creator', content: queries.site.siteMetadata.author },
- {
- name: 'twitter:title',
- content: title.includes('_t_') ? localize(title as TString) : title,
- },
- { name: 'twitter:description', content: metaDescription },
- { name: 'format-detection', content: 'telephone=no' },
- { name: 'yandex-verification', content: '4ddb94bbff872c63' },
- { name: 'referrer', content: 'origin' },
- { name: 'version', content: process.env.GATSBY_DERIV_VERSION },
- block_eu ? { name: 'robots', content: 'noindex, nofollow' } : {},
- ...(no_index || no_index_staging || is_ach_page
- ? [{ name: 'robots', content: 'noindex' }]
- : []),
- ]
-
- return (
- <>
-
{title.includes('_t_') ? localize(title as TString) : title}
-
- {meta_data.map((data) => (
-
- ))}
- {has_organization_schema && (
-
- )}
- {!is_non_localized &&
- languages
- .filter((l) => l !== 'ach' && l)
- .map((locale) => {
- const replaced_local = locale.replace('_', '-')
- const is_default = locale === 'en' || locale === 'x-default'
- const href_lang = is_default ? '' : `/${replaced_local}`
- const href = `${site_url}${href_lang}${current_page}`
-
- return (
-
- )
- })}
-
- {hreflang_codes.map(({ href, hreflang, rel }) => (
-
- ))}
-
- {children}
- >
- )
+ const is_non_localized = non_localized_links.some((link) => current_page.includes(link))
+ const meta_data = [
+ { name: 'description', content: metaDescription },
+ { name: 'google', content: 'notranslate' },
+ {
+ property: 'og:title',
+ content:
+ (meta_attributes?.og_title?.includes('_t_')
+ ? localize(meta_attributes?.og_title as TString)
+ : meta_attributes?.og_title) || default_og_title,
+ },
+ {
+ property: 'og:site_name',
+ content: title.includes('_t_') ? localize(title as TString) : title,
+ },
+ {
+ property: 'og:description',
+ content:
+ (meta_attributes?.og_description?.includes('_t_')
+ ? localize(meta_attributes?.og_description as TString)
+ : meta_attributes?.og_description) || default_og_description,
+ },
+ { property: 'og:type', content: meta_attributes?.og_type || 'website' },
+ { property: 'og:locale', content: lang },
+ { property: 'og:image', content: TradingImage },
+ { property: 'og:image:width', content: meta_attributes?.og_img_width || '600' },
+ { property: 'og:image:height', content: meta_attributes?.og_img_height || '315' },
+ { name: 'twitter:card', content: 'summary' },
+ { name: 'twitter:creator', content: queries.site.siteMetadata.author },
+ {
+ name: 'twitter:title',
+ content: title.includes('_t_') ? localize(title as TString) : title,
+ },
+ { name: 'twitter:description', content: metaDescription },
+ { name: 'format-detection', content: 'telephone=no' },
+ { name: 'yandex-verification', content: '4ddb94bbff872c63' },
+ { name: 'referrer', content: 'origin' },
+ { name: 'version', content: process.env.GATSBY_DERIV_VERSION },
+ block_eu ? { name: 'robots', content: 'noindex, nofollow' } : {},
+ ...(no_index || no_index_staging || is_ach_page
+ ? [{ name: 'robots', content: 'noindex' }]
+ : []),
+ ]
+
+ return (
+ <>
+ {title.includes('_t_') ? localize(title as TString) : title}
+
+ {meta_data.map((data) => (
+
+ ))}
+ {has_organization_schema && (
+
+ )}
+ {!is_non_localized &&
+ languages
+ .filter((l) => l !== 'ach' && l)
+ .map((locale) => {
+ const replaced_local = locale.replace('_', '-')
+ const is_default = locale === 'en' || locale === 'x-default'
+ const href_lang = is_default ? '' : `/${replaced_local}`
+ const href = `${site_url}${href_lang}${current_page}`
+
+ return (
+
+ )
+ })}
+
+ {hreflang_codes.map(({ href, hreflang, rel }) => (
+
+ ))}
+
+ {children}
+ >
+ )
+ } else {
+ // Context value or locale property is not available
+ return null
+ }
}
export default SEO
diff --git a/src/features/components/molecules/layout-overlay/cfd-warning-banner/index.tsx b/src/features/components/molecules/layout-overlay/cfd-warning-banner/index.tsx
index 9d3690d78ed..d7905029fed 100644
--- a/src/features/components/molecules/layout-overlay/cfd-warning-banner/index.tsx
+++ b/src/features/components/molecules/layout-overlay/cfd-warning-banner/index.tsx
@@ -1,9 +1,9 @@
import React, { useState } from 'react'
+import { graphql, useStaticQuery } from 'gatsby'
import * as styles from './cfd-warning-banner.module.scss'
import { Localize } from 'components/localization'
import Arrow from 'images/svg/arrow_expandable.svg'
import Container from 'features/components/atoms/container'
-import { loss_percent } from 'common/constants'
import Flex from 'features/components/atoms/flex-box'
import Link from 'features/components/atoms/link'
import Image from 'features/components/atoms/image'
@@ -15,6 +15,14 @@ const CfdWarningBanner = () => {
const { is_ppc } = usePpc()
const { is_eu, is_cpa_plan } = useRegion()
const [expanded, setExpanded] = useState(false)
+ const data = useStaticQuery(graphql`
+ query {
+ strapiCfdWarningBanner {
+ loss_percent
+ }
+ }
+ `)
+ const loss_percent = data?.strapiCfdWarningBanner?.loss_percent
if (is_ppc || is_eu || is_cpa_plan) {
const toggleExpansion = () => {
@@ -33,7 +41,7 @@ const CfdWarningBanner = () => {
{expanded ? (
<>
{
) : (
{
\ No newline at end of file
diff --git a/src/images/svg/who-we-are/people.svg b/src/images/svg/who-we-are/people.svg
deleted file mode 100644
index 65983082ac7..00000000000
--- a/src/images/svg/who-we-are/people.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/images/svg/who-we-are/shield.svg b/src/images/svg/who-we-are/shield.svg
deleted file mode 100644
index 29c679343ad..00000000000
--- a/src/images/svg/who-we-are/shield.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/images/svg/who-we-are/star.svg b/src/images/svg/who-we-are/star.svg
deleted file mode 100644
index ccceda69835..00000000000
--- a/src/images/svg/who-we-are/star.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
index d71bcc20e55..10e96291bdc 100644
--- a/src/pages/404.tsx
+++ b/src/pages/404.tsx
@@ -1,4 +1,5 @@
import React from 'react'
+import { graphql } from 'gatsby'
import { WithIntl } from 'components/localization'
import PageNotFound from 'features/pages/404'
import { isBrowser } from 'common/utility'
@@ -9,6 +10,61 @@ const NotFound = () => {
return isBrowser() &&
}
+export const query = graphql`
+ query {
+ strapiWhoWeArePage {
+ hero {
+ header
+ sub_header
+ first_paragraph
+ second_paragraph
+ third_paragraph
+ }
+ our_values {
+ header
+ values {
+ header
+ sub_header
+ }
+ }
+ our_principles {
+ header
+ principles {
+ header
+ sub_header
+ }
+ button {
+ link_name
+ }
+ }
+ our_leadership {
+ header
+ leaders {
+ role
+ }
+ }
+ deriv_in_numbers {
+ header
+ sub_header
+ numbers {
+ description
+ }
+ }
+ our_locations {
+ header
+ numbers {
+ description
+ }
+ }
+ banner {
+ header
+ sub_header
+ link_name
+ }
+ }
+ }
+`
+
export default WithIntl()(NotFound)
export const Head = ({ pageContext }: TGatsbyHead) => (
diff --git a/src/pages/who-we-are/_AboutUsBanner.tsx b/src/pages/who-we-are/_AboutUsBanner.tsx
index 10b8abf12cf..17105c397c5 100644
--- a/src/pages/who-we-are/_AboutUsBanner.tsx
+++ b/src/pages/who-we-are/_AboutUsBanner.tsx
@@ -1,12 +1,10 @@
import React from 'react'
import styled, { css } from 'styled-components'
-import BgMobile from 'images/common/who-we-are/about-us-banner-mobile.jpg'
-import BgMobileRTL from 'images/common/who-we-are/about-us-banner-mobile_rtl.jpg'
-import Bg from 'images/common/who-we-are/about-us-banner.jpg'
-import BgRTL from 'images/common/who-we-are/about-us-banner_rtl.jpg'
+import { TWhoWeAreBanner } from './_types'
import { Localize } from 'components/localization'
-import { SectionContainer, Flex } from 'components/containers'
+import { Flex, SectionContainer } from 'components/containers'
import device from 'themes/device'
+import useBreakpoints from 'components/hooks/use-breakpoints'
import { Header } from 'components/elements'
import { LinkButton } from 'components/form'
import { useIsRtl } from 'components/hooks/use-isrtl'
@@ -17,6 +15,7 @@ const StyledSectionContainer = styled(SectionContainer)`
align-items: center;
padding: 0 40px 120px;
flex-wrap: nowrap;
+
@media ${device.tablet} {
padding: 0 40px 40px;
}
@@ -24,94 +23,95 @@ const StyledSectionContainer = styled(SectionContainer)`
padding: 0 16px 40px;
}
`
+type TStyledFlex = { is_rtl: boolean; bg_image: string }
+const StyledFlex = styled(Flex)`
+ border-radius: 10px;
+ background-image: url(${({ bg_image }) => bg_image});
+ background-repeat: no-repeat;
+ background-size: cover;
+ background-position: center;
+ overflow: hidden;
-const StyledFlex = styled(Flex)<{ is_rtl: boolean }>`
- border-radius: 10px;
- ${({ is_rtl }) =>
- is_rtl
- ? css`
- background-image: url(${BgRTL});
- `
- : css`
- background-image: url(${Bg});
- `};
- background-repeat: no-repeat;
- background-size: cover;
- background-position: center;
- overflow: hidden;
- @media ${device.laptopM} {
- width: 100%;
- }
- @media (max-width: 610px) {
- ${({ is_rtl }) =>
+ @media ${device.laptopM} {
+ width: 100%;
+ }
+ @media (max-width: 610px) {
+ ${({ is_rtl, bg_image }) =>
is_rtl
- ? css`
- background-image: url(${BgMobileRTL});
+ ? css`
+ background-image: url(${bg_image});
background-position-x: right;
`
- : css`
- background-image: url(${BgMobile});
+ : css`
+ background-image: url(${bg_image});
background-position-x: left;
`};
- height: 546px;
- }
- @media (max-width: 359px) {
- background-position-x: -40px;
- }
+ height: 546px;
+ }
+ @media (max-width: 359px) {
+ background-position-x: -40px;
+ }
`
-
const PictureFlex = styled(Flex)`
- width: 373px;
- margin: 32px 0 32px 100px;
- @media ${device.laptop} {
- margin: 32px 0 32px 50px;
- }
- @media ${device.tablet} {
- margin: 40px 0 0 29px;
- width: 250px;
- }
- @media (max-width: 359px) {
- margin: 10px 10px 0 29px;
- }
-`
+ width: 373px;
+ margin: 32px 0 32px 100px;
-const StyledHeader = styled(Header)`
- line-height: 40px;
- @media ${device.laptop} {
- line-height: 34px;
- }
- @media ${device.tabletL} {
- font-size: 30px;
- }
- @media ${device.tablet} {
- font-size: 28px;
- }
+ @media ${device.laptop} {
+ margin: 32px 0 32px 50px;
+ }
+ @media ${device.tablet} {
+ margin: 40px 0 0 29px;
+ width: 250px;
+ }
+ @media (max-width: 359px) {
+ margin: 10px 10px 0 29px;
+ }
`
+const StyledHeader = styled(Header)`
+ line-height: 40px;
-const StyledHeader2 = styled(Header)`
- color: var(--color-white);
- margin: 12px 0 8px;
- @media ${device.tablet} {
- margin: 6px 0 10px;
- font-size: 11px;
- font-weight: 400;
- line-height: 17px;
- letter-spacing: 0;
- }
+ @media ${device.laptop} {
+ line-height: 34px;
+ }
+ @media ${device.tabletL} {
+ font-size: 30px;
+ }
+ @media ${device.tablet} {
+ font-size: 28px;
+ }
`
+const StyledHeader2 = styled(Header)`
+ color: var(--color-white);
+ margin: 12px 0 8px;
+ @media ${device.tablet} {
+ margin: 6px 0 10px;
+ font-size: 11px;
+ font-weight: 400;
+ line-height: 17px;
+ letter-spacing: 0;
+ }
+`
const StyledLinkButton = styled(LinkButton)`
- @media ${device.tablet} {
- padding: 8px 16px;
- }
+ @media ${device.tablet} {
+ padding: 8px 16px;
+ }
`
-const AboutUsBanner = () => {
+const AboutUsBanner = ({ banner }: TWhoWeAreBanner) => {
+ const { is_mobile_or_tablet } = useBreakpoints()
+ const bg_image = is_mobile_or_tablet
+ ? banner?.bg_mobile.localFile?.publicURL
+ : banner?.bg_desktop.localFile?.publicURL
+ const bg_image_rtl = is_mobile_or_tablet
+ ? banner?.bg_mobile_rtl.localFile?.publicURL
+ : banner?.bg_desktop_rtl.localFile?.publicURL
const is_rtl = useIsRtl()
return (
{
>
-
+
{
size="16px"
weight="400px"
>
-
+
-
-
+
+
@@ -139,4 +139,4 @@ const AboutUsBanner = () => {
)
}
-export default AboutUsBanner
+export default AboutUsBanner
\ No newline at end of file
diff --git a/src/pages/who-we-are/_DerivNumbers.tsx b/src/pages/who-we-are/_DerivNumbers.tsx
index dd5ab09956c..35842486602 100644
--- a/src/pages/who-we-are/_DerivNumbers.tsx
+++ b/src/pages/who-we-are/_DerivNumbers.tsx
@@ -1,117 +1,106 @@
import React from 'react'
import styled from 'styled-components'
-import { deriv_numbers } from './_data'
+import { TDerivNumbers } from './_types'
import { Localize } from 'components/localization'
-import { SectionContainer, Flex, CssGrid } from 'components/containers'
-import { Header, Text } from 'components/elements'
+import { CssGrid, Flex, SectionContainer } from 'components/containers'
+import { Header } from 'components/elements'
import device from 'themes/device'
const StyledSection = styled(SectionContainer)`
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 180px 16px 200px;
- background-color: var(--color-white);
-
- @media ${device.tablet} {
- padding: 30px 16px 40px;
- }
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ padding: 180px 16px 200px;
+ background-color: var(--color-white);
+
+ @media ${device.tablet} {
+ padding: 30px 16px 40px;
+ }
`
-
const StyledFlex = styled(Flex)`
- margin: 0 2rem;
- max-width: 1200px;
- justify-content: space-around;
+ margin: 0 2rem;
+ max-width: 1200px;
+ justify-content: space-around;
- @media ${device.laptop} {
- flex-direction: column;
- align-items: center;
- }
+ @media ${device.laptop} {
+ flex-direction: column;
+ align-items: center;
+ }
`
-
const TitleSection = styled(Flex)`
- max-width: 46rem;
-
- @media ${device.laptop} {
- margin-bottom: 8rem;
- max-width: 90rem;
- grid-column-gap: 4rem;
- }
-
- @media ${device.laptop} {
- margin-bottom: 24px;
- }
+ max-width: 46rem;
+
+ @media ${device.laptop} {
+ margin-bottom: 8rem;
+ max-width: 90rem;
+ grid-column-gap: 4rem;
+ }
+ @media ${device.laptop} {
+ margin-bottom: 24px;
+ }
`
-
const NumberSection = styled(CssGrid)`
- max-width: 588px;
-
- @media ${device.tabletL} {
- grid-column-gap: 4rem;
- }
-
- @media ${device.tabletS} {
- grid-template-columns: minmax(auto, 484px);
- grid-row-gap: 24px;
- grid-template-rows: 1fr 1fr 1fr 1fr;
- justify-content: start;
- }
+ max-width: 588px;
+
+ @media ${device.tabletL} {
+ grid-column-gap: 4rem;
+ }
+ @media ${device.tabletS} {
+ grid-template-columns: minmax(auto, 484px);
+ grid-row-gap: 24px;
+ grid-template-rows: 1fr 1fr 1fr 1fr;
+ justify-content: start;
+ }
`
-
const TitleHeader = styled(Header)`
- font-size: 48px;
- line-height: 60px;
-
- @media ${device.laptop} {
- text-align: center;
- }
+ font-size: 48px;
+ line-height: 60px;
- @media ${device.tabletS} {
- text-align: start;
- }
+ @media ${device.laptop} {
+ text-align: center;
+ }
- @media ${device.mobileL} {
- width: auto;
- text-align: start;
- }
+ @media ${device.tabletS} {
+ text-align: start;
+ }
+ @media ${device.mobileL} {
+ width: auto;
+ text-align: start;
+ }
`
-
const StyledHeader = styled(Header)`
- @media ${device.laptop} {
- text-align: center;
- }
+ @media ${device.laptop} {
+ text-align: center;
+ }
- @media ${device.tabletS} {
- text-align: start;
- }
-`
-
-const NumberHeader = styled(Text)`
- font-weight: bold;
- line-height: 6rem;
+ @media ${device.tabletS} {
text-align: start;
-
- @media ${device.mobileL} {
- margin-bottom: 8px;
- }
+ }
`
+const NumberHeader = styled(Header)`
+ line-height: 6rem;
+ text-align: start;
-const NumberText = styled(Text)`
- font-weight: 400;
- text-align: start;
+ @media ${device.mobileL} {
+ margin-bottom: 8px;
+ }
+`
+const NumberText = styled(Header)`
+ font-weight: normal;
+ text-align: start;
`
-const DerivNumbers = () => {
+const DerivNumbers = ({ deriv_in_numbers }: TDerivNumbers) => {
return (
-
+
-
+
{
row_gap="4rem"
height="unset"
>
- {deriv_numbers.map((number) =>
- number.map(({ count, title }) => (
-
-
-
+ {deriv_in_numbers?.numbers.map(({ number, description }) => {
+ return (
+
+
+ {number}
-
-
+
+
- )),
- )}
+ )
+ })}
diff --git a/src/pages/who-we-are/_MakeTrading.tsx b/src/pages/who-we-are/_MakeTrading.tsx
index 246355a08a7..978580bf69d 100644
--- a/src/pages/who-we-are/_MakeTrading.tsx
+++ b/src/pages/who-we-are/_MakeTrading.tsx
@@ -1,50 +1,60 @@
import React from 'react'
import styled from 'styled-components'
-import { first_section_texts } from './_data'
+import { THero } from './_types'
import { Localize } from 'components/localization'
import { SectionContainer } from 'components/containers'
import { Header } from 'components/elements'
import device from 'themes/device'
const FirstSectionContainer = styled(SectionContainer)`
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 120px 16px 24px;
- @media ${device.tabletL} {
- padding: 40px 16px;
- }
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 120px 16px 24px;
+
+ @media ${device.tabletL} {
+ padding: 40px 16px;
+ }
`
const StyledHeader = styled(Header)`
- max-width: 742px;
- padding: 0;
- @media ${device.laptop} {
- font-size: 48px;
- line-height: 60px;
- text-align: center;
- }
+ max-width: 742px;
+ padding: 0;
+
+ @media ${device.laptop} {
+ font-size: 48px;
+ line-height: 60px;
+ text-align: center;
+ }
`
const StyledFirstSectionText = styled(Header)`
- max-width: 792px;
- padding: 0 0 40px 0;
- line-height: 36px;
- font-weight: 400;
- @media ${device.laptop} {
- padding: 0 0 24px 0;
- }
-`
+ max-width: 792px;
+ padding: 0 0 40px 0;
+ line-height: 36px;
+ font-weight: 400;
-const MakeTrading = () => {
+ @media ${device.laptop} {
+ padding: 0 0 24px 0;
+ }
+`
+type TFirstSectionTexts = {
+ text: string
+}
+const MakeTrading = ({ hero }: THero) => {
+ const first_section_texts: TFirstSectionTexts[] = [
+ { text: hero?.first_paragraph },
+ { text: hero?.second_paragraph },
+ { text: hero?.third_paragraph },
+ ]
return (
- {first_section_texts.map(({ text }, index) => (
-
+ {first_section_texts?.map(({ text }) => (
+
))}
-
+
)
diff --git a/src/pages/who-we-are/_OurLeadership.tsx b/src/pages/who-we-are/_OurLeadership.tsx
index a558ef60ea1..640528f080c 100644
--- a/src/pages/who-we-are/_OurLeadership.tsx
+++ b/src/pages/who-we-are/_OurLeadership.tsx
@@ -1,50 +1,107 @@
-import React from 'react'
+import React, { MouseEventHandler, useState } from 'react'
import styled from 'styled-components'
-import Leaders from './components/leaders'
+import { TLeader, TOurLeadership } from './_types'
+import Modal, { ModalFlex } from './components/_modal'
+import { useBrowserResize } from 'components/hooks/use-browser-resize'
import { Localize } from 'components/localization'
-import { SectionContainer, CssGrid } from 'components/containers'
+import { CssGrid, SectionContainer } from 'components/containers'
import { Header } from 'components/elements'
import device from 'themes/device'
const StyledSectionContainer = styled(SectionContainer)`
- display: flex;
- flex-direction: column;
- align-items: center;
- margin: 0;
- padding: 0 16px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ margin: 0;
+ padding: 0 16px;
`
-
const StyledCssGrid = styled(CssGrid)`
- max-width: 996px;
- @media (max-width: 1100px) {
- max-width: 90%;
- padding: 0 40px;
- }
- @media ${device.tablet} {
- max-width: unset;
- padding: 0;
- }
- @media (max-width: 359px) {
- grid-template-columns: repeat(3, 88px);
- grid-column-gap: 12px;
- grid-row-gap: 4px;
- }
+ max-width: 996px;
+
+ @media (max-width: 1100px) {
+ max-width: 90%;
+ padding: 0 40px;
+ }
+ @media ${device.tablet} {
+ max-width: unset;
+ padding: 0;
+ }
+ @media (max-width: 359px) {
+ grid-template-columns: repeat(3, 88px);
+ grid-column-gap: 12px;
+ grid-row-gap: 4px;
+ }
`
const StyledHeader = styled(Header)`
- padding-bottom: 40px;
- @media ${device.laptop} {
- font-size: 28px;
+ padding-bottom: 40px;
+
+ @media ${device.laptop} {
+ font-size: 28px;
+ }
+ @media ${device.tablet} {
+ padding-bottom: 24px;
+ }
+`
+const StyledImageWrapper = styled.div`
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ position: relative;
+ padding-bottom: 20px;
+
+ @media ${device.tabletS} {
+ width: 104px;
+ height: 114px;
+ }
+ @media ${device.tabletL} {
+ &:nth-child(3n-2) {
+ ${ModalFlex} {
+ left: 0;
+ }
}
- @media ${device.tablet} {
- padding-bottom: 24px;
+ &:nth-child(3n) {
+ ${ModalFlex} {
+ align-self: right;
+ right: 0;
+ }
}
+ }
+ @media ${device.tabletS} {
+ padding-bottom: 10px;
+ }
+ @media ${device.mobileL} {
+ width: 88px;
+ height: 98px;
+ }
`
+type MouseEvent = MouseEventHandler &
+ ((event: MouseEventHandler) => void)
+
+const LeaderCard = (leader: TLeader) => {
+ const { name, role, photo, link_url } = leader
+ const [is_popup_shown, setIsPopupShown] = useState(false)
+ const [is_mobile] = useBrowserResize()
+ const showModal: MouseEvent = () => setIsPopupShown(true)
+ const dontShowModal: MouseEvent = () => setIsPopupShown(false)
-const OurLeadership = () => {
+ return (
+
+
+ {is_popup_shown && }
+
+ )
+}
+
+const OurLeadership = ({ our_leadership }: TOurLeadership) => {
return (
-
+
{
mobile_column_gap="24px"
mobile_row_gap="6px"
>
-
+ {our_leadership?.leaders?.map((leader) => (
+
+ ))}
)
}
-
-export default OurLeadership
+export default OurLeadership
\ No newline at end of file
diff --git a/src/pages/who-we-are/_OurOffices.tsx b/src/pages/who-we-are/_OurOffices.tsx
index 50c93fc4268..401d51c1937 100644
--- a/src/pages/who-we-are/_OurOffices.tsx
+++ b/src/pages/who-we-are/_OurOffices.tsx
@@ -1,143 +1,147 @@
import React from 'react'
import styled from 'styled-components'
-import { StaticImage } from 'gatsby-plugin-image'
-import { desktop_pins, mobile_pins, our_offices_count } from './_data'
-import MapPin from './components/map-pin'
-import { Localize, localize } from 'components/localization'
-import { SectionContainer, CssGrid, Desktop, Mobile, Flex } from 'components/containers'
-import { Header, Text, BackgroundImageWrapper, StaticImageWrapper } from 'components/elements'
+import { TOurOffices } from './_types'
+import MapPin, { MapPinType } from './components/_map-pin'
+import { Localize } from 'components/localization'
+import { Desktop, Flex, Mobile, SectionContainer } from 'components/containers'
+import { Header } from 'components/elements'
import device from 'themes/device'
const StyledSectionContainer = styled(SectionContainer)`
- display: flex;
- overflow: hidden;
- flex-direction: column;
- align-items: center;
- margin-top: 120px;
+ display: flex;
+ overflow: hidden;
+ flex-direction: column;
+ align-items: center;
+ margin-top: 120px;
- @media ${device.tablet} {
- margin-top: 40px;
- padding: 0 16px 40px;
- }
+ @media ${device.tablet} {
+ margin-top: 40px;
+ padding: 0 0 40px;
+ }
`
-
const StyledHeader = styled(Header)`
- line-height: 4rem;
- margin-bottom: 40px;
- @media ${device.laptop} {
- font-size: 28px;
- }
-`
+ line-height: 4rem;
+ margin-bottom: 40px;
-const NumberSection = styled(CssGrid)`
- margin-top: 40px;
- max-width: 788px;
- direction: ltr;
-
- @media ${device.tablet} {
- grid-column-gap: 3rem;
- padding: 0 16px;
- }
-
- @media (max-width: 359px) {
- grid-column-gap: 1rem;
- }
+ @media ${device.laptop} {
+ font-size: 28px;
+ }
`
-
-const NumberHeader = styled(Text)`
- font-weight: bold;
- line-height: 6rem;
- text-align: center;
-
- @media ${device.tablet} {
- font-size: 24px;
- }
+const NumberSection = styled(Flex)`
+ margin-top: 40px;
+ max-width: 788px;
`
-
-const NumberText = styled(Text)`
- font-weight: 400;
- text-align: center;
- @media ${device.tablet} {
- font-size: 14px;
- }
+const NumberText = styled(Header)`
+ font-weight: normal;
`
-
-const StyledFlex = styled(Flex)`
- height: unset;
+const MapImage = styled.div<{ bg_image: string }>`
+ position: relative;
+ width: 840px;
+ overflow: auto;
+ height: 414px;
+ background-image: url(${({ bg_image }) => bg_image});
+ background-color: transparent;
+ background-size: cover;
+ direction: ltr;
+
+ @media ${device.tabletL} {
+ width: 328px;
+ height: 170px;
+ overflow: hidden;
+ }
+ @media (max-width: 359px) {
+ width: 298px;
+ height: 155px;
+ overflow: hidden;
+ }
`
-const MapWrapper = styled.div`
- width: 840px;
- overflow: auto;
- height: 414px;
- direction: ltr;
-
- @media ${device.tabletL} {
- width: 328px;
- height: 170px;
- overflow: hidden;
- }
- @media (max-width: 359px) {
- width: 298px;
- height: 155px;
- overflow: hidden;
- }
-`
+const OurOffices = ({ our_locations }: TOurOffices) => {
+ // when we're adding new locations we have to add it in strapi and placement of pin in the end of each list
+ const desktop_pins: MapPinType[] = [
+ { left: '30%', top: '74%' },
+ { left: '31%', top: '76%' },
+ { left: '23.5%', top: '50%' },
+ { left: '50%', top: '39.5%' },
+ { left: '55%', top: '40%' },
+ { left: '56%', top: '43%' },
+ { left: '54%', top: '61.5%' },
+ { left: '54%', top: '27.5%' },
+ { left: '61.5%', top: '45.9%' },
+ { left: '73.3%', top: '57.5%' },
+ { left: '74.2%', top: '58.5%' },
+ { left: '74.2%', top: '60.6%' },
+ { left: '77.2%', top: '58.7%' },
+ { left: '47.4%', top: '30.9%' },
+ { left: '28.3%', top: '50.8%' },
+ { left: '49.4%', top: '27.9%' },
+ { left: '44.5%', top: '30.9%' },
+ { left: '92.2%', top: '69.7%' },
+ { left: '74.6%', top: '61%' },
+ { left: '45.9%', top: '28%' },
+ ]
+ const mobile_pins: MapPinType[] = [
+ { left: '28.5%', top: '71%' },
+ { left: '30%', top: '75%' },
+ { left: '22%', top: '47.7%' },
+ { left: '26%', top: '48%' },
+ { left: '48.5%', top: '35.5%' },
+ { left: '53.5%', top: '36%' },
+ { left: '56.5%', top: '37%' },
+ { left: '52.5%', top: '57.5%' },
+ { left: '52.5%', top: '23.5%' },
+ { left: '60%', top: '41.9%' },
+ { left: '72.3%', top: '51.2%' },
+ { left: '71%', top: '55%' },
+ { left: '73%', top: '56.7%' },
+ { left: '74.5%', top: '57.9%' },
+ { left: '47.9%', top: '24.9%' },
+ { left: '76%', top: '54.7%' },
+ { left: '45.9%', top: '26.9%' },
+ { left: '43%', top: '26.9%' },
+ { left: '92.5%', top: '65.1%' },
+ { left: '45.9%', top: '20%' },
+ ]
+ const desktop = []
+ const mobile = []
+ our_locations?.locations?.map((location, index) => {
+ desktop.push({ ...our_locations?.locations[index], ...desktop_pins[index] })
+ mobile.push({ ...our_locations?.locations[index], ...mobile_pins[index] })
+ })
-const OurOffices = () => {
return (
-
+
-
-
-
-
-
- {desktop_pins.map((pin, idx) => (
-
- ))}
-
-
+
+ {desktop?.map((pin) => (
+
+ ))}
+
-
-
-
-
-
- {mobile_pins.map((pin, idx) => (
-
- ))}
-
-
+
+ {mobile?.map((pin) => (
+
+ ))}
+
-
- {our_offices_count.map(({ count, title }) => (
-
-
-
-
-
-
+
+ {our_locations?.numbers.map(({ description, number }) => (
+
+
+
+
-
+
))}
diff --git a/src/pages/who-we-are/_OurPrinciples.tsx b/src/pages/who-we-are/_OurPrinciples.tsx
index 6b463edbcde..15235024cbf 100644
--- a/src/pages/who-we-are/_OurPrinciples.tsx
+++ b/src/pages/who-we-are/_OurPrinciples.tsx
@@ -1,90 +1,99 @@
import React from 'react'
import styled from 'styled-components'
-import { our_principles } from './_data'
+import { TOurPrinciples } from './_types'
import { Localize } from 'components/localization'
-import { SectionContainer, Flex, Box } from 'components/containers'
-import { Header, Divider } from 'components/elements'
+import { Box, Flex, SectionContainer } from 'components/containers'
+import { Divider, Header } from 'components/elements'
import device from 'themes/device'
import { LinkButton } from 'components/form'
const StyledSection = styled(SectionContainer)`
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 24px 16px 120px;
- background-color: var(--color-white);
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ padding: 24px 16px 120px;
+ background-color: var(--color-white);
- @media ${device.tablet} {
- padding: 40px 16px;
- }
+ @media ${device.tablet} {
+ padding: 40px 16px;
+ }
`
const StyledDivider = styled(Divider)`
- margin: 0;
+ margin: 0;
- @media (min-width: 824px) {
- width: 792px;
- }
+ @media (min-width: 824px) {
+ width: 792px;
+ }
`
const StyledFlex = styled(Flex)`
- margin-bottom: 40px;
- max-width: 792px;
- @media (max-width: 930px) {
- flex-direction: column;
- width: unset;
- align-items: left;
- margin-bottom: 24px;
- }
+ margin-bottom: 40px;
+ max-width: 792px;
+
+ @media (max-width: 930px) {
+ flex-direction: column;
+ width: unset;
+ align-items: left;
+ margin-bottom: 24px;
+ }
`
const InsideFlex = styled(Flex)`
- @media ${device.tablet} {
- display: block;
- margin-top: 18px;
- }
+ @media ${device.tablet} {
+ display: block;
+ margin-top: 18px;
+ }
`
const StyledText = styled(Header)`
- max-width: 551px;
- margin: 16px 0;
- font-size: 16px;
- @media ${device.tablet} {
- font-size: 14px;
- }
+ max-width: 551px;
+ margin: 16px 0;
+ font-size: 16px;
+
+ @media ${device.tablet} {
+ font-size: 14px;
+ }
`
const StyledLinkButton = styled(LinkButton)`
- height: 40px;
- width: auto;
- border-radius: 4px;
- position: relative;
- white-space: nowrap;
+ height: 40px;
+ width: auto;
+ border-radius: 4px;
+ position: relative;
+ white-space: nowrap;
`
const StyledDiv = styled.div`
- width: 241px;
+ width: 241px;
`
const ColoredBox = styled(Box)<{ bgcolor: string }>`
- align-self: left;
- width: fit-content;
- padding: 8px 16px;
- background-color: ${(props) => props.bgcolor};
- border-radius: 8px;
- font-weight: bold;
- color: #333333;
- font-size: 24px;
- line-height: 36px;
- margin-right: 20px;
+ align-self: left;
+ width: fit-content;
+ padding: 8px 16px;
+ background-color: ${({ bgcolor }) => bgcolor};
+ border-radius: 8px;
+ font-weight: bold;
+ color: #333333;
+ font-size: 24px;
+ line-height: 36px;
+ margin-right: 20px;
- @media ${device.tabletL} {
- font-size: 18px;
- }
+ @media ${device.tabletL} {
+ font-size: 18px;
+ }
`
-const OurPrinciples = () => {
+const OurPrinciples = ({ our_principles }: TOurPrinciples) => {
+ const colors = [
+ 'rgba(133, 189, 177, 0.25)',
+ 'rgba(255, 195, 89, 0.25)',
+ 'rgba(150, 133, 189, 0.25)',
+ 'rgba(119, 160, 198, 0.25)',
+ ]
+
return (
- {our_principles.map(({ color, title, text }, idx) => (
+ {our_principles?.principles.map(({ header, sub_header }, idx) => (
{
tablet_ai="left"
>
-
-
+
+
-
+
))}
-
-
+
+
)
diff --git a/src/pages/who-we-are/_OurValues.tsx b/src/pages/who-we-are/_OurValues.tsx
index abdf8c5d7bc..c3be1f30ec4 100644
--- a/src/pages/who-we-are/_OurValues.tsx
+++ b/src/pages/who-we-are/_OurValues.tsx
@@ -1,76 +1,78 @@
import React from 'react'
import styled from 'styled-components'
-import { our_values } from './_data'
-import { Localize, localize } from 'components/localization'
-import { SectionContainer, Flex } from 'components/containers'
-import { Header, Text } from 'components/elements'
+import { TOurValues } from './_types'
+import { Localize } from 'components/localization'
+import { Flex, SectionContainer } from 'components/containers'
+import { Header } from 'components/elements'
import device from 'themes/device'
const OurValuesSection = styled(SectionContainer)`
- display: flex;
- flex-direction: row;
- justify-content: center;
- padding: 80px 16px 56px;
- background-color: var(--color-grey-30);
- @media (max-width: 1255px) {
- align-items: center;
- flex-direction: column;
- }
- @media ${device.tablet} {
- padding: 40px 16px 16px;
- }
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ padding: 80px 16px 56px;
+ background-color: var(--color-grey-30);
+
+ @media (max-width: 1255px) {
+ align-items: center;
+ flex-direction: column;
+ }
+ @media ${device.tablet} {
+ padding: 40px 16px 16px;
+ }
`
const StyledHeader = styled(Header)`
- margin: 235px 70px 0 0;
- padding: 0;
- @media ${device.laptop} {
- font-size: 48px;
- line-height: 60px;
- }
- @media (max-width: 1255px) {
- margin: 0 0 40px 0;
- width: unset;
- max-width: 602px;
- }
+ margin: 235px 70px 0 0;
+ padding: 0;
+
+ @media ${device.laptop} {
+ font-size: 48px;
+ line-height: 60px;
+ }
+ @media (max-width: 1255px) {
+ margin: 0 0 40px 0;
+ width: unset;
+ max-width: 602px;
+ }
`
const StyledFlex = styled(Flex)`
- @media (max-width: 930px) {
- flex-direction: column;
- align-items: center;
- width: unset;
- }
+ @media (max-width: 930px) {
+ flex-direction: column;
+ align-items: center;
+ width: unset;
+ }
`
const Card = styled(Flex)<{ index: number }>`
- max-width: 384px;
- padding: 32px 44px 32px 32px;
- box-shadow: rgba(14, 14, 14, 0.1) 0 4px 8px 0;
- background-color: var(--color-white);
- margin: 0 24px 24px 0;
- margin-top: ${(props) => (props.index === 1 ? '80px' : props.index === 2 ? '-80px' : 0)};
- border-radius: 8px;
+ max-width: 384px;
+ padding: 32px 44px 32px 32px;
+ box-shadow: rgba(14, 14, 14, 0.1) 0 4px 8px 0;
+ background-color: var(--color-white);
+ margin: 0 24px 24px 0;
+ margin-top: ${({ index }) => (index === 1 ? '80px' : index === 2 ? '-80px' : 0)};
+ border-radius: 8px;
- @media (max-width: 930px) {
- order: ${(props) => (props.index === 2 ? 1 : props.index === 1 ? 2 : props.index)};
- margin: 0 0 19px;
- }
+ @media (max-width: 930px) {
+ order: ${({ index }) => (index === 2 ? 1 : index === 1 ? 2 : index)};
+ margin: 0 0 19px;
+ }
`
-const OurValues = () => {
+const OurValues = ({ our_values }: TOurValues) => {
return (
-
+
- {our_values.map(({ title, icon, text }, index) => (
+ {our_values?.values.map(({ header, image, sub_header }, index) => (
-
+
+
-
-
-
))}
diff --git a/src/pages/who-we-are/_data.tsx b/src/pages/who-we-are/_data.tsx
deleted file mode 100644
index baa268b60ac..00000000000
--- a/src/pages/who-we-are/_data.tsx
+++ /dev/null
@@ -1,341 +0,0 @@
-import Shield from 'images/svg/who-we-are/shield.svg'
-import Star from 'images/svg/who-we-are/star.svg'
-import People from 'images/svg/who-we-are/people.svg'
-import Hands from 'images/svg/who-we-are/hands.svg'
-import { TString } from 'types/generics'
-
-type FirstSectionTextsType = {
- text: TString
-}
-
-type ValueType = {
- title: TString
- text: TString
- icon: string
-}
-
-type PrincipleType = {
- title: TString
- text: TString
- color: string
-}
-
-export type MapPinType = {
- left: string
- top: string
- title: TString
- link: string
-}
-
-type DerivNumbersType = {
- count: TString
- title: TString
-}
-
-export const first_section_texts: FirstSectionTextsType[] = [
- {
- text: '_t_Deriv is one of the world’s largest online brokers. We offer CFDs and other derivatives on forex, stocks & indices, cryptocurrencies, commodities, and derived to millions of registered users across the globe._t_',
- },
- {
- text: '_t_From inception, our goal was to break free of the high commissions and clunky products offered by traditional brokers. Also, we aim to deliver a first-class experience to digitally inclined traders, regardless of the size of their accounts._t_',
- },
- {
- text: '_t_In a journey spanning more than 22 years, we have grown to over 2.5 million customers worldwide. But our mission has remained the same._t_',
- },
-]
-
-export const our_values: ValueType[] = [
- {
- title: '_t_Integrity_t_',
- text: '_t_We serve our customers with fairness and transparency. We settle all contracts by the book and speak plainly and truthfully._t_',
- icon: Shield,
- },
- {
- title: '_t_Customer focus_t_',
- text: '_t_We put the customer first and strive to build products that deliver the best customer experience._t_',
- icon: People,
- },
- {
- title: '_t_Competence_t_',
- text: '_t_We value colleagues with an aptitude to learn and grow and the ability to use good judgement._t_',
- icon: Star,
- },
- {
- title: '_t_Teamwork_t_',
- text: '_t_We value team players that collaborate freely across departments with humility and ambition._t_',
- icon: Hands,
- },
-]
-
-export const our_principles: PrincipleType[] = [
- {
- title: '_t_Be reliable_t_',
- text: '_t_We settle all contracts fairly, process all deposits and withdrawals promptly, and provide reliable support and a high-quality trading experience to all our customers._t_',
- color: 'rgba(133, 189, 177, 0.25)',
- },
- {
- title: '_t_Be fair_t_',
- text: '_t_We treat all customers equitably, handle complaints with integrity, and offer competitive prices with no hidden costs and no artificial barriers on customer withdrawals._t_',
- color: 'rgba(255, 195, 89, 0.25)',
- },
- {
- title: '_t_Be transparent_t_',
- text: '_t_We speak plainly to avoid ambiguity, disclose the terms of all contracts, and are clear about the risks of trading and how we make money._t_',
- color: 'rgba(150, 133, 189, 0.25)',
- },
- {
- title: '_t_Be responsible_t_',
- text: '_t_We don’t practise hard-selling, offer financial or trading advice, nor make promises of guaranteed returns. We don’t encourage vulnerable people to trade and implement controls to prevent any unlawful activity._t_',
- color: 'rgba(119, 160, 198, 0.25)',
- },
-]
-
-export const desktop_pins: MapPinType[] = [
- {
- left: '30%',
- top: '74%',
- title: '_t_Asunción, Paraguay_t_',
- link: '/careers/locations/asuncion',
- },
- {
- left: '31%',
- top: '76%',
- title: '_t_Ciudad del Este, Paraguay_t_',
- link: '/careers/locations/ciudad',
- },
- {
- left: '23.5%',
- top: '50%',
- title: '_t_George Town, Cayman Islands_t_',
- link: '/careers/locations/georgetown',
- },
- {
- left: '50%',
- top: '39.5%',
- title: '_t_Birkirkara, Malta_t_',
- link: '/careers/locations/malta',
- },
- {
- left: '55%',
- top: '40%',
- title: '_t_Limassol, Cyprus_t_',
- link: '/careers/locations/cyprus',
- },
- {
- left: '56%',
- top: '43%',
- title: '_t_Amman, Jordan_t_',
- link: '/careers/locations/jordan',
- },
- {
- left: '54%',
- top: '61.5%',
- title: '_t_Kigali, Rwanda_t_',
- link: '/careers/locations/rwanda',
- },
- {
- left: '61.5%',
- top: '45.9%',
- title: '_t_Dubai, UAE_t_',
- link: '/careers/locations/dubai',
- },
- {
- left: '73.3%',
- top: '57.5%',
- title: '_t_Ipoh, Malaysia_t_',
- link: '/careers/locations/ipoh',
- },
- {
- left: '74.2%',
- top: '58.5%',
- title: '_t_Cyberjaya, Malaysia_t_',
- link: '/careers/locations/cyberjaya',
- },
- {
- left: '74.2%',
- top: '60.6%',
- title: '_t_Melaka, Malaysia_t_',
- link: '/careers/locations/melaka',
- },
- {
- left: '77.2%',
- top: '58.7%',
- title: '_t_Labuan, Malaysia_t_',
- link: '/careers/locations/labuan',
- },
- {
- left: '47.4%',
- top: '30.9%',
- title: '_t_Paris, France_t_',
- link: '/careers/locations/paris',
- },
- {
- left: '28.3%',
- top: '50.8%',
- title: '_t_Road Town, British Virgin Islands_t_',
- link: '/careers/locations/roadtown',
- },
- {
- left: '49.4%',
- top: '27.9%',
- title: '_t_Berlin, Germany_t_',
- link: '/careers/locations/berlin',
- },
- {
- left: '44.5%',
- top: '30.9%',
- title: '_t_Guernsey, Channel Islands_t_',
- link: '/careers/locations/guernsey',
- },
- {
- left: '92.2%',
- top: '69.7%',
- title: '_t_Port Vila, Vanuatu_t_',
- link: '/careers/locations/vanuatu',
- },
- {
- left: '74.6%',
- top: '61%',
- title: '_t_Singapore, Singapore_t_',
- link: '/careers/locations/singapore',
- },
- {
- left: '45.9%',
- top: '28%',
- title: '_t_Reading, United kingdom_t_',
- link: '/careers/locations/reading',
- },
-]
-
-export const mobile_pins: MapPinType[] = [
- {
- left: '28.5%',
- top: '71%',
- title: '_t_Asunción, Paraguay_t_',
- link: '/careers/locations/asuncion',
- },
- {
- left: '30%',
- top: '75%',
- title: '_t_Ciudad del Este, Paraguay_t_',
- link: '/careers/locations/ciudad',
- },
- {
- left: '22%',
- top: '47.7%',
- title: '_t_George Town, Cayman Islands_t_',
- link: '/careers/locations/georgetown',
- },
- {
- left: '26%',
- top: '48%',
- title: '_t_Road Town, British Virgin Islands_t_',
- link: '/careers/locations/roadtown',
- },
- {
- left: '48.5%',
- top: '35.5%',
- title: '_t_Birkirkara, Malta_t_',
- link: '/careers/locations/malta',
- },
- {
- left: '53.5%',
- top: '36%',
- title: '_t_Limassol, Cyprus_t_',
- link: '/careers/locations/cyprus',
- },
- {
- left: '56.5%',
- top: '37%',
- title: '_t_Amman, Jordan_t_',
- link: '/careers/locations/jordan',
- },
- {
- left: '52.5%',
- top: '57.5%',
- title: '_t_Kigali, Rwanda_t_',
- link: '/careers/locations/rwanda',
- },
- {
- left: '60%',
- top: '41.9%',
- title: '_t_Dubai, UAE_t_',
- link: '/careers/locations/dubai',
- },
- {
- left: '72.3%',
- top: '51.2%',
- title: '_t_Ipoh, Malaysia_t_',
- link: '/careers/locations/ipoh',
- },
- {
- left: '71%',
- top: '55%',
- title: '_t_Cyberjaya, Malaysia_t_',
- link: '/careers/locations/cyberjaya',
- },
- {
- left: '73%',
- top: '56.7%',
- title: '_t_Melaka, Malaysia_t_',
- link: '/careers/locations/melaka',
- },
- {
- left: '74.5%',
- top: '57.9%',
- title: '_t_Singapore, Singapore_t_',
- link: '/careers/locations/singapore',
- },
- {
- left: '47.9%',
- top: '24.9%',
- title: '_t_Berlin, Germany_t_',
- link: '/careers/locations/berlin',
- },
- {
- left: '76%',
- top: '54.7%',
- title: '_t_Labuan, Malaysia_t_',
- link: '/careers/locations/labuan',
- },
- {
- left: '45.9%',
- top: '26.9%',
- title: '_t_Paris, France_t_',
- link: '/careers/locations/paris',
- },
- {
- left: '43%',
- top: '26.9%',
- title: '_t_Guernsey, Channel Islands_t_',
- link: '/careers/locations/guernsey',
- },
- {
- left: '92.5%',
- top: '65.1%',
- title: '_t_Port Vila, Vanuatu_t_',
- link: '/careers/locations/vanuatu',
- },
- {
- left: '45.9%',
- top: '20%',
- title: '_t_Reading, United kingdom_t_',
- link: '/careers/locations/reading',
- },
-]
-
-export const our_offices_count: DerivNumbersType[] = [
- { count: '_t_1000+_t_', title: '_t_employees_t_' },
- { count: '_t_50+_t_', title: '_t_nationalities_t_' },
- { count: '_t_20_t_', title: '_t_locations_t_' },
- { count: '_t_16_t_', title: '_t_countries_t_' },
-]
-
-export const deriv_numbers: DerivNumbersType[][] = [
- [
- { count: '_t_2.5M+_t_', title: '_t_traders worldwide_t_' },
- { count: '_t_USD 26M+_t_', title: '_t_withdrawals last month_t_' },
- { count: '_t_114M+_t_', title: '_t_trades last month_t_' },
- { count: '_t_USD 10B+_t_', title: '_t_total trade turnover_t_' },
- ],
-]
diff --git a/src/pages/who-we-are/_types.ts b/src/pages/who-we-are/_types.ts
new file mode 100644
index 00000000000..4a1ac50f917
--- /dev/null
+++ b/src/pages/who-we-are/_types.ts
@@ -0,0 +1,106 @@
+type StrapiImage = {
+ localFile: {
+ publicURL: string
+ }
+}
+
+type HeroType = {
+ header: string
+ sub_header: string
+ first_paragraph: string
+ second_paragraph: string
+ third_paragraph: string
+ hero_image: StrapiImage
+ bg_desktop: StrapiImage
+ bg_mobile: StrapiImage
+}
+type THero = { hero: HeroType }
+type TValues = {
+ header: string
+ sub_header: string
+ image: StrapiImage
+}
+type OurValues = {
+ header: string
+ values: TValues[]
+}
+type TOurValues = { our_values: OurValues }
+type TPrinciples = {
+ header: string
+ button: { link_name: string; link_url: string }
+ principles: { header: string; sub_header: string }[]
+}
+type TOurPrinciples = { our_principles: TPrinciples }
+type TLeader = {
+ name: string
+ role: string
+ link_url: string
+ photo: StrapiImage
+}
+type TOurLeadership = {
+ our_leadership: {
+ header: string
+ leaders: TLeader[]
+ }
+}
+type TNumbers = {
+ header: string
+ sub_header: string
+ numbers: { description: string; number: string }[]
+}
+type TDerivNumbers = { deriv_in_numbers: TNumbers }
+type TSlider = {
+ slider_1: StrapiImage
+ slider_2: StrapiImage
+ slider_3: StrapiImage
+ slider_4: StrapiImage
+ slider_5: StrapiImage
+ slider_6: StrapiImage
+}
+type TImageMarquee = { slider_medias: TSlider[] }
+type Tlocations = {
+ header: string
+ numbers: { description: string; number: string }[]
+ locations: { country_city: string; link_url: string }[]
+ earth: StrapiImage
+ earth_mobile: StrapiImage
+ pin: StrapiImage
+}
+type TOurOffices = { our_locations: Tlocations }
+type TBanner = {
+ header: string
+ sub_header: string
+ link_name: string
+ link_url: string
+ bg_desktop: StrapiImage
+ bg_desktop_rtl: StrapiImage
+ bg_mobile: StrapiImage
+ bg_mobile_rtl: StrapiImage
+}
+type TWhoWeAreBanner = { banner: TBanner }
+type TWhoWeAre = {
+ data: {
+ strapiWhoWeArePage: THero &
+ TOurValues &
+ TOurPrinciples &
+ TLeader &
+ TOurLeadership &
+ TDerivNumbers &
+ TImageMarquee &
+ TOurOffices &
+ TWhoWeAreBanner
+ }
+}
+
+export {
+ TWhoWeAre,
+ THero,
+ TOurValues,
+ TOurPrinciples,
+ TLeader,
+ TOurLeadership,
+ TDerivNumbers,
+ TImageMarquee,
+ TOurOffices,
+ TWhoWeAreBanner,
+}
\ No newline at end of file
diff --git a/src/pages/who-we-are/carousel/_ImageMarquee.tsx b/src/pages/who-we-are/carousel/_ImageMarquee.tsx
index 9edc635b39e..874451042b9 100644
--- a/src/pages/who-we-are/carousel/_ImageMarquee.tsx
+++ b/src/pages/who-we-are/carousel/_ImageMarquee.tsx
@@ -1,142 +1,102 @@
import React from 'react'
import styled from 'styled-components'
-import { graphql, useStaticQuery } from 'gatsby'
import Ticker from 'react-ticker'
-import type { ImageDataLike } from 'gatsby-plugin-image'
-import { QueryImage } from 'components/elements'
+import { TImageMarquee } from '../_types'
import device from 'themes/device'
import { useIsRtl } from 'components/hooks/use-isrtl'
-const queryCarouselData = graphql`
- query {
- media1: file(relativePath: { eq: "about-us-carousel/media-1.jpg" }) {
- ...fadeIn
- }
- media2: file(relativePath: { eq: "about-us-carousel/media-2.jpg" }) {
- ...fadeIn
- }
- media3: file(relativePath: { eq: "about-us-carousel/media-3.jpg" }) {
- ...fadeIn
- }
- media4: file(relativePath: { eq: "about-us-carousel/media-4.jpg" }) {
- ...fadeIn
- }
- media5: file(relativePath: { eq: "about-us-carousel/media-5.jpg" }) {
- ...fadeIn
- }
- media6: file(relativePath: { eq: "about-us-carousel/media-6.jpg" }) {
- ...fadeIn
- }
- }
-`
-
const CarouselSlide = styled.div`
- position: relative;
- padding-left: 20px;
+ position: relative;
+ padding-left: 20px;
- @media ${device.tablet} {
- padding-left: 10px;
- }
+ @media ${device.tablet} {
+ padding-left: 10px;
+ }
- &:nth-child(1) {
- min-width: 384px;
+ &:nth-child(1) {
+ min-width: 384px;
- @media ${device.tablet} {
- min-width: 328px;
- }
+ @media ${device.tablet} {
+ min-width: 328px;
}
- &:nth-child(2) {
- min-width: 792px;
+ }
+ &:nth-child(2) {
+ min-width: 792px;
- @media ${device.tablet} {
- min-width: 328px;
- }
+ @media ${device.tablet} {
+ min-width: 328px;
}
- &:nth-child(3) {
- min-width: 384px;
+ }
+ &:nth-child(3) {
+ min-width: 384px;
- @media ${device.tablet} {
- min-width: 328px;
- }
- }
- &:nth-child(4) {
- min-width: 792px;
- @media ${device.tablet} {
- min-width: 328px;
- }
+ @media ${device.tablet} {
+ min-width: 328px;
}
- &:nth-child(5) {
- min-width: 384px;
+ }
+ &:nth-child(4) {
+ min-width: 792px;
- @media ${device.tablet} {
- min-width: 192px;
- }
+ @media ${device.tablet} {
+ min-width: 328px;
}
- &:nth-child(6) {
- min-width: 384px;
+ }
+ &:nth-child(5) {
+ min-width: 384px;
- @media ${device.tablet} {
- min-width: 192px;
- }
+ @media ${device.tablet} {
+ min-width: 192px;
}
-`
-const StyledImageWrapper = styled.div`
- position: relative;
- overflow: hidden;
- border-radius: 8px;
- height: 480px;
+ }
+ &:nth-child(6) {
+ min-width: 384px;
@media ${device.tablet} {
- height: 240px;
+ min-width: 192px;
}
+ }
`
-const StyledQueryImage = styled(QueryImage)<{ is_rtl: boolean }>`
- position: absolute;
- display: block;
- top: 50%;
- left: 50%;
- min-height: 100%;
- min-width: 100%;
- height: 480px;
- transform: ${({ is_rtl }) => (is_rtl ? 'translate(50%, -50%)' : 'translate(-50%, -50%)')};
- @media ${device.tablet} {
- height: 240px;
- }
-
- & .gatsby-image-wrapper img {
- height: 480px;
-
- @media ${device.tablet} {
- height: 240px;
- }
- }
+const StyledImageWrapper = styled.div`
+ position: relative;
+ overflow: hidden;
+ border-radius: 8px;
+ height: 480px;
+
+ @media ${device.tablet} {
+ height: 240px;
+ }
+`
+const StyledImage = styled.div<{ is_rtl: boolean; image: string }>`
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ background: url(${({ image }) => image}) no-repeat fixed center;
+ background-size: cover;
+ width: 100%;
+ height: 480px;
+ transform: ${({ is_rtl }) => (is_rtl ? 'translate(50%, -50%)' : 'translate(-50%, -50%)')};
+
+ @media ${device.tablet} {
+ height: 240px;
+ }
`
-const ImageMarquee = () => {
- const carousel_data = useStaticQuery(queryCarouselData)
- const carousel_images: ImageDataLike[] = [
- carousel_data.media1,
- carousel_data.media2,
- carousel_data.media3,
- carousel_data.media4,
- carousel_data.media5,
- carousel_data.media6,
- ]
-
+const ImageMarquee = ({ slider_medias }: TImageMarquee) => {
const is_rtl = useIsRtl()
+ const sliders_array = Object.keys(slider_medias || {}).map(function (slider_index) {
+ return slider_medias[slider_index]
+ })
return (
{() => (
- {carousel_images.map((carouselItem, index) => (
-
+ {sliders_array?.map((carousel_item) => (
+
-
diff --git a/src/pages/who-we-are/components/_hero.tsx b/src/pages/who-we-are/components/_hero.tsx
index ff82e6d41b8..babc05a7a36 100644
--- a/src/pages/who-we-are/components/_hero.tsx
+++ b/src/pages/who-we-are/components/_hero.tsx
@@ -1,35 +1,19 @@
import React from 'react'
import styled from 'styled-components'
-import { graphql, useStaticQuery } from 'gatsby'
-import { Flex, Desktop, Mobile } from 'components/containers'
-import { QueryImage } from 'components/elements'
+import { THero } from '../_types'
+import useBreakpoints from 'components/hooks/use-breakpoints'
+import { Localize } from 'components/localization'
+import { Desktop, Flex, Mobile } from 'components/containers'
import device from 'themes/device'
-import { Localize, localize } from 'components/localization'
-import desktop_bg from 'images/common/about/about_us_bg_desktop.png'
-import mobile_bg from 'images/common/about/about_us_bg_mobile.png'
-
-const query = graphql`
- query {
- about_us_logo: file(relativePath: { eq: "about/about_us_logo.png" }) {
- ...fadeIn
- }
- }
-`
type ParentWrapperProps = {
- bg_image_desktop: string
- bg_image_mobile: string
+ bg_image: string
}
-
const ParentWrapper = styled(Flex)`
width: 100%;
- background-image: url(${(props) => props.bg_image_desktop});
+ background-image: url(${({ bg_image }) => bg_image});
background-position: center;
background-size: cover;
-
- @media ${device.tabletL} {
- background-image: url(${(props) => props.bg_image_mobile});
- }
`
const ContentWrapper = styled(Flex)`
height: auto;
@@ -39,7 +23,6 @@ const ContentWrapper = styled(Flex)`
margin: 180px 0 145px;
}
`
-
const MobileHeader = styled.h1`
color: var(--color-white);
text-align: center;
@@ -58,7 +41,6 @@ const MobileHeader = styled.h1`
line-height: 1.25;
}
`
-
const DesktopHeader = styled.h1`
color: white;
font-weight: bold;
@@ -73,48 +55,57 @@ const DesktopHeader = styled.h1`
font-size: 140px;
}
`
-
const StyledFlex = styled(Flex)`
min-height: 400px;
position: relative;
`
-
-const StyledQueryImage = styled(QueryImage)`
+const StyledImage = styled.img`
max-width: 591px;
z-index: 2;
position: absolute;
`
-const StyledMobileQueryImage = styled(QueryImage)`
+const StyledMobileImage = styled.img`
max-width: 445px;
+
+ @media (max-width: 480px) {
+ max-width: 328px;
+ }
+ @media (max-width: 360px) {
+ max-width: 300px;
+ }
`
-const Hero = () => {
- const data = useStaticQuery(query)
- const title =
+
+const Hero = ({ hero }: THero) => {
+ const { is_mobile_or_tablet } = useBreakpoints()
+ const bg_image = is_mobile_or_tablet
+ ? hero?.bg_mobile?.localFile?.publicURL
+ : hero?.bg_desktop?.localFile?.publicURL
return (
-
+
-
- {title}
+
+
+
-
- {title}
+
+
+
diff --git a/src/pages/who-we-are/components/map-pin.tsx b/src/pages/who-we-are/components/_map-pin.tsx
similarity index 79%
rename from src/pages/who-we-are/components/map-pin.tsx
rename to src/pages/who-we-are/components/_map-pin.tsx
index b52f836be4a..018679de976 100644
--- a/src/pages/who-we-are/components/map-pin.tsx
+++ b/src/pages/who-we-are/components/_map-pin.tsx
@@ -1,6 +1,5 @@
import React, { useState } from 'react'
import styled from 'styled-components'
-import { MapPinType } from '../_data'
import { Localize, LocalizedLink } from 'components/localization'
import { Header } from 'components/elements'
import { ReactComponent as Pin } from 'images/svg/who-we-are/pin.svg'
@@ -14,8 +13,8 @@ type PinWrapperProps = {
const PinWrapper = styled.div`
position: absolute;
- top: ${(props) => props.top};
- left: ${(props) => props.left};
+ top: ${({ top }) => top};
+ left: ${({ left }) => left};
-webkit-tap-highlight-color: transparent;
/* stylelint-disable */
-webkit-appearance: none;
@@ -56,7 +55,15 @@ const PinContent = styled(LocalizedLink)<{ anchor?: boolean }>`
}
`
-const MapPin = ({ top, left, title, link }: MapPinType) => {
+// country_city and link_url should be optional due we can't pass left and top properties to strapi
+export type MapPinType = {
+ left: string
+ top: string
+ country_city?: string
+ link_url?: string
+}
+
+const MapPin = ({ top, left, country_city, link_url }: MapPinType) => {
const [is_pin_show, setPinShow] = useState(false)
const onMouseEnter = () => setPinShow(true)
@@ -68,13 +75,13 @@ const MapPin = ({ top, left, title, link }: MapPinType) => {
onMouseLeave={onMouseLeave}
top={top}
left={left}
- to={link}
+ to={link_url}
>
{is_pin_show && (
-
+
)}
@@ -82,4 +89,4 @@ const MapPin = ({ top, left, title, link }: MapPinType) => {
)
}
-export default MapPin
+export default MapPin
\ No newline at end of file
diff --git a/src/pages/who-we-are/components/modal.tsx b/src/pages/who-we-are/components/_modal.tsx
similarity index 60%
rename from src/pages/who-we-are/components/modal.tsx
rename to src/pages/who-we-are/components/_modal.tsx
index 0197ed238dc..44c9e5f1958 100644
--- a/src/pages/who-we-are/components/modal.tsx
+++ b/src/pages/who-we-are/components/_modal.tsx
@@ -1,17 +1,16 @@
import React from 'react'
import styled from 'styled-components'
-import { ModalFlex } from './leaders'
+import { Flex } from 'components/containers'
import { Localize, LocalizedLink } from 'components/localization'
import { Header } from 'components/elements'
import Linkedin from 'images/svg/who-we-are/linkedin.svg'
-import { TString } from 'types/generics'
+import device from 'themes/device'
type ModalPropsType = {
name: string
- position: TString
+ role: string
link?: string
}
-
type StyledLogoType = {
link: string
}
@@ -22,18 +21,39 @@ const StyledLogo = styled.img`
filter: grayscale(100%);
&:hover {
- filter: ${(props) => (props.link ? 'unset' : 'grayscale(100%)')};
+ filter: ${({ link }) => (link ? 'unset' : 'grayscale(100%)')};
+ }
+`
+export const ModalFlex = styled(Flex)`
+ position: absolute;
+ top: 130px;
+ background-color: white;
+ padding: 8px 16px 6px;
+ z-index: 1;
+ border-radius: 5px;
+ box-shadow: rgba(0, 0, 0, 0.35) 0 4px 15px;
+ white-space: pre;
+ width: fit-content;
+
+ @media ${device.tablet} {
+ top: 124px;
+ }
+ @media ${device.tabletS} {
+ top: 108px;
+ }
+ @media ${device.mobileL} {
+ top: 93px;
}
`
-const Modal = ({ name, position, link }: ModalPropsType) => {
+const Modal = ({ name, role, link }: ModalPropsType) => {
return (
{link && (
@@ -44,4 +64,4 @@ const Modal = ({ name, position, link }: ModalPropsType) => {
)
}
-export default Modal
+export default Modal
\ No newline at end of file
diff --git a/src/pages/who-we-are/components/leaders.tsx b/src/pages/who-we-are/components/leaders.tsx
deleted file mode 100644
index e8e4d046c92..00000000000
--- a/src/pages/who-we-are/components/leaders.tsx
+++ /dev/null
@@ -1,257 +0,0 @@
-import React, { MouseEventHandler, useState } from 'react'
-import styled from 'styled-components'
-import { graphql, useStaticQuery } from 'gatsby'
-import type { ImageDataLike } from 'gatsby-plugin-image'
-import Modal from './modal'
-import { Flex } from 'components/containers'
-import { QueryImage, ImageWrapper } from 'components/elements'
-import device from 'themes/device'
-import { useBrowserResize } from 'components/hooks/use-browser-resize'
-import { TString } from 'types/generics'
-import { localize } from 'components/localization'
-
-type MouseEvent = MouseEventHandler &
- ((event: MouseEventHandler) => void)
-
-type LeaderType = {
- name: string
- position: TString
- link: string
- image: ImageDataLike
-}
-
-const query = graphql`
- query {
- derek: file(relativePath: { eq: "who-we-are/derek.jpg" }) {
- ...fadeIn
- }
- edwin: file(relativePath: { eq: "who-we-are/edwin.jpg" }) {
- ...fadeIn
- }
- gary: file(relativePath: { eq: "who-we-are/gary.jpg" }) {
- ...fadeIn
- }
- jennice: file(relativePath: { eq: "who-we-are/jennice.jpg" }) {
- ...fadeIn
- }
- jeya: file(relativePath: { eq: "who-we-are/jeya.jpg" }) {
- ...fadeIn
- }
- jy: file(relativePath: { eq: "who-we-are/jy.jpg" }) {
- ...fadeIn
- }
- joanna: file(relativePath: { eq: "who-we-are/joanna.jpg" }) {
- ...fadeIn
- }
- kaveh: file(relativePath: { eq: "who-we-are/kaveh.jpg" }) {
- ...fadeIn
- }
- louise: file(relativePath: { eq: "who-we-are/louise.jpg" }) {
- ...fadeIn
- }
- rakshit: file(relativePath: { eq: "who-we-are/rakshit.jpg" }) {
- ...fadeIn
- }
- raunak: file(relativePath: { eq: "who-we-are/raunak.jpg" }) {
- ...fadeIn
- }
- seema: file(relativePath: { eq: "who-we-are/seema.jpg" }) {
- ...fadeIn
- }
- shyamala: file(relativePath: { eq: "who-we-are/shyamala.jpg" }) {
- ...fadeIn
- }
- tom: file(relativePath: { eq: "who-we-are/tom.jpg" }) {
- ...fadeIn
- }
- waqas: file(relativePath: { eq: "who-we-are/waqas.jpg" }) {
- ...fadeIn
- }
- }
-`
-
-export const ModalFlex = styled(Flex)`
- position: absolute;
- top: 130px;
- background-color: white;
- padding: 8px 16px 6px;
- z-index: 1;
- border-radius: 5px;
- box-shadow: rgba(0, 0, 0, 0.35) 0 4px 15px;
- white-space: pre;
- width: fit-content;
- @media ${device.tablet} {
- top: 124px;
- }
- @media ${device.tabletS} {
- top: 108px;
- }
- @media ${device.mobileL} {
- top: 93px;
- }
-`
-
-const StyledImageWrapper = styled(ImageWrapper)`
- display: flex;
- flex-direction: column;
- align-items: center;
- position: relative;
- padding-bottom: 20px;
- @media ${device.tabletS} {
- width: 104px;
- height: 114px;
- }
-
- @media ${device.tabletL} {
- &:nth-child(3n-2) {
- ${ModalFlex} {
- left: 0;
- }
- }
- &:nth-child(3n) {
- ${ModalFlex} {
- align-self: right;
- right: 0;
- }
- }
- }
- @media ${device.tabletS} {
- padding-bottom: 10px;
- }
- @media ${device.mobileL} {
- width: 88px;
- height: 98px;
- }
-`
-
-const LeaderCard = ({ image, name, position, link }: LeaderType) => {
- const [is_popup_shown, setIsPopupShown] = useState(false)
- const [is_mobile] = useBrowserResize()
-
- const showModal: MouseEvent = () => setIsPopupShown(true)
- const dontShowModal: MouseEvent = () => setIsPopupShown(false)
-
- return (
-
-
- {is_popup_shown && }
-
- )
-}
-
-const Leaders = () => {
- const leaders_data = useStaticQuery(query)
- const leaders: LeaderType[] = [
- {
- name: 'Jean-Yves Sireau',
- position: '_t_Chief Executive Officer_t_',
- link: 'https://www.linkedin.com/in/jeanyvessireau/',
- image: leaders_data.jy,
- },
- {
- name: 'Rakshit Choudhary ',
- position: '_t_Chief Operating Officer_t_',
- link: 'https://www.linkedin.com/in/rakshit-choudhary-9a67b61b0/',
- image: leaders_data.rakshit,
- },
- {
- name: 'Tom Molesworth',
- position: '_t_Chief Information Officer_t_',
- link: '',
- image: leaders_data.tom,
- },
- {
- name: 'Joanna Frendo',
- position: '_t_Chief Risk & Compliance Officer_t_',
- link: 'https://www.linkedin.com/in/joanna-frendo-4449975/',
- image: leaders_data.joanna,
- },
- {
- name: 'Louise Wolf',
- position: '_t_Chief Financial Officer_t_',
- link: 'https://www.linkedin.com/in/louise-wolf-7b98b460/',
- image: leaders_data.louise,
- },
- {
- name: 'Shyamala Siva',
- position: '_t_Chief Administrative Officer_t_',
- link: 'https://www.linkedin.com/in/shyamala-siva-90043b208/',
- image: leaders_data.shyamala,
- },
- {
- name: 'Seema Hallon',
- position: '_t_Head of People Management_t_',
- link: 'https://www.linkedin.com/in/seema-hallon-6919073/',
- image: leaders_data.seema,
- },
- {
- name: 'Derek Swift',
- position: '_t_Head of Marketing & Global Partnerships_t_',
- link: 'https://www.linkedin.com/in/derek-swift-5787208/',
- image: leaders_data.derek,
- },
- {
- name: 'Waqas Awan',
- position: '_t_Vice President of Product_t_',
- link: 'https://www.linkedin.com/in/waqasawan/',
- image: leaders_data.waqas,
- },
- {
- name: 'Raunak Kathuria',
- position: '_t_Vice President of Engineering_t_',
- link: 'https://www.linkedin.com/in/raunakkathuria/',
- image: leaders_data.raunak,
- },
- {
- name: 'Edwin Raspe',
- position: '_t_Vice President of IT Operations_t_',
- link: 'https://my.linkedin.com/in/edwin-raspe-210a722/',
- image: leaders_data.edwin,
- },
- {
- name: 'Kaveh Mousavi Zamani',
- position: '_t_Vice President of Engineering_t_',
- link: 'https://de.linkedin.com/in/kavehmz/',
- image: leaders_data.kaveh,
- },
- {
- name: 'Jeyavarthini Vairakanan',
- position: '_t_Vice President of Customer Support_t_',
- link: 'https://www.linkedin.com/in/jeyavarthini-vairakanan-812b7a121/',
- image: leaders_data.jeya,
- },
- {
- name: 'Gary Ross Vytialingam',
- position: '_t_Chief Audit Executive_t_',
- link: 'https://www.linkedin.com/in/gary-ross-vytialingam-37a729106/',
- image: leaders_data.gary,
- },
- {
- name: 'Jennice Lourdsamy',
- position: '_t_Head of Accounts_t_',
- link: 'https://www.linkedin.com/in/jennice-lourdsamy-352b897/',
- image: leaders_data.jennice,
- },
- ]
-
- return (
- <>
- {leaders.map((leader: LeaderType) => (
-
- ))}
- >
- )
-}
-
-export default Leaders
diff --git a/src/pages/who-we-are/index.tsx b/src/pages/who-we-are/index.tsx
index 38c64ad051a..60006aee90b 100644
--- a/src/pages/who-we-are/index.tsx
+++ b/src/pages/who-we-are/index.tsx
@@ -1,5 +1,7 @@
import React from 'react'
import styled from 'styled-components'
+import { graphql } from 'gatsby'
+import { TWhoWeAre } from './_types'
import MakeTrading from './_MakeTrading'
import Hero from './components/_hero'
import ImageMarquee from './carousel/_ImageMarquee'
@@ -15,7 +17,6 @@ import device from 'themes/device'
import { SEO } from 'components/containers'
import Layout from 'components/layout/layout'
import { WithIntl } from 'components/localization'
-import { TGatsbyHead } from 'features/types'
const StartSeparator = styled.div`
width: 0;
@@ -37,30 +38,192 @@ const EndSeparator = styled.div`
}
`
-const AboutUs = () => {
+const AboutUs = ({ data }: TWhoWeAre) => {
+ const {
+ hero,
+ our_values,
+ our_principles,
+ our_leadership,
+ deriv_in_numbers,
+ slider_medias,
+ our_locations,
+ banner,
+ } = data?.strapiWhoWeArePage || {}
return (
-
-
+
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
)
}
-export default WithIntl()(AboutUs)
+export const query = graphql`
+ query {
+ strapiWhoWeArePage {
+ hero {
+ header
+ sub_header
+ first_paragraph
+ second_paragraph
+ third_paragraph
+ hero_image {
+ localFile {
+ publicURL
+ }
+ }
+ bg_desktop {
+ localFile {
+ publicURL
+ }
+ }
+ bg_mobile {
+ localFile {
+ publicURL
+ }
+ }
+ }
+ our_values {
+ header
+ values {
+ header
+ sub_header
+ image {
+ localFile {
+ publicURL
+ }
+ }
+ }
+ }
+ our_principles {
+ header
+ principles {
+ header
+ sub_header
+ }
+ button {
+ link_name
+ link_url
+ }
+ }
+ our_leadership {
+ header
+ leaders {
+ name
+ role
+ link_url
+ photo {
+ url
+ localFile {
+ publicURL
+ }
+ }
+ }
+ }
+ deriv_in_numbers {
+ header
+ sub_header
+ numbers {
+ description
+ number
+ }
+ }
+ our_locations {
+ header
+ numbers {
+ description
+ number
+ }
+ locations {
+ country_city
+ link_url
+ }
+ earth {
+ localFile {
+ publicURL
+ }
+ }
+ earth_mobile {
+ localFile {
+ publicURL
+ }
+ }
+ }
+ banner {
+ header
+ sub_header
+ link_name
+ link_url
+ bg_desktop {
+ localFile {
+ publicURL
+ }
+ }
+ bg_desktop_rtl {
+ localFile {
+ url
+ publicURL
+ }
+ }
+ bg_mobile {
+ localFile {
+ url
+ publicURL
+ }
+ }
+ bg_mobile_rtl {
+ localFile {
+ url
+ publicURL
+ }
+ }
+ }
+ slider_medias {
+ slider_1 {
+ localFile {
+ publicURL
+ }
+ }
+ slider_2 {
+ localFile {
+ publicURL
+ }
+ }
+ slider_3 {
+ localFile {
+ publicURL
+ }
+ }
+ slider_4 {
+ localFile {
+ publicURL
+ }
+ }
+ slider_5 {
+ localFile {
+ publicURL
+ }
+ }
+ slider_6 {
+ localFile {
+ publicURL
+ }
+ }
+ }
+ }
+ }
+`
-export const Head = ({ pageContext }: TGatsbyHead) => (
-
-)
+export default WithIntl()(AboutUs)