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

Commit df795d1

Browse files
authored
NikitK/ Amending the Github page for Binary Bot (#3805)
* feat: branding removal for other domains * feat: add behaviour for test links as well * chore: remove useless script and move logic outside the component * fix: make gulp setup as was before * chore: move script logic outside, in .js file * chore: replace camelCase on sneake_case * chore: return camelCase back * chore: move banner back * fix: aligning text * chore: remove banner for mobile * fix: resolve flashing icon issue * chore: trigger vercel * fix: bot page inst show * fix: bot page not shows * fix: bot page not shows * fix: bot page not shows
1 parent d1ff417 commit df795d1

File tree

10 files changed

+57
-32
lines changed

10 files changed

+57
-32
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ lib/
1212
old/
1313
CNAME
1414
*.env
15-
.DS_Store
15+
.DS_Store
16+
.idea

gulpfile.babel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ gulp.task(
7575
})
7676
);
7777

78-
gulp.task('test-deploy', gulp.series('build-min', 'serve', () => {}));
78+
gulp.task(
79+
'test-deploy',
80+
gulp.series('build-min', 'serve', () => {})
81+
);
7982

8083
gulp.task(
8184
'watch-static',

src/botPage/view/View.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import {
4141
getToken,
4242
remove,
4343
} from '../../common/utils/storageManager';
44-
import { isProduction, parseQueryString, serialize } from '../../common/utils/tools';
44+
import { isBinaryDomain, isProduction, parseQueryString, serialize } from '../../common/utils/tools';
4545
import GTM from '../../common/gtm';
4646
import {
4747
getMissingBlocksTypes,
@@ -196,9 +196,9 @@ const updateLogo = token => {
196196
$('.binary-logo-text > img').attr('src', '');
197197
const currentLandingCompany = getLandingCompanyForToken(token);
198198
if (currentLandingCompany === 'maltainvest') {
199-
$('.binary-logo-text > img').attr('src', './image/binary-type-logo.svg');
199+
$('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-type-logo.svg'}`);
200200
} else {
201-
$('.binary-logo-text > img').attr('src', './image/binary-style/logo/type.svg');
201+
$('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-style/logo/type.svg'}`);
202202
}
203203
setTimeout(() => window.dispatchEvent(new Event('resize')));
204204
};

src/botPage/view/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import View from './View';
55
import '../../common/binary-ui/dropdown';
66
import Elevio from '../../common/elevio';
77
import GTM from '../../common/gtm';
8-
import { isProduction } from '../../common/utils/tools';
8+
import { isBinaryDomain, isProduction } from '../../common/utils/tools';
99

1010
$.ajaxSetup({
1111
cache: false,
@@ -40,3 +40,10 @@ view.initPromise.then(() => {
4040
});
4141
}
4242
});
43+
44+
if (!isBinaryDomain) {
45+
// eslint-disable-next-line no-unused-expressions
46+
document.getElementsByClassName('dbot-banner__separator')[0]?.remove();
47+
// eslint-disable-next-line no-unused-expressions
48+
document.getElementById('logo')?.remove();
49+
}

src/common/utils/tools.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ export const errLogger = (err, msg) => {
147147
const errMsg = `${msg} - Error: ${errStr}`;
148148
console.warn(errMsg);
149149
};
150+
151+
export const isBinaryDomain =
152+
document.location.hostname === 'localhost' ||
153+
document.location.hostname === 'bot.binary.com' ||
154+
document.location.hostname.includes('binary-bot-git-fork');

