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

NikitK/ Amending the Github page for Binary Bot #3805

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
chore: remove useless script and move logic outside the component
  • Loading branch information
NikitK-deriv committed Jan 24, 2023
commit 54ae4e4ec4c0abe34659a6c9e78e83b582dca771
9 changes: 6 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gulp.task(
gulp.series(done => {
connect.server({
root : 'www',
port : 80,
port : 8000,
livereload: true,
});
done();
Expand All @@ -24,7 +24,7 @@ gulp.task(
gulp.series(done => {
gulp.src('www/index.html').pipe(
open({
uri: 'http://localhost:80/',
uri: 'http://localhost:8000/',
})
);
done();
Expand Down Expand Up @@ -75,7 +75,10 @@ gulp.task(
})
);

gulp.task('test-deploy', gulp.series('build-min', 'serve', () => {}));
gulp.task(
'test-deploy',
gulp.series('build-min', 'serve', () => {})
);

gulp.task(
'watch-static',
Expand Down
9 changes: 4 additions & 5 deletions src/common/utils/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ export const errLogger = (err, msg) => {
console.warn(errMsg);
};

export const isBinaryDomain = !(
document.location.hostname !== 'localhost' &&
document.location.hostname !== 'bot.binary.com' &&
!document.location.hostname.includes('binary-bot-git-fork')
);
export const isBinaryDomain =
document.location.hostname === 'localhost' ||
document.location.hostname === 'bot.binary.com' ||
document.location.hostname.includes('binary-bot-git-fork');
4 changes: 2 additions & 2 deletions src/indexPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import GTM from '../common/gtm';
import { load as loadLang, showBanner } from '../common/lang';
import { moveToDeriv } from '../common/utils/utility';
import { get as getStorage, set as setStorage, remove, getTokenList } from '../common/utils/storageManager';
import { createUrl, parseQueryString, serialize } from '../common/utils/tools';
import { createUrl, isBinaryDomain, parseQueryString, serialize } from '../common/utils/tools';
import '../common/binary-ui/dropdown';
import BotLanding from './react-components/bot-landing';
import BinaryLanding from './react-components/binary-landing';
Expand Down Expand Up @@ -111,7 +111,7 @@ const renderElements = () => {
return false;
}
if (window.location.pathname.indexOf('/bot') === -1) {
render(<Logo />, document.getElementById('binary-logo'));
render(isBinaryDomain && <Logo />, document.getElementById('binary-logo'));
render(<Footer />, document.getElementById('footer'));
isEuCountry().then(isEu => showHideEuElements(isEu));
showBanner();
Expand Down
11 changes: 5 additions & 6 deletions src/indexPage/react-components/logo.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import {createUrl, isBinaryDomain} from '../../common/utils/tools';
import {createUrl} from '../../common/utils/tools';

const Logo = () => {
if(isBinaryDomain) { return ( <a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
const Logo = () => (
<a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
<div className="logo-parent">
<div className="logo">
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo"/>
Expand All @@ -11,7 +11,6 @@ const Logo = () => {
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo"/>
</div>
</div>
</a>)
} return <></>
};
</a>
);
export default Logo;
6 changes: 0 additions & 6 deletions templates/bot.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
{{> bot_css }}
</head>

<script>
const host_name = $(location).attr('hostname');
const isBinaryDomain = host_name !== 'localhos' && host_name !== 'bot.binary.com';
document.getElementById("logo").remove()
</script>

<body>
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
<div id="tour"></div>
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