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

Commit a292f0f

Browse files
author
bahar
committed
update_dbot_banner_for_binary_bot
1 parent b1fdb3b commit a292f0f

File tree

6 files changed

+32
-12
lines changed

6 files changed

+32
-12
lines changed

src/botPage/view/View.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
import { translate } from '../../common/i18n';
3131
import { isEuCountry, showHideEuElements, hasEuAccount } from '../../common/footer-checks';
3232
import googleDrive from '../../common/integrations/GoogleDrive';
33-
import { getLanguage } from '../../common/lang';
33+
import { getLanguage, showRelatedBanner } from '../../common/lang';
3434
import { observer as globalObserver } from '../../common/utils/observer';
3535
import {
3636
getTokenList,
@@ -188,6 +188,7 @@ const updateTokenList = () => {
188188

189189
// If logged out, determine EU based on IP.
190190
isEuCountry(api).then(isEu => showHideEuElements(isEu));
191+
showRelatedBanner();
191192

192193
$('.account-id')
193194
.removeAttr('value')
@@ -202,6 +203,7 @@ const updateTokenList = () => {
202203

203204
const activeToken = getActiveToken(tokenList, getStorage(AppConstants.STORAGE_ACTIVE_TOKEN));
204205
showHideEuElements(hasEuAccount(tokenList));
206+
showRelatedBanner();
205207
updateLogo(activeToken.token);
206208
addBalanceForToken(activeToken.token);
207209

src/common/lang.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,16 @@ export const load = () => {
5050

5151
addUiLang();
5252
};
53+
54+
export const showRelatedBanner = () => {
55+
if (getLanguage() === 'pt') {
56+
document.querySelectorAll(`.${getLanguage()}-show`).forEach(el => {
57+
el.classList.remove('invisible');
58+
});
59+
// TODO: Whenever banners for all languages were added remove else part of the condition.
60+
} else {
61+
document.querySelectorAll('.any-show').forEach(el => {
62+
el.classList.remove('invisible');
63+
});
64+
}
65+
};

src/indexPage/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ import Footer from './react-components/footer.jsx';
66
import { oauthLogin } from '../common/appId';
77
import { isEuCountry, showHideEuElements } from '../common/footer-checks';
88
import GTM from '../common/gtm';
9-
import { load as loadLang } from '../common/lang';
9+
import { load as loadLang , showRelatedBanner } from '../common/lang';
1010
import { getTokenList } from '../common/utils/storageManager';
1111
import { createUrl } from '../common/utils/tools';
1212
import '../common/binary-ui/dropdown';
1313

14+
1415
const renderElements = () => {
1516
ReactDOM.render(<Logo />, document.getElementById('binary-logo'));
1617
ReactDOM.render(<Footer />, document.getElementById('footer'));
1718
isEuCountry().then(isEu => showHideEuElements(isEu));
19+
showRelatedBanner();
1820
$('#shop-url').attr('href', createUrl({ subdomain: 'shop', path: 'collections/strategies', isNonBotPage: true }));
1921
};
2022

static/image/pt-web-banner.svg

Lines changed: 1 addition & 0 deletions
Loading

static/image/web-banner.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<div class="dbot-banner eu-hide invisible">
22
<div class="dbot-banner__separator"></div>
3-
<div class="dbot-banner__icon">
3+
<!--
4+
TODO: Whenever banners for all languages were added replace "any-show" with "en-show" and add the related language section.
5+
-->
6+
<div class="dbot-banner__icon any-show invisible">
47
<a href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
5-
<img src="./image/d-bot.svg">
8+
<img src="./image/web-banner.svg">
69
</a>
710
</div>
8-
<div class="dbot-banner__ad">
9-
<a href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
10-
<div class="dbot-banner__ad-text" data-i18n-text="Binary Bot is"></div>
11-
<div class="dbot-banner__ad-text" data-i18n-text="becoming DBot"></div>
12-
</a>
13-
</div>
14-
<a class="dbot-banner__button" href="https://deriv.com/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank" data-i18n-text="Learn more"></a>
15-
</div>
11+
<div class="dbot-banner__icon pt-show invisible">
12+
<a href="https://deriv.com/pt/interim/dbot/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
13+
<img src="./image/pt-web-banner.svg">
14+
</a>
15+
</div>
16+
</div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy