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

Commit 0c8a48a

Browse files
Mitra/add new banner for the sign up (#7295)
* feat: ✨ add new banner for the sign up * fix: 💄 fix stylelint errors * feat: ✨ add button cta * feat: ✨ redirect sign up buttons to landing page * feat: ✨ add query param to landing link * feat: ✨ binary to deriv landing page changes * feat: ✨ redirect to landing page from payment agent tnc links * fix: 🐛 fix styles issues and remove flag * fix: 🐛 fix button onclick * fix: 🐛 open in same tab * fix: 🐛 open link in same tab Co-authored-by: Habib Deriv <88178645+habib-deriv@users.noreply.github.com>
1 parent af5bb65 commit 0c8a48a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+444
-282
lines changed
195 KB
Loading

src/images/deriv/deriv-signup.png

417 KB
Loading
-31.5 KB
Loading

src/javascript/app/base/binary_loader.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const GTM = require('../../_common/base/gtm');
2020
const LiveChat = require('../../_common/base/livechat');
2121
const Login = require('../../_common/base/login');
2222
const toTitleCase = require('../../_common/string_util').toTitleCase;
23+
const getLanguage = require('../../_common/language').get;
2324

2425
const BinaryLoader = (() => {
2526
let container;
@@ -109,10 +110,12 @@ const BinaryLoader = (() => {
109110
if (active_script) {
110111
BinarySocket.setOnReconnect(active_script.onReconnect);
111112
}
113+
114+
changeAllBinarySignupLinkToDeriv();
112115
};
113116

114117
const error_messages = {
115-
login : () => localize('Please [_1]log in[_2] or [_3]sign up[_4] to view this page.', [`<a href="${'javascript:;'}">`, '</a>', `<a href="${urlFor('new-account')}">`, '</a>']),
118+
login : () => localize('Please [_1]log in[_2] or [_3]sign up[_4] to view this page.', [`<a href="${'javascript:;'}">`, '</a>', `<a class="binary-to-deriv-link" href="${urlFor('new-account')}">`, '</a>']),
116119
only_virtual : () => localize('This feature is available to demo accounts only.'),
117120
only_real : () => localize('You are using a demo account. Please switch to a real account or create one to access Cashier.'),
118121
not_authenticated : () => localize('This page is only available to logged out clients.'),
@@ -149,6 +152,8 @@ const BinaryLoader = (() => {
149152
} else {
150153
loadActiveScript(config);
151154
}
155+
156+
changeAllBinarySignupLinkToDeriv();
152157
});
153158
}
154159
} else if (config.not_authenticated && Client.isLoggedIn()) {
@@ -169,6 +174,8 @@ const BinaryLoader = (() => {
169174
} else {
170175
displayMessage(error_messages.no_mf());
171176
}
177+
178+
changeAllBinarySignupLinkToDeriv();
172179
});
173180
}
174181

@@ -178,6 +185,8 @@ const BinaryLoader = (() => {
178185
displayMessage(error_messages.no_options_mf_mx());
179186
}
180187
});
188+
189+
changeAllBinarySignupLinkToDeriv();
181190
}
182191

183192
if (this_page === 'deactivated-account' && Client.isLoggedIn()) {
@@ -194,6 +203,8 @@ const BinaryLoader = (() => {
194203
displayMessage(error_messages.options_blocked());
195204
}
196205
}
206+
207+
changeAllBinarySignupLinkToDeriv();
197208
});
198209
// TODO: temporary condition; remove once BE Apple social signup is ready
199210
BinarySocket.wait('get_account_status').then((response) => {
@@ -294,4 +305,14 @@ const BinaryLoader = (() => {
294305
};
295306
})();
296307

308+
const changeAllBinarySignupLinkToDeriv = () => {
309+
const language = getLanguage().toLowerCase().replace(/_/g, '-');
310+
const elements = document.getElementsByClassName('binary-to-deriv-link') || [];
311+
312+
for (let i = 0; i < elements.length; i++) {
313+
elements.item(i).removeAttribute('href');
314+
elements.item(i).addEventListener('click', () => window.location.href = `/binary-to-deriv/?l=${language}&source=binary`);
315+
}
316+
};
317+
297318
module.exports = BinaryLoader;

src/javascript/static/pages/home.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const RedirectBanner = require('../../app/common/redirect_banner');
1212
const FormManager = require('../../app/common/form_manager');
1313
const getFormRequest = require('../../app/common/verify_email');
1414
const isBinaryApp = require('../../config').isBinaryApp;
15+
const getElementById = require('../../_common/common_functions').getElementById;
16+
const getLanguage = require('../../_common/language').get;
1517

1618
const Home = (() => {
1719
let clients_country;
@@ -35,6 +37,13 @@ const Home = (() => {
3537
fnc_additional_check: checkCountry,
3638
});
3739
});
40+
41+
const language = getLanguage().toLowerCase().replace(/_/g, '-');
42+
const explore_deriv_btn = getElementById('explore-deriv');
43+
const create_a_demo_account_btn = getElementById('create-a-demo-account');
44+
45+
explore_deriv_btn.addEventListener('click', () => window.open(`https://deriv.com/${language}/`,'_self'));
46+
create_a_demo_account_btn.addEventListener('click', () => window.open(`https://deriv.com/${language}/signup/`,'_self'));
3847
};
3948

4049
const checkCountry = (req) => {

src/root_files/_common/binary-to-deriv/bot.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<meta name="referrer" content="origin">
3232
<title>Binary Bot</title>
3333
<link href="css/bundle-bfd9aa3ef3.css" rel="stylesheet" /> <link rel="stylesheet" href="css/binary.css">
34-
<link href="css/bot-a2172c47a0.css" rel="stylesheet" /></head>
34+
<link href="css/bot-3073ff0f47.css" rel="stylesheet" /></head>
3535

3636
<body>
3737
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
@@ -270,7 +270,7 @@ <h1 data-i18n-text="Reality Check"></h1>
270270
<source src="sound/i-am-being-serious.ogg" type="audio/ogg" />
271271
<source src="sound/i-am-being-serious.mp3" type="audio/mp3" />
272272
</audio>
273-
<script src="js/bundle-ca910a23e2.js"></script><script src="js/bot-9b91d533a3.min.js"></script> <div id='elevio-shell' class='invisible'>
273+
<script src="js/bundle-ca910a23e2.js"></script><script src="js/bot-2dab14c3a4.min.js"></script> <div id='elevio-shell' class='invisible'>
274274
<span class='text'></span>
275275
<span class='icon'>
276276
<svg viewBox="0 0 74.2 74.2">

src/root_files/_common/binary-to-deriv/css/bot-0da2d84ce7.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/root_files/_common/binary-to-deriv/css/bot-28c0c07cde.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/root_files/_common/binary-to-deriv/css/bot-2e7c33c013.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/root_files/_common/binary-to-deriv/css/bot-a2172c47a0.css renamed to src/root_files/_common/binary-to-deriv/css/bot-3073ff0f47.css

Lines changed: 98 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)