Version 1.0

This commit is contained in:
wpioneer
2016-06-03 14:05:50 +03:00
parent 05ee70daab
commit 4a4b34f52b
13 changed files with 39 additions and 35 deletions

View File

@@ -0,0 +1,57 @@
import React from 'react'
import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import { config } from 'config'
import SiteNav from '../SiteNav'
import SiteLinks from '../SiteLinks'
import './style.css'
class SiteSidebar extends React.Component {
render() {
const {location, children} = this.props
const isHome = location.pathname === prefixLink('/')
let header = (
<header>
<Link style={ { textDecoration: 'none', borderBottom: 'none', outline: 'none'} } to={ prefixLink('/') }>
<img src='./photo.jpg' width='75' height='75' />
</Link>
{ isHome ? (
<h1><Link style={ { textDecoration: 'none', borderBottom: 'none', color: 'inherit'} } to={ prefixLink('/') }> { config.siteAuthor } </Link></h1>
) :
<h2><Link style={ { textDecoration: 'none', borderBottom: 'none', color: 'inherit'} } to={ prefixLink('/') }> { config.siteAuthor } </Link></h2> }
<p>
{ config.siteDescr }
</p>
</header>
)
return (
<div className='sidebar'>
<div className='sidebar-inner'>
<div className='blog-details'>
<header>
{ header }
</header>
</div>
<div className='blog-options'>
<SiteNav {...this.props}/>
<footer>
<SiteLinks {...this.props}/>
<p className='copyright'>
&copy; All rights reserved.
</p>
</footer>
</div>
</div>
</div>
);
}
}
SiteSidebar.propTypes = {
children: React.PropTypes.any,
location: React.PropTypes.object,
}
export default SiteSidebar

View File

@@ -0,0 +1,67 @@
.sidebar {
lost-column: 1/3;
}
.sidebar .sidebar-inner {
position: relative;
padding: 40px;
}
.sidebar .sidebar-inner:after {
background: #eee;
background: linear-gradient(to bottom, #eee 0%, #eee 48%, #fff 100%);
position: absolute;
content: '';
width: 1px;
height: 540px;
top: 30px;
right: -10px;
bottom: 0;
}
.sidebar .sidebar-inner img {
display: inline-block;
margin-bottom: 0;
border-radius: 50%;
background-clip: padding-box;
}
.sidebar .sidebar-inner h1, .sidebar .sidebar-inner h2 {
font-size: 18px;
font-weight: 500;
line-height: 18px;
margin: 20px 0 10px;
}
.sidebar .sidebar-inner p {
color: #888;
font-size: 16px;
line-height: 26px;
margin-bottom: 26px;
}
.sidebar .sidebar-inner p.copyright {
color: #b6b6b6;
font-size: 14px;
}
@media (max-width:1100px) {
.sidebar .sidebar-inner {
padding: 35px 20px 0;
}
.sidebar {
lost-column: 1/2;
}
}
@media (max-width:900px) {
.sidebar {
lost-column: 5/12;
}
.sidebar .sidebar-inner {
padding: 30px 20px 0;
}
}
@media (max-width:500px) {
.sidebar {
lost-column: 1;
}
.sidebar .sidebar-inner {
padding: 25px 20px 0;
}
.sidebar .sidebar-inner:after {
display: none;
}
}