src/indexPage/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import GTM from '../common/gtm';
99
import { load as loadLang, showBanner } from '../common/lang';
1010
import { moveToDeriv } from '../common/utils/utility';
1111
import { get as getStorage, set as setStorage, remove, getTokenList } from '../common/utils/storageManager';
12-
import { createUrl, parseQueryString, serialize } from '../common/utils/tools';
12+
import { createUrl, isBinaryDomain, parseQueryString, serialize } from '../common/utils/tools';
1313
import '../common/binary-ui/dropdown';
1414
import BotLanding from './react-components/bot-landing';
1515
import BinaryLanding from './react-components/binary-landing';
@@ -111,7 +111,7 @@ const renderElements = () => {
111111
return false;
112112
}
113113
if (window.location.pathname.indexOf('/bot') === -1) {
114-
render(<Logo />, document.getElementById('binary-logo'));
114+
render(isBinaryDomain && <Logo />, document.getElementById('binary-logo'));
115115
render(<Footer />, document.getElementById('footer'));
116116
isEuCountry().then(isEu => showHideEuElements(isEu));
117117
showBanner();
@@ -157,3 +157,12 @@ const loginCheck = () => {
157157
};
158158

159159
loginCheck();
160+
161+
if (!isBinaryDomain) {
162+
// eslint-disable-next-line no-unused-expressions
163+
document.getElementsByClassName('half-width bottom-image puzzle-logo')[0]?.remove();
164+
// eslint-disable-next-line no-unused-expressions
165+
document.getElementsByClassName('dbot-banner__separator')[0]?.remove();
166+
// eslint-disable-next-line no-unused-expressions
167+
document.getElementsByClassName('half-width top-image')[0]?.remove();
168+
}

src/indexPage/react-components/logo.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
2-
import { createUrl } from '../../common/utils/tools';
2+
import {createUrl} from '../../common/utils/tools';
33

44
const Logo = () => (
5-
<a href={createUrl({ path: '', isNonBotPage: true })} target="blank" id="logo">
5+
<a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
66
<div className="logo-parent">
77
<div className="logo">
8-
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo" />
8+
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo"/>
99
</div>
1010
<div className="binary-logo-text">
11-
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo" />
11+
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo"/>
1212
</div>
1313
</div>
1414
</a>

static/css/index.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ul.bullet {
7272
text-align: center;
7373
}
7474
.half-width {
75-
width: 50%;
75+
width: 100%;
7676
float: left;
7777
}
7878
.clear {
@@ -96,7 +96,7 @@ ul.bullet {
9696
z-index: 101;
9797
}
9898

99-
/* Keep this below since css after this
99+
/* Keep this below since css after this
100100
* will be interfering with small
101101
* screen sizes
102102
*/
@@ -123,7 +123,7 @@ ul.bullet {
123123
width: 100%;
124124
}
125125
.half-width p, .half-width img {
126-
margin: 1em;
126+
margin: 1em;
127127
}
128128
.bottom-image {
129129
display: none;

templates/bot.mustache

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</head>
1111

1212
<body>
13-
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
13+
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
1414
<div id="tour"></div>
1515
<div id="center"></div>
1616
<div id="workspace_center"></div>
@@ -114,11 +114,11 @@
114114
<button id="login" data-i18n-text="Log in" />
115115
</div>
116116
</div>
117-
117+
118118
</div>
119-
120-
121-
119+
120+
121+
122122
<div id="toolbox" class="actions_menu show-on-load hidden">
123123
<button data-i18n-title="Reset the blocks to their initial state" id="resetButton"
124124
class="toolbox-button icon-reset"></button>
@@ -127,31 +127,31 @@
127127
class="toolbox-button icon-save"></button>
128128
<button data-i18n-title="Connect Binary Bot to your Google Drive to easily save and re-use your blocks"
129129
id="integrations" class="toolbox-button icon-integrations invisible"></button>
130-
130+
131131
<span class="toolbox-separator"></span>
132132
<button data-i18n-title="Undo the changes (Ctrl+Z)" id="undo" class="toolbox-button icon-undo"></button>
133133
<button data-i18n-title="Redo the changes (Ctrl+Shift+Z)" id="redo" class="toolbox-button icon-redo"></button>
134-
134+
135135
<span class="toolbox-separator"></span>
136136
<button data-i18n-title="Zoom In (Ctrl + +)" id="zoomIn" class="toolbox-button icon-zoom-in"></button>
137137
<button data-i18n-title="Zoom Out (Ctrl + -)" id="zoomOut" class="toolbox-button icon-zoom-out"></button>
138138
<button data-i18n-title="Rearrange Vertically" id="rearrange" class="toolbox-button icon-sort"></button>
139-
139+
140140
<span class="toolbox-separator"></span>
141141
<button data-i18n-title="Show/hide the summary pop-up" id="showSummary"
142142
class="toolbox-button icon-summary"></button>
143143
<button data-i18n-title="Run the bot" id="runButton" class="toolbox-button icon-run"></button>
144144
<button data-i18n-title="Stop the bot" id="stopButton" class="toolbox-button icon-stop"></button>
145145
<button data-i18n-title="Show log" id="logButton" class="toolbox-button icon-info"></button>
146-
146+
147147
<span class="toolbox-separator"></span>
148148
<button data-i18n-title="Show chart" id="chartButton" class="toolbox-button icon-chart-line"></button>
149149
<button data-i18n-title="Show Trading View" id="tradingViewButton"
150150
class="toolbox-button icon-trading-view"></button>
151-
151+
152152
<span class="toolbox-separator"></span>
153153
<button data-i18n-title="Toggle header" id="toggleHeaderButton" class="toolbox-button icon-hide-header"></button>
154-
154+
155155
{{! Toolbox main account + list }}
156156
<div id="toolbox-account" class="right-header" style="display: none">
157157
<button id="toolbox-login" data-i18n-text="Log in"></button>
@@ -166,11 +166,11 @@
166166
</a>
167167
</div>
168168
</div>
169-
169+
170170
</div>
171171
<div id="errorArea"></div>
172172
<div id="notification-banner"></div>
173-
173+
174174
<ul id="toolbox-all-accounts" class="nav-menu main-nav" style="display: none;">
175175
<li>
176176
<ul>
@@ -181,11 +181,11 @@
181181
</ul>
182182
</li>
183183
</ul>
184-
184+
185185
<div id="blocklyArea"></div>
186-
186+
187187
<div id="blocklyDiv" style="position: absolute;"></div>
188-
188+
189189
<form id="fileUploadForm" style="display: none;">
190190
<input data-i18n-title="Open an already saved XML file and retrieve its blocks" type="file" id="files" accept=".xml"
191191
multiple />

templates/index.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</div>
2727
<div id="movetoderiv"></div>
2828
<div id="bot-landing"></div>
29-
29+
3030
<div id="header">
3131
<div class="wrapper">
3232
<div class="logo-wrapper">

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