Skip to content

Commit fdd3dc4

Browse files
committed
Updated navbar to use latest design.
1 parent b380f08 commit fdd3dc4

31 files changed

Lines changed: 871 additions & 391 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ terraform/.terraform/environment
55
terraform/*.tfstate.backup
66
terraform/*.tfstate
77
*~
8+
.DS_Store

client/npm-shrinkwrap.json

Lines changed: 486 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/views/footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default ({ t, page }) =>
99
<div className="container">
1010
<div className="footer_container_content">
1111
<div className="language">
12-
<form method="get">
12+
<form className="footer-form" method="get">
1313
{ !process.browser && Object.entries(page.query).map(([k, v]) =>
1414
k != 'lang' && <input type="hidden" name={k} value={v} />
1515
) }

client/src/views/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default (body, opt) =>
77
<div className="explorer-container">
88
<div className="content-wrap">
99
{ navbar(opt) }
10-
{subnav(opt.t, opt.isTouch, opt.activeTab)}
10+
{subnav(opt.t, opt.isTouch, opt.activeTab, opt.theme, opt.page)}
1111
{ body }
1212
</div>
1313
{ footer(opt) }

client/src/views/navbar-menu.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,5 @@ const staticRoot = process.env.STATIC_ROOT || ''
1010
export default ({ t, theme, page }) =>
1111

1212
<div className="main-nav-container">
13-
<ul className="main-nav">
14-
{ items && Object.entries(items).map(([ name, url ]) =>
15-
<li id={name.replace(/ /g, '')} className={`nav-item ${name == active ? 'active' : ''}`}>
16-
<a className="nav-link font-h4" href={url} rel="external">
17-
<span><img className="menu-logo" alt="" src={`${staticRoot}img/icons/${name.replace(/ /g, '')}-menu-logo.svg`} /></span>
18-
<span>{t(name)}</span>
19-
</a>
20-
</li>
21-
) }
22-
</ul>
23-
{ process.env.NAVBAR_HTML ? navToggle(t, theme, page) : "" }
24-
</div>
13+
{ process.env.NAVBAR_HTML ? navToggle(t, theme, page) : "" }
14+
</div>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import Snabbdom from "snabbdom-pragma";
2+
import navToggle from "./nav-toggle";
3+
4+
const items = process.env.MENU_ITEMS && JSON.parse(process.env.MENU_ITEMS),
5+
active = process.env.MENU_ACTIVE;
6+
7+
const staticRoot = process.env.STATIC_ROOT || "";
8+
9+
export default ({ t, theme, page }) => (
10+
<div className="main-nav-container">
11+
{items && (
12+
<ul className="main-nav">
13+
<li id={active.replace(/ /g, "")} className={`nav-item active`}>
14+
<a className="nav-link font-h4" href={items[active]} rel="external">
15+
<span>
16+
<img
17+
className="menu-logo"
18+
alt=""
19+
src={`${staticRoot}img/icons/${active.replace(/ /g, "")}-menu-logo.svg`}
20+
/>
21+
</span>
22+
<span>{t(active)}</span>
23+
<img className="network-angle-down" src={`${staticRoot}img/icons/angle-down.svg`} />
24+
</a>
25+
26+
<div className="network-hover-menu-container">
27+
<div className="network-hover-menu">
28+
{items &&
29+
Object.entries(items).map(([name, url]) => {
30+
return (
31+
<a
32+
id={name.replace(/ /g, "")}
33+
href={url}
34+
className={`network-hover-menu-option-container ${name.replace(/ /g, "").toLowerCase()} ${name === active ? "active" : ""}`}
35+
>
36+
<div
37+
id={name.replace(/ /g, "")}
38+
className={`network-hover-menu-option`}
39+
>
40+
<span>
41+
<img
42+
className="menu-logo"
43+
src={`${staticRoot}img/icons/${name.replace(/ /g, "")}-menu-logo.svg`}
44+
/>
45+
</span>
46+
{t(name)}
47+
</div>
48+
</a>
49+
);
50+
})}
51+
</div>
52+
</div>
53+
</li>
54+
</ul>
55+
)}
56+
</div>
57+
);

client/src/views/pushtx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default ({ t, ...S }) => layout(
55
<div>
66
<div className="block-page">
77
<div className="container">
8-
<form data-do="pushtx" method="post" action="tx/push">
8+
<form className="push-tx-form" data-do="pushtx" method="post" action="tx/push">
99
<div className="form-group">
1010
<label className="col-form-label col-form-label-lg" for="rawtx"><h1>{t`Broadcast raw transaction (hex)`}</h1></label>
1111
<textarea className="form-control" id="rawtx" name="tx" rows="5"></textarea>

client/src/views/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const hasCam = process.browser && navigator.mediaDevices && navigator.mediaDevic
66
export default ({ t, klass, autofocus }) =>
77
<form className="search" action={process.browser?undefined:"search"}>
88
<div className={`search-bar${klass?` ${klass}` : ''}`}>
9+
<img src={`${staticRoot}img/icons/magnifying-glass.svg`}/>
910
<input
1011
className="form-control search-bar-input"
1112
type="search"
@@ -17,6 +18,5 @@ export default ({ t, klass, autofocus }) =>
1718
autocomplete="off"
1819
/>
1920
{ hasCam ? <a className="qrcode-link" href="scan-qr"><img src={`${staticRoot}img/icons/qrcode.svg`}/></a>: "" }
20-
<button className="search-bar-submit" type="image"></button>
2121
</div>
2222
</form>

client/src/views/sub-navbar.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import Snabbdom from 'snabbdom-pragma'
22
import search from './search'
3+
import menu from './navbar-menu'
4+
import networkSelection from './network-selection'
35

4-
export default ( t, isTouch, activeTab) =>
6+
export default ( t, isTouch, activeTab, theme, page) =>
57
<div className="sub-navbar">
68
<div className="container sub-nav-container">
9+
{ networkSelection({t, theme, page}) }
710
<div className="sub-nav font-h5">
811
<a href="." class={{ active: activeTab == 'dashBoard' }}>Dashboard</a>
912
<a href="blocks/recent" class={{ active: activeTab == 'recentBlocks' }}>Blocks</a>

dev-server.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ const custom_assets = (process.env.CUSTOM_ASSETS||'').split(/ +/).filter(Boolean
3434
const p = fn => (req, res, next) => fn(req, res).catch(next)
3535

3636
app.get('/', (req, res) => res.render(rpath('client/index.pug')))
37+
app.get(process.env.BASE_HREF + 'app.js', browserify(rpath('client/src/run-browser.js')))
3738
app.get('/app.js', browserify(rpath('client/src/run-browser.js')))
3839

3940
// Merges the main stylesheet from www/style.css with the custom css files
40-
app.get('/style.css', p(async (req, res) =>
41+
app.get(process.env.BASE_HREF + 'style.css', p(async (req, res) =>
4142
res.type('css').send(await prepCss())))
4243

4344
const prepCss = async _ =>
@@ -58,13 +59,13 @@ custom_assets.forEach(pattern => {
5859
, stat = fs.statSync(path)
5960

6061
stat.isDirectory()
61-
? app.use('/'+name, express.static(path))
62-
: app.get('/'+name, (req, res) => res.sendFile(path))
62+
? app.use(process.env.BASE_HREF + name, express.static(path))
63+
: app.get(process.env.BASE_HREF + name, (req, res) => res.sendFile(path))
6364
})
6465
})
6566

6667
// And finally the default fallback assets from www/
67-
app.use('/', express.static(rpath('www')))
68+
app.use(`${process.env.BASE_HREF}`, express.static(rpath('www')))
6869

6970
app.use((req, res) => res.render(rpath('client/index.pug')))
7071

0 commit comments

Comments
 (0)