Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/javascript/app/base/menu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const Client = require('./client');
const BinarySocket = require('./socket');
const getElementById = require('../../_common/common_functions').getElementById;
const applyToAllElements = require('../../_common/utility').applyToAllElements;
const findParent = require('../../_common/utility').findParent;
const State = require('../../_common/storage').State;
const getPropertyValue = require('../../_common/utility').getPropertyValue;
require('../../_common/lib/mmenu/jquery.mmenu.min.all.js');

const Menu = (() => {
Expand All @@ -11,9 +12,14 @@ const Menu = (() => {

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

Expand Down
2 changes: 1 addition & 1 deletion src/templates/app/_layout/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Header = () => (
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
],
},
{ text: it.L('Portfolio'), href: it.url_for('user/portfoliows'), className: 'ico-only-hide client_logged_in invisible' },
Expand Down
2 changes: 1 addition & 1 deletion src/templates/app/_layout/mobile_menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MobileMenu = () => (
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
]}
/>
<Li text={it.L('Portfolio')} href={it.url_for('user/portfoliows')} className='ico-only-hide client_logged_in invisible' />
Expand Down
2 changes: 1 addition & 1 deletion src/templates/static/_layout/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const Header = () => (
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
],
},
{ text: it.L('Portfolio'), href: it.url_for('user/portfoliows'), className: 'ico-only-hide client_logged_in invisible' },
Expand Down
2 changes: 1 addition & 1 deletion src/templates/static/_layout/mobile_menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MobileMenu = () => (
{ text: it.L('WebTrader'), href: 'https://webtrader.binary.com', target: '_blank' },
{ text: it.L('Binary Bot'), href: 'https://bot.binary.com', target: '_blank' },
{ text: it.L('MetaTrader 5'), href: it.url_for('user/metatrader') },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'cr-only' },
{ text: it.L('Ladders'), href: it.url_for('multi_barriers_trading'), className: 'financial-only' },
]}
/>
<Li text={it.L('Portfolio')} href={it.url_for('user/portfoliows')} className='ico-only-hide client_logged_in invisible' />
Expand Down
4 changes: 2 additions & 2 deletions src/templates/static/platforms.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ const Platform = () => (
image_class='gr-10 gr-7-p gr-9-m'
image='trading-multibarrier'
header={it.L('Ladders')}
className='cr-only'
className='financial-only'
description={it.L('Multi-barrier trading')}
text={it.L('Trade FX binary options on our multi-barrier platform, Ladders.')}
url={it.url_for('multi_barriers_trading')}
button_text={it.L('Trade now')}
/>
<div className='gr-2 cr-only' />
<div className='gr-2 financial-only' />
<Platforms
image_class='gr-10 gr-5-p gr-9-m'
image='chart'
Expand Down