rickvanlieshout.com/components/SidebarLeft/index.jsx

57 lines
1.9 KiB
React
Raw Normal View History

2016-03-11 23:28:19 +01:00
import React from 'react'
import { RouteHandler, Link } from 'react-router'
2016-06-03 01:32:38 +02:00
import { prefixLink } from 'gatsby-helpers'
2016-03-11 23:28:19 +01:00
import { config } from 'config'
import BlogNav from '../BlogNav'
import BlogSocial from '../BlogSocial'
2016-06-03 01:32:38 +02:00
import './style.css'
2016-03-11 23:28:19 +01:00
class SidebarLeft extends React.Component {
2016-03-21 18:03:01 +01:00
render() {
const {location, children} = this.props
2016-06-03 01:32:38 +02:00
const isHome = location.pathname === prefixLink('/')
2016-03-11 23:28:19 +01:00
2016-06-03 01:32:38 +02:00
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>
)
2016-03-21 18:03:01 +01:00
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>
);
}
2016-03-11 23:28:19 +01:00
}
SidebarLeft.propTypes = {
2016-03-21 18:03:01 +01:00
children: React.PropTypes.any,
location: React.PropTypes.object,
2016-03-11 23:28:19 +01:00
}
export default SidebarLeft