Skip to content

Commit 3214f86

Browse files
authored
Merge pull request binary-com#3830 from negarn/negar/show_mf_ladders
negar/show_mf_ladders
2 parents c80bc62 + c4be3db commit 3214f86

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

src/javascript/app/base/menu.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
const Client = require('./client');
2+
const BinarySocket = require('./socket');
23
const getElementById = require('../../_common/common_functions').getElementById;
34
const applyToAllElements = require('../../_common/utility').applyToAllElements;
45
const findParent = require('../../_common/utility').findParent;
5-
const State = require('../../_common/storage').State;
6+
const getPropertyValue = require('../../_common/utility').getPropertyValue;
67
require('../../_common/lib/mmenu/jquery.mmenu.min.all.js');
78

89
const Menu = (() => {
@@ -11,9 +12,14 @@ const Menu = (() => {
1112

1213
applyToAllElements('li', (el) => { el.classList.remove('active', 'active-parent'); }, '', menu_top);
1314
if (Client.isLoggedIn()) {
14-
applyToAllElements('.cr-only', (el) => {
15-
const is_upgradable_to_cr = State.getResponse('authorize.upgradeable_landing_companies').indexOf('costarica') !== -1;
16-
el.setVisibility(Client.hasCostaricaAccount() || is_upgradable_to_cr);
15+
BinarySocket.wait('landing_company').then((response) => {
16+
const financial_shortcode = getPropertyValue(response, ['landing_company', 'financial_company', 'shortcode']);
17+
// client is virtual and they are allowed to have a financial account
18+
// or client is real and current account is financial
19+
const has_financial_markets = Client.get('is_virtual') ? !!(financial_shortcode) : Client.get('landing_company_shortcode') === financial_shortcode;
20+
applyToAllElements('.financial-only', (el) => {
21+
el.setVisibility(has_financial_markets);
22+
});
1723
});
1824
}
1925

src/templates/app/_layout/header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const Header = () => (
109109
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
110110
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
111111
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
112-
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
112+
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
113113
],
114114
},
115115
{ text: it.L('Portfolio'), href: it.url_for('user/portfoliows'), className: 'ico-only-hide client_logged_in invisible' },

src/templates/app/_layout/mobile_menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const MobileMenu = () => (
2727
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
2828
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
2929
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
30-
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
30+
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
3131
]}
3232
/>
3333
<Li text={it.L('Portfolio')} href={it.url_for('user/portfoliows')} className='ico-only-hide client_logged_in invisible' />

src/templates/static/_layout/header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const Header = () => (
109109
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
110110
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
111111
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
112-
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
112+
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
113113
],
114114
},
115115
{ text: it.L('Portfolio'), href: it.url_for('user/portfoliows'), className: 'ico-only-hide client_logged_in invisible' },

src/templates/static/_layout/mobile_menu.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const MobileMenu = () => (
2727
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
2828
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
2929
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
30-
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
30+
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
3131
]}
3232
/>
3333
<Li text={it.L('Portfolio')} href={it.url_for('user/portfoliows')} className='ico-only-hide client_logged_in invisible' />

src/templates/static/platforms.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ const Platform = () => (
113113
image_class='gr-10 gr-7-p gr-9-m'
114114
image='trading-multibarrier'
115115
header={it.L('Ladders')}
116-
className='cr-only'
116+
className='financial-only'
117117
description={it.L('Multi-barrier trading')}
118118
text={it.L('Trade FX binary options on our multi-barrier platform, Ladders.')}
119119
url={it.url_for('multi_barriers_trading')}
120120
button_text={it.L('Trade now')}
121121
/>
122-
<div className='gr-2 cr-only' />
122+
<div className='gr-2 financial-only' />
123123
<Platforms
124124
image_class='gr-10 gr-5-p gr-9-m'
125125
image='chart'

0 commit comments

Comments
 (0)