Skip to content

Commit

Permalink
[FE Deriv.com squad] NikitK/ Redirect Binary All Partnership Options…
Browse files Browse the repository at this point in the history
… page to Deriv.com All Partnership Options page (binary-com#7304)

* feat: redirect from binary/partned to deriv/partners

* feat: add more pages to redirect and refactor approach

* feat: add payment agent page as well

Co-authored-by: Habib Deriv <[email protected]>
  • Loading branch information
NikitK-deriv and habib-deriv authored Jan 3, 2023
1 parent 283b473 commit eeb49cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/javascript/app/base/binary_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ const pages_config = {
withdrawws : { module: PaymentAgentWithdraw, is_authenticated: true, only_real: true },

'affiliate-ib' : { module: AffiliatesIBLanding },
'partners' : { module: StaticPages.Partners },
'security-testing' : { module: StaticPages.SecurityTesting },
'binary-in-numbers' : { module: StaticPages.BinaryInNumbers },
'binary-options' : { module: GetStarted.BinaryOptions },
// 'contact-2' : { module: Contact2 },
Expand Down
18 changes: 16 additions & 2 deletions src/javascript/static/pages/static_pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const handleHash = require('../../_common/utility').handleHash;
const BinaryPjax = require('../../app/base/binary_pjax');
const Client = require('../../app/base/client');
const Header = require('../../app/base/header');
const getLanguage = require('../../_common/language.js').get;

const current_language = getLanguage().toLowerCase().replace(/_/g, '-');
const redirectToDeriv = (path = '') => () => {
if (current_language === 'en') {window.location.replace(`https://deriv.com/partners/${path}`);} else {window.location.replace(`https://deriv.com/${current_language}/partners/${path}`);}
};

module.exports = {
OpenPositions: {
Expand All @@ -19,11 +25,19 @@ module.exports = {
onUnload: () => { ImageSlider.onUnMount(); },
},
OpenSourceProjects: {
onLoad : () => { Scroll.sidebarScroll($('.open-source-projects')); },
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
Partners: {
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
SecurityTesting: {
onLoad : redirectToDeriv(),
onUnload: () => { Scroll.offScroll(); },
},
PaymentAgent: {
onLoad : () => { Scroll.sidebarScroll($('.payment-agent')); },
onLoad : redirectToDeriv('payment-agent'),
onUnload: () => { Scroll.offScroll(); },
},
handleTab: {
Expand Down

0 comments on commit eeb49cf

Please sign in to comment.