Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit eeb49cf

Browse files
[FE Deriv.com squad] NikitK/ Redirect Binary All Partnership Options page to Deriv.com All Partnership Options page (#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 <88178645+habib-deriv@users.noreply.github.com>
1 parent 283b473 commit eeb49cf

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/javascript/app/base/binary_pages.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ const pages_config = {
146146
withdrawws : { module: PaymentAgentWithdraw, is_authenticated: true, only_real: true },
147147

148148
'affiliate-ib' : { module: AffiliatesIBLanding },
149+
'partners' : { module: StaticPages.Partners },
150+
'security-testing' : { module: StaticPages.SecurityTesting },
149151
'binary-in-numbers' : { module: StaticPages.BinaryInNumbers },
150152
'binary-options' : { module: GetStarted.BinaryOptions },
151153
// 'contact-2' : { module: Contact2 },

src/javascript/static/pages/static_pages.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ const handleHash = require('../../_common/utility').handleHash;
66
const BinaryPjax = require('../../app/base/binary_pjax');
77
const Client = require('../../app/base/client');
88
const Header = require('../../app/base/header');
9+
const getLanguage = require('../../_common/language.js').get;
10+
11+
const current_language = getLanguage().toLowerCase().replace(/_/g, '-');
12+
const redirectToDeriv = (path = '') => () => {
13+
if (current_language === 'en') {window.location.replace(`https://deriv.com/partners/${path}`);} else {window.location.replace(`https://deriv.com/${current_language}/partners/${path}`);}
14+
};
915

1016
module.exports = {
1117
OpenPositions: {
@@ -19,11 +25,19 @@ module.exports = {
1925
onUnload: () => { ImageSlider.onUnMount(); },
2026
},
2127
OpenSourceProjects: {
22-
onLoad : () => { Scroll.sidebarScroll($('.open-source-projects')); },
28+
onLoad : redirectToDeriv(),
29+
onUnload: () => { Scroll.offScroll(); },
30+
},
31+
Partners: {
32+
onLoad : redirectToDeriv(),
33+
onUnload: () => { Scroll.offScroll(); },
34+
},
35+
SecurityTesting: {
36+
onLoad : redirectToDeriv(),
2337
onUnload: () => { Scroll.offScroll(); },
2438
},
2539
PaymentAgent: {
26-
onLoad : () => { Scroll.sidebarScroll($('.payment-agent')); },
40+
onLoad : redirectToDeriv('payment-agent'),
2741
onUnload: () => { Scroll.offScroll(); },
2842
},
2943
handleTab: {

0 commit comments

Comments
 (0)