Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions client/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ head
body(lang=lang, dir=dir)
#explorer!= prerender_html || ''

if process.env.MENU_ACTIVE === 'Liquid'
script.
if (document.cookie.indexOf('liquid_banner_dismissed=1') !== -1) {
var el = document.querySelector('.announcement-banner');
if (el) el.style.display = 'none';
}

if !noscript
script(src=staticRoot+'app.js', async)
!= process.env.FOOT_HTML
6 changes: 6 additions & 0 deletions client/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,12 @@ export default function main(
burgerMenu.classList.toggle('open-menu');
})

on('.announcement-banner-close', 'click').subscribe(_ => {
document.cookie = 'liquid_banner_dismissed=1; path=/; max-age=31536000; SameSite=Lax'
const banner = document.querySelector('.announcement-banner')
if (banner) banner.style.display = 'none'
})

const closeNetworkMenus = () => {
document.querySelectorAll('.nav-item.open-network-menu').forEach(menu => {
menu.classList.remove('open-network-menu')
Expand Down
5 changes: 5 additions & 0 deletions client/src/components/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions client/src/views/announcement-banner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { CloseIcon } from '../components/icons'

const isLiquidMainnet = process.env.MENU_ACTIVE === 'Liquid'

export default () =>
isLiquidMainnet
? <div className="announcement-banner">
<p className="announcement-banner-message">
Issued-asset transfers have resumed. LBTC transfers and peg-out operations remain paused. Updates:{' '}
<a href="https://x.com/Liquid_BTC" target="_blank" rel="noopener">@Liquid_BTC</a>
</p>
<button className="announcement-banner-close" aria-label="Dismiss announcement">
<CloseIcon className="announcement-banner-close-icon" />
</button>
</div>
: ""
2 changes: 2 additions & 0 deletions client/src/views/layout.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import navbar from './navbar'
import footer from './footer'
import subnav from './sub-navbar'
import announcementBanner from './announcement-banner'

export default (body, opt) => {
const mainKey = opt.view || opt.activeTab || opt.page && opt.page.pathname || 'main'

return <div className="explorer-container">
{ navbar(opt) }
{ subnav(opt.t, opt.isTouch, opt.activeTab, opt.page) }
{ announcementBanner() }
<main className="explorer-main" key={mainKey}>
{ body }
</main>
Expand Down
53 changes: 53 additions & 0 deletions flavors/liquid-mainnet/extras.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,57 @@

.navbar {
background-image: linear-gradient(-90deg, rgba(13, 141, 119, 1) 0%, rgba(17, 103, 97, 1) 16%, rgba(25, 68, 74, 1) 35%, rgba(29, 42, 48, 1) 57%, rgba(14, 16, 17, 1) 100%);
}

.announcement-banner {
display: flex;
align-items: center;
justify-content: center;
gap: 20px;
width: 100%;
margin-top: 24px;
padding: 16px 60px;
background: var(--danger-color);
border-radius: 12px;
box-sizing: border-box;
}

@media only screen and (max-width: 900px) {
.announcement-banner {
padding: 14px 20px;
}
}

.announcement-banner-message {
margin: 0;
color: #fff;
text-align: center;
font-size: 15px;
line-height: 1.4;
}

.announcement-banner-message a {
color: #fff;
font-weight: 700;
text-decoration: underline;
}

.announcement-banner-message a:hover {
text-decoration: none;
}

.announcement-banner-close {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
padding: 4px;
cursor: pointer;
color: #fff;
}

.announcement-banner-close:hover {
color: rgba(255, 255, 255, 0.7);
}
Loading