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

aaron/Add DBot banner to Binary Bot #2257

Merged
merged 12 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Verberg elementen voor EU gebruikers
  • Loading branch information
aaimio committed Apr 28, 2020
commit 81b87d6e159cc5de42ad787dbe3377c28c288dd4
6 changes: 5 additions & 1 deletion src/botPage/view/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
addTokenIfValid,
} from '../../common/appId';
import { translate } from '../../common/i18n';
import isEuCountry, { showHideEuElements } from '../../common/footer-checks';
import googleDrive from '../../common/integrations/GoogleDrive';
import { getLanguage } from '../../common/lang';
import { observer as globalObserver } from '../../common/utils/observer';
Expand Down Expand Up @@ -212,7 +213,9 @@ const updateTokenList = () => {
$('.account-type').text(`${prefix}`);
} else {
$('.login-id-list').append(
`<a href="#" value="${tokenInfo.token}"><li><span>${prefix}</span><div>${tokenInfo.accountName}</div></li></a><div class="separator-line-thin-gray"></div>`
`<a href="#" value="${tokenInfo.token}"><li><span>${prefix}</span><div>${
tokenInfo.accountName
}</div></li></a><div class="separator-line-thin-gray"></div>`
);
}
});
Expand Down Expand Up @@ -724,6 +727,7 @@ function initRealityCheck(stopCallback) {
);
}
function renderReactComponents() {
isEuCountry().then(isEu => showHideEuElements(isEu));
ReactDOM.render(<ServerTime api={api} />, $('#server-time')[0]);
ReactDOM.render(<Tour />, $('#tour')[0]);
ReactDOM.render(
Expand Down
27 changes: 25 additions & 2 deletions src/common/footer-checks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
/* eslint-disable import/prefer-default-export */
import { generateLiveApiInstance } from './appId';

export const showHideEuElements = isEu => {
document.querySelectorAll('.eu-hide').forEach(el => {
if (!isEu && el.classList.contains('invisible')) {
// Keep original display type if invisible was specified.
el.classList.remove('invisible');
} else {
// Default to setting display to block.
el.setAttribute('display', `${!isEu ? 'block' : 'none'} !important`);
}
});
document.querySelectorAll('.eu-show', '.eu-only').forEach(el => {
if (isEu && el.classList.contains('invisible')) {
el.classList.remove('invisible');
} else {
el.setAttribute('display', `${isEu ? 'block' : 'none'} !important`);
}
});
};

export default async function isEuCountry() {
const api = generateLiveApiInstance();
const { website_status: { clients_country: clientsCountry } } = await api.send({ website_status: 1 });
const { landing_company: { financial_company: financialCompany, gaming_company: gamingCompany } } = await api.send({
const {
website_status: { clients_country: clientsCountry },
} = await api.send({ website_status: 1 });
const {
landing_company: { financial_company: financialCompany, gaming_company: gamingCompany },
} = await api.send({
landing_company: clientsCountry,
});

Expand Down
6 changes: 1 addition & 5 deletions src/indexPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ import Logo from './react-components/logo.jsx';
import Footer from './react-components/footer.jsx';
import { oauthLogin } from '../common/appId';
import '../common/binary-ui/dropdown';
import isEuCountry from '../common/footer-checks';
import isEuCountry, { showHideEuElements } from '../common/footer-checks';
import GTM from '../common/gtm';
import { load as loadLang } from '../common/lang';
import { getTokenList } from '../common/utils/storageManager';
import { createUrl } from '../common/utils/tools';

const renderElements = () => {
const showHideEuElements = isEu => {
$('.eu-hide').attr('style', `display: ${isEu ? 'none' : 'block'} !important`);
$('.eu-show, .eu-only').attr('style', `display: ${isEu ? 'block' : 'none'} !important`);
};
ReactDOM.render(<Logo />, document.getElementById('binary-logo'));
ReactDOM.render(<Footer />, document.getElementById('footer'));
isEuCountry().then(isEu => {
Expand Down
4 changes: 2 additions & 2 deletions static/css/_dbot-banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@
}
}

@media only screen and (max-width: 600px) {
@media only screen and (max-width: 520px) {
.dbot-banner {
display: none;
}
}

@media only screen and (max-width: 769px) {
@media only screen and (max-width: 700px) {
.dbot-banner {
&__separator {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/dbot-banner.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="dbot-banner">
<div class="dbot-banner eu-hide invisible">
<div class="dbot-banner__separator"></div>
<div class="dbot-banner__icon">
<a href="https://deriv.com/interim/deriv/?utm_source=binary-bot&utm_medium=referral&utm_campaign=deriv-launch" target="_blank">
Expand Down
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