rickvanlieshout.com/components/SidebarLeft/index.jsx
2016-06-03 02:32:38 +03:00

57 lines
1.9 KiB
JavaScript

import React from 'react'
import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import { config } from 'config'
import BlogNav from '../BlogNav'
import BlogSocial from '../BlogSocial'
import './style.css'
class SidebarLeft 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'>
<BlogNav {...this.props}/>
<footer>
<BlogSocial {...this.props}/>
<p className='copyright'>
&copy; All rights reserved.
</p>
</footer>
</div>
</div>
</div>
);
}
}
SidebarLeft.propTypes = {
children: React.PropTypes.any,
location: React.PropTypes.object,
}
export default SidebarLeft