Broad layout

Sidebar-constrained header
This commit is contained in:
Tom Russell 2020-01-27 17:17:39 +00:00
parent c4e93d1a65
commit 9f961ca116
6 changed files with 36 additions and 54 deletions

View File

@ -88,7 +88,6 @@ class App extends React.Component<AppProps, AppState> {
<Header user={this.state.user} animateLogo={true} /> <Header user={this.state.user} animateLogo={true} />
</Route> </Route>
</Switch> </Switch>
<main>
<Switch> <Switch>
<Route exact path="/about.html" component={AboutPage} /> <Route exact path="/about.html" component={AboutPage} />
<Route exact path="/login.html"> <Route exact path="/login.html">
@ -125,7 +124,6 @@ class App extends React.Component<AppProps, AppState> {
)} /> )} />
<Route component={NotFound} /> <Route component={NotFound} />
</Switch> </Switch>
</main>
</Fragment> </Fragment>
); );
} }

View File

@ -2,18 +2,19 @@
* Sidebar layout * Sidebar layout
*/ */
.info-container { .info-container {
order: 1; position: absolute;
top: 85px;
left: 0;
bottom: 0;
overflow-y: auto;
width: 100%;
padding: 0 0 2em; padding: 0 0 2em;
background: #fff; background: #fff;
overflow-y: auto;
height: 40%;
} }
@media (min-width: 768px){ @media (min-width: 480px){
.info-container { .info-container {
order: 0; width: 480px; /* to match .main-header menu width */
height: unset;
width: 23rem;
} }
} }

View File

@ -2,8 +2,18 @@
* Main header * Main header
*/ */
.main-header { .main-header {
z-index: 3000;
position: absolute;
top: 0;
left: 0;
width: 100%;
background: #fff;
text-decoration: none; text-decoration: none;
border-bottom: 2px solid #222; }
@media (min-width: 480px){
.main-header {
width: 480px; /* to match .info-container menu width */
}
} }
.main-header .navbar { .main-header .navbar {
padding: 0.5em 0.5em 0.5em; padding: 0.5em 0.5em 0.5em;
@ -11,18 +21,7 @@
.main-header .navbar-brand { .main-header .navbar-brand {
margin: 0 1em 0 0; margin: 0 1em 0 0;
} }
.main-header .navbar-collapse {
.main-header .shorten-username { height: calc(100vh - 80px);
text-overflow: '…)'; overflow-y: auto;
white-space: nowrap;
overflow: hidden;
display: inline-block;
vertical-align: bottom;
max-width: 70vw;
}
@media (min-width: 768px) {
.main-header .shorten-username {
max-width: 5vw;
}
} }

View File

@ -42,8 +42,8 @@ class Header extends React.Component<HeaderProps, HeaderState> {
render() { render() {
return ( return (
<header className="main-header"> <header className="main-header">
<nav className="navbar navbar-light navbar-expand-lg"> <nav className="navbar navbar-light">
<span className="navbar-brand align-self-start"> <span className="navbar-brand">
<NavLink to="/"> <NavLink to="/">
<Logo variant={this.props.animateLogo ? 'animated' : 'default'}/> <Logo variant={this.props.animateLogo ? 'animated' : 'default'}/>
</NavLink> </NavLink>
@ -53,7 +53,7 @@ class Header extends React.Component<HeaderProps, HeaderState> {
<span className="navbar-toggler-icon"></span> <span className="navbar-toggler-icon"></span>
</button> </button>
<div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'}> <div className={this.state.collapseMenu ? 'collapse navbar-collapse' : 'navbar-collapse'}>
<ul className="navbar-nav ml-auto"> <ul className="navbar-nav flex-column">
<li className="nav-item"> <li className="nav-item">
<NavLink to="/view/categories" className="nav-link" onClick={this.handleNavigate}> <NavLink to="/view/categories" className="nav-link" onClick={this.handleNavigate}>
View/Edit Maps View/Edit Maps

View File

@ -8,10 +8,17 @@
box-shadow: 0px 0px 1px 1px #222; box-shadow: 0px 0px 1px 1px #222;
visibility: hidden; visibility: hidden;
} }
.map-container { .map-container {
flex: 1; position: absolute;
position: relative; top: 0;
bottom: 0;
left: 0;
right: 0;
}
@media (min-width: 768px) {
.map-container {
left: 480px;
}
} }
.leaflet-container { .leaflet-container {
height: 100%; height: 100%;

View File

@ -1,35 +1,12 @@
/** /**
* Main Layout * Main Layout
*/ */
html, body, #root { html, body, #root {
height: 100%; height: 100%;
} }
body { body {
margin: 0; margin: 0;
} }
#root {
display: flex;
flex-direction: column;
overflow: hidden;
}
main {
position: relative;
flex: 1;
display: flex;
flex-direction: column;
overflow: auto;
}
@media(min-width: 768px) {
main {
flex-direction: row;
justify-content: center;
}
}
/** /**
* Text pages * Text pages
*/ */