<header> navigation like Magerial Design Lite.

old
@soyjavi 2015-10-30 13:32:39 +07:00
parent 0aca8fe779
commit c997834243
5 changed files with 21 additions and 35 deletions

View File

@ -3,19 +3,19 @@ import { AppBar, Button } from 'react-toolbox';
import { Link } from 'react-router'; import { Link } from 'react-router';
import Logo from '../../../logo'; import Logo from '../../../logo';
import Navigation from '../../../navigation'; import Navigation from '../../../navigation';
import PlaygroundArea from '../playground_area'; // import PlaygroundArea from '../playground_area';
import style from './appbar.scss'; import style from './appbar.scss';
class MainAppBar extends React.Component { class MainAppBar extends React.Component {
handlerPlayGroundClick = () => { handlerPlayGroundClick = () => {
this.refs.playground.show(); // this.refs.playground.show();
} }
render () { render () {
return ( return (
<AppBar className={style.appbar} flat fixed> <AppBar className={style.appbar} flat fixed>
<Link to='/' className={style.brand}> <Link to='/'>
<Logo className={style.logo} /> React Toolbox <Logo className={style.logo} />
</Link> </Link>
<Navigation className={style.navigation}/> <Navigation className={style.navigation}/>
<Button <Button
@ -25,7 +25,6 @@ class MainAppBar extends React.Component {
kind='floating' kind='floating'
onClick={this.handlerPlayGroundClick} onClick={this.handlerPlayGroundClick}
/> />
<PlaygroundArea ref='playground' />
</AppBar> </AppBar>
); );
} }

View File

@ -1,42 +1,27 @@
@import "../../../globals"; @import "../../../globals";
@import "~react-toolbox/app_bar/config"; @import "~react-toolbox/app_bar/config";
@import "~react-toolbox/button/config"; @import "~react-toolbox/button/config";
$appbar-height: 11.2 * $unit;
$appbar-brand-height: 2 * $unit; $appbar-logo-size: 3.6 * $unit;
$appbar-brand-v-padding: ($appbar-height - $appbar-brand-height) / 2; $appbar-shadow: 0 1px rgba(255,255,255,.75);
$appbar-brand-logo-size: $appbar-height - 2.6 * $unit;
$appbar-shadow: 0 1px rgba(255,255,255,0.75);
.appbar { .appbar {
composes: root from "sass!react-toolbox/app_bar/style"; display: flex;
min-height: $appbar-height;
flex-direction: column;
align-items: flex-start;
justify-content: flex-end;
background: $color-primary-dark; background: $color-primary-dark;
box-shadow: $appbar-shadow; box-shadow: $appbar-shadow;
} }
.brand { .logo {
@include typo-title; width: $appbar-logo-size;
position: relative; height: $appbar-logo-size;
display: inline-block; fill: $color-primary-contrast;
padding-top: $appbar-brand-v-padding;
padding-bottom: $appbar-brand-v-padding;
padding-left: $appbar-title-distance;
font-weight: 400;
color: $color-primary-contrast;
> .logo {
position: absolute;
top: 50%;
left: 0;
width: $appbar-brand-logo-size;
height: $appbar-brand-logo-size;
margin-top: - $appbar-brand-logo-size / 2;
fill: $color-primary-contrast;
}
} }
.navigation { .navigation {
flex-grow: 1;
padding-right: $button-floating-height;
text-align: right;
> ul { > ul {
list-style: none; list-style: none;
> li { > li {
@ -44,7 +29,8 @@ $appbar-shadow: 0 1px rgba(255,255,255,0.75);
> a { > a {
@include typo-menu; @include typo-menu;
display: inline-block; display: inline-block;
padding: 2.5 * $unit $appbar-h-padding; margin-right: $appbar-h-padding;
line-height: $appbar-height / 2;
color: $color-primary-contrast; color: $color-primary-contrast;
} }
} }

View File

@ -1,4 +1,4 @@
@import "../../globals"; @import "../../../globals";
$documentation-h1-size: 3.4 * $unit; $documentation-h1-size: 3.4 * $unit;
$documentation-h2-size: 2.4 * $unit; $documentation-h2-size: 2.4 * $unit;

View File

@ -1,6 +1,7 @@
@import "../../globals"; @import "../../globals";
@import "~react-toolbox/app_bar/config"; @import "~react-toolbox/app_bar/config";
$appbar-height: 11.2 * $unit;
.content { .content {
display: flex; display: flex;
max-height: 100vh; max-height: 100vh;

View File

@ -5,8 +5,8 @@ const Navigation = (props) => {
return ( return (
<nav className={props.className}> <nav className={props.className}>
<ul> <ul>
<li><Link to='/install'>Installation</Link></li>
<li><Link to='/components/app_bar'>Components</Link></li> <li><Link to='/components/app_bar'>Components</Link></li>
<li><Link to='/install'>Installation</Link></li>
<li><a href='http://www.github.com/react-toolbox/react-toolbox' target='_blank'>Github</a></li> <li><a href='http://www.github.com/react-toolbox/react-toolbox' target='_blank'>Github</a></li>
</ul> </ul>
</nav> </nav>