Skip to content

Commit

Permalink
fix: add template header when switching account
Browse files Browse the repository at this point in the history
  • Loading branch information
henry-deriv committed Mar 14, 2024
1 parent a8ffbaa commit 1d9d351
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/javascript/app/base/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const Header = (() => {
};

const onLoad = () => {
const shadow_header = getElementById('template_header');
populateAccountsList();
populateWalletAccounts();
bindSvg();
Expand All @@ -51,6 +52,7 @@ const Header = (() => {
});
if (Client.isLoggedIn()) {
displayAccountStatus();
shadow_header.remove();
}
fullscreen_map.event.forEach(event => {
document.addEventListener(event, onFullScreen, false);
Expand Down
2 changes: 2 additions & 0 deletions src/templates/_common/_layout/layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Head from './head.jsx';
import Header from './header.jsx';
// import MobileMenu from './mobile_menu.jsx';
import WalletHeader from './wallet-header.jsx';
import TemplateHeader from './templateHeader.jsx';
import DerivIFrame from '../includes/deriv-iframe.jsx';
// import Elevio from '../includes/elevio.jsx';
import Gtm from '../includes/gtm.jsx';
Expand Down Expand Up @@ -68,6 +69,7 @@ const Layout = () => {
<Gtm />
<div id='msg_notification' className='notice-msg center-text' />
<div id='page-wrapper'>
<TemplateHeader />
<Header />
<WalletHeader />
<div id='content-holder'>
Expand Down
16 changes: 16 additions & 0 deletions src/templates/_common/_layout/templateHeader.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';

const TemplateHeader = () => (
<div id='template_header' className='header'>
<div className='header__menu-items'>
<div className='header__menu-left'>
<div id='platform__switcher' className='header__menu-item platform__switcher mobile-hide'>
<img className='header__logo' />
<img id='platform__switcher-expand' className='header__icon header__expand' />
</div>
</div>
</div>
</div>
);

export default TemplateHeader;

0 comments on commit 1d9d351

Please sign in to comment.