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

Commit 92b49a2

Browse files
committed
fix: add language redirection and fix the glitch
1 parent 39285c1 commit 92b49a2

File tree

7 files changed

+49
-23
lines changed

7 files changed

+49
-23
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/lang.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ export const showBanner = async () => {
8888
});
8989
}
9090
};
91+
92+
export const getLanguageBase = url => {
93+
const lang = getLanguage();
94+
console.log(url + lang, 'language');
95+
return url + lang;
96+
};

src/indexPage/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const checkifBotRunning = () => {
3737
let Component, dynamicRoutePathanme;
3838
export const getComponent = () => {
3939
Component = <BinaryLanding />;
40-
dynamicRoutePathanme = 'bot-landing';
40+
dynamicRoutePathanme = 'movetoderiv';
4141
return {
4242
Component,
4343
dynamicRoutePathanme,
@@ -101,7 +101,11 @@ const renderElements = () => {
101101
showBanner();
102102
$('#shop-url').attr(
103103
'href',
104-
createUrl({ subdomain: 'shop', path: 'collections/strategies', isNonBotPage: true })
104+
createUrl({
105+
subdomain : 'shop',
106+
path : 'collections/strategies',
107+
isNonBotPage: true,
108+
})
105109
);
106110
elements.map(elem => document.querySelector(elem).classList.remove('hidden'));
107111
document.getElementById(dynamicRoutePathanme).classList.add('hidden');

src/indexPage/react-components/binary-landing/Hero.jsx

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import React from 'react'
1+
import React from 'react';
22
import Slider from 'react-slick';
33
import { translate } from '../../../common/i18n';
4+
import {getLanguageBase } from '../../../common/lang';
45

56
const carouselImages = [
67
'image/hero-dmt5.png',
78
'image/hero-derivgo.png',
89
'image/hero-derivx.png',
910
'image/hero-dtrader.png',
10-
]
11+
];
12+
1113

1214
const carouselSettings = {
1315
dots : false,
@@ -38,34 +40,42 @@ const carouselSettings = {
3840

3941
const Hero = () => {
4042
const renderContent = () => (
41-
<div className='hero-wrapper-container_box-binary hero-wrapper-container-left-binary'>
43+
<div className="hero-wrapper-container_box-binary hero-wrapper-container-left-binary">
4244
<h1>{translate('We’re moving!')}</h1>
4345
<h2>
44-
{translate('We’ve been')}<b>{translate(' Binary.com')}</b>{translate(' for 2 decades and it’s time for an exciting new chapter.')}
46+
{translate('We’ve been')}
47+
<b>{translate(' Binary.com')}</b>
48+
{translate(' for 2 decades and it’s time for an exciting new chapter.')}
49+
</h2>
50+
<h2>
51+
{translate('Say hello to our new home,')}
52+
<b>{translate(' Deriv.')}</b>
4553
</h2>
46-
<h2>{translate('Say hello to our new home,')}<b>{translate(' Deriv.')}</b></h2>
4754
<div className="btn-group">
48-
<a href="https://deriv.com">
49-
<button className="l-btn primary">{translate('Hello Deriv!')}</button>
55+
<a href={getLanguageBase('https://deriv.com/')}>
56+
<button className="l-btn primary">
57+
{translate('Hello Deriv!')}
58+
</button>
5059
</a>
5160
<a href="https://www.binary.com?binary-bot-lp" id="logo">
5261
<button className="l-btn">{translate('Maybe later')}</button>
5362
</a>
5463
</div>
5564
</div>
56-
)
65+
);
5766

5867
const renderCarousel = () => (
59-
<div className='hero-wrapper-container_box-binary hero-wrapper-container-right-binary'>
68+
<div className="hero-wrapper-container_box-binary hero-wrapper-container-right-binary">
6069
<Slider {...carouselSettings}>
61-
{carouselImages.map((slide, index) => <img key={index} src={slide} />)}
70+
{carouselImages.map((slide, index) => (
71+
<img key={index} src={slide} />
72+
))}
6273
</Slider>
6374
</div>
64-
)
65-
75+
);
6676

6777
return (
68-
<div className='hero-wrapper'>
78+
<div className="hero-wrapper">
6979
<section className="hero-wrapper-container">
7080
{renderContent()}
7181
{renderCarousel()}
@@ -74,7 +84,7 @@ const Hero = () => {
7484
</div>
7585
</section>
7686
</div>
77-
)
87+
);
7888
};
7989

80-
export default Hero
90+
export default Hero;

src/indexPage/react-components/binary-landing/Navigation.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react'
22
import { translate } from '../../../common/i18n';
3+
import {getLanguage} from '../../../common/lang'
34

5+
const lang = getLanguage();
6+
const URL = `https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=${lang}&brand=deriv`;
47

58
const MoveToDerivNav = () => (
69
<div className='navigation'>
@@ -10,7 +13,7 @@ const MoveToDerivNav = () => (
1013
<img src="image/binary.png" />
1114
</a>
1215
</div>
13-
<a href="https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=en&brand=deriv" className="navigation-to-deriv" rel="noopener noreferrer">
16+
<a href={URL} className="navigation-to-deriv" rel="noopener noreferrer">
1417
<button className='btn-group right-btn'>
1518
{translate('Take me to Deriv')}
1619
</button>

templates/index.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
</div>
2727
<div id="movetoderiv"></div>
28-
<div id="bot-landing"></div>
28+
2929

3030
<div id="header">
3131
<div class="wrapper">

templates/movetoderiv.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div id="binary-logo"></div>
2626
<div id="movetoderiv">
2727
</div>
28-
<div id="bot-landing"></div>
28+
2929
<div id="footer"></div>
3030
<div id="notification-banner"></div>
3131
<div id="main">

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