Skip to content

Commit

Permalink
Revert "yashim/chore: remove all whatsapp (#571)"
Browse files Browse the repository at this point in the history
This reverts commit 1cf02d5.
  • Loading branch information
balakrishna-deriv authored Nov 6, 2023
1 parent 1cf02d5 commit bcbb619
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/javascript/app/base/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ const Header = (() => {
el.src = Url.urlForStatic(`${header_icon_base_path}ic-reports.svg`);
});

applyToAllElements('.whatsapp-icon', (el) => {
el.src = Url.urlForStatic(`${header_icon_base_path}ic-whatsapp.svg`);
});

applyToAllElements('.livechat-icon', (el) => {
el.src = Url.urlForStatic(`${header_icon_base_path}ic-livechat.svg`);
});
Expand Down Expand Up @@ -461,6 +465,10 @@ const Header = (() => {
}
});

// whatsapp mobile menu
const whatsapp_mobile_drawer = getElementById('whatsapp-mobile-drawer');
whatsapp_mobile_drawer.addEventListener('click', () => window.open('https://wa.me/35699578341', '_blank'));

// Livechat Logo
const livechat_img = getElementById('livechat__logo');
livechat_img.src = Url.urlForStatic('images/common/livechat.svg');
Expand Down Expand Up @@ -512,6 +520,10 @@ const Header = (() => {
const topbar_help_center = getElementById('topbar-help-centre');
topbar_help_center.addEventListener('click', () => window.location = `https://www.deriv.${getTopLevelDomain()}/help-centre/`);

// WhatsApp.
const topbar_whatsapp = getElementById('topbar-whatsapp');
topbar_whatsapp.addEventListener('click', () => window.open('https://wa.me/35699578341', '_blank'));

// Topbar fullscreen events.
const topbar_fullscreen = getElementById('topbar-fullscreen');
topbar_fullscreen.addEventListener('click', toggleFullscreen);
Expand Down
2 changes: 1 addition & 1 deletion src/sass/_common/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ body .topbar {
}
}

#livechat {
#livechat, #topbar-whatsapp {
cursor: pointer;
height: inherit;

Expand Down
4 changes: 4 additions & 0 deletions src/templates/_common/_layout/header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ const MobileMenu = () => (
<div className='mobile__platform-switcher-text'>{it.L('Reports')}</div>
<img id='mobile__platform-switcher-icon-arrowright' className='mobile__platform-switcher-icon-right' />
</div>
<div id='whatsapp-mobile-drawer' className='mobile__platform-switcher-item whatsapp'>
<img className='mobile__platform-switcher-icon whatsapp-icon' />
<div className='mobile__platform-switcher-text'>{it.L('WhatsApp')}</div>
</div>
<div id='mobile__menu-livechat' className='mobile__platform-switcher-item'>
<img className='mobile__platform-switcher-icon livechat-icon' />
<div className='mobile__platform-switcher-text'>{it.L('Live chat')}</div>
Expand Down
3 changes: 3 additions & 0 deletions src/templates/_common/_layout/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const Topbar = () => (
</div>
<div id='language-select'><img id='language-select__logo' /></div>
<span className='no-underline nowrap gmt-clock' data-balloon-pos='up' />
<div id='topbar-whatsapp'>
<img src={it.url_for('images/pages/footer/ic-whatsapp.svg')} />
</div>
<LiveChat />
<div id='topbar-help-centre'>
<img src={it.url_for('images/pages/footer/ic-help-centre.svg')} />
Expand Down

0 comments on commit bcbb619

Please sign in to comment.