From 1d344f0654a638df12c3a9e0fd029921a39226d1 Mon Sep 17 00:00:00 2001 From: NikitK-deriv Date: Mon, 23 Jan 2023 14:36:12 +0300 Subject: [PATCH 01/16] feat: branding removal for other domains --- .gitignore | 3 +- src/botPage/view/View.js | 6 ++-- src/common/utils/tools.js | 3 ++ src/indexPage/react-components/logo.jsx | 15 ++++---- templates/bot.mustache | 46 ++++++++++++++++--------- templates/index.mustache | 10 +++++- 6 files changed, 55 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index ce7a9fb20d..d0b8c45095 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ lib/ old/ CNAME *.env -.DS_Store \ No newline at end of file +.DS_Store +.idea \ No newline at end of file diff --git a/src/botPage/view/View.js b/src/botPage/view/View.js index 21382e1e0d..461a5b913a 100644 --- a/src/botPage/view/View.js +++ b/src/botPage/view/View.js @@ -41,7 +41,7 @@ import { getToken, remove, } from '../../common/utils/storageManager'; -import { isProduction, parseQueryString, serialize } from '../../common/utils/tools'; +import { isBinaryDomain, isProduction, parseQueryString, serialize } from '../../common/utils/tools'; import GTM from '../../common/gtm'; import { getMissingBlocksTypes, @@ -196,9 +196,9 @@ const updateLogo = token => { $('.binary-logo-text > img').attr('src', ''); const currentLandingCompany = getLandingCompanyForToken(token); if (currentLandingCompany === 'maltainvest') { - $('.binary-logo-text > img').attr('src', './image/binary-type-logo.svg'); + $('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-type-logo.svg'}`); } else { - $('.binary-logo-text > img').attr('src', './image/binary-style/logo/type.svg'); + $('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-style/logo/type.svg'}`); } setTimeout(() => window.dispatchEvent(new Event('resize'))); }; diff --git a/src/common/utils/tools.js b/src/common/utils/tools.js index 3c2566d88c..482581dada 100644 --- a/src/common/utils/tools.js +++ b/src/common/utils/tools.js @@ -147,3 +147,6 @@ export const errLogger = (err, msg) => { const errMsg = `${msg} - Error: ${errStr}`; console.warn(errMsg); }; + +export const isBinaryDomain = + document.location.hostname !== 'localhost' && document.location.hostname !== 'bot.binary.com'; diff --git a/src/indexPage/react-components/logo.jsx b/src/indexPage/react-components/logo.jsx index 25d9d91e0e..f545a9f53e 100644 --- a/src/indexPage/react-components/logo.jsx +++ b/src/indexPage/react-components/logo.jsx @@ -1,16 +1,17 @@ import React from 'react'; -import { createUrl } from '../../common/utils/tools'; +import {createUrl, isBinaryDomain} from '../../common/utils/tools'; -const Logo = () => ( - -); + ) + } return <> +}; export default Logo; \ No newline at end of file diff --git a/templates/bot.mustache b/templates/bot.mustache index 375f9b6394..51283bc044 100644 --- a/templates/bot.mustache +++ b/templates/bot.mustache @@ -9,8 +9,14 @@ {{> bot_css }} + + - - + - - - + + + - +
- + - +
- +
- +