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

Commit 54ae4e4

Browse files
committed
chore: remove useless script and move logic outside the component
1 parent 6a796a7 commit 54ae4e4

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

gulpfile.babel.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gulp.task(
1212
gulp.series(done => {
1313
connect.server({
1414
root : 'www',
15-
port : 80,
15+
port : 8000,
1616
livereload: true,
1717
});
1818
done();
@@ -24,7 +24,7 @@ gulp.task(
2424
gulp.series(done => {
2525
gulp.src('www/index.html').pipe(
2626
open({
27-
uri: 'http://localhost:80/',
27+
uri: 'http://localhost:8000/',
2828
})
2929
);
3030
done();
@@ -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/common/utils/tools.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ export const errLogger = (err, msg) => {
148148
console.warn(errMsg);
149149
};
150150

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')
155-
);
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: 2 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();
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
2-
import {createUrl, isBinaryDomain} from '../../common/utils/tools';
2+
import {createUrl} from '../../common/utils/tools';
33

4-
const Logo = () => {
5-
if(isBinaryDomain) { return ( <a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
4+
const Logo = () => (
5+
<a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
66
<div className="logo-parent">
77
<div className="logo">
88
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo"/>
@@ -11,7 +11,6 @@ const Logo = () => {
1111
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo"/>
1212
</div>
1313
</div>
14-
</a>)
15-
} return <></>
16-
};
14+
</a>
15+
);
1716
export default Logo;

templates/bot.mustache

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
{{> bot_css }}
1010
</head>
1111

12-
<script>
13-
const host_name = $(location).attr('hostname');
14-
const isBinaryDomain = host_name !== 'localhos' && host_name !== 'bot.binary.com';
15-
document.getElementById("logo").remove()
16-
</script>
17-
1812
<body>
1913
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
2014
<div id="tour"></div>

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