2017-03-08 17:53:24 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { Link } from 'react-router';
|
|
|
|
import { prefixLink } from 'gatsby-helpers';
|
|
|
|
import { config } from 'config';
|
|
|
|
import SiteNav from '../SiteNav';
|
|
|
|
import SiteLinks from '../SiteLinks';
|
|
|
|
import './style.css';
|
|
|
|
import profilePic from '../../pages/photo.jpg';
|
2016-03-11 23:28:19 +01:00
|
|
|
|
2016-06-03 13:05:50 +02:00
|
|
|
class SiteSidebar extends React.Component {
|
2017-03-08 17:53:24 +01:00
|
|
|
render() {
|
|
|
|
const { location } = this.props;
|
|
|
|
const isHome = location.pathname === prefixLink('/');
|
2016-03-11 23:28:19 +01:00
|
|
|
|
2017-03-08 17:53:24 +01:00
|
|
|
/* eslint-disable jsx-a11y/img-redundant-alt*/
|
|
|
|
const header = (
|
|
|
|
<header>
|
|
|
|
<Link style={{ textDecoration: 'none', borderBottom: 'none', outline: 'none' }} to={prefixLink('/')}>
|
|
|
|
<img
|
2017-03-08 17:59:10 +01:00
|
|
|
src={profilePic}
|
2017-03-08 17:53:24 +01:00
|
|
|
width="75" height="75"
|
|
|
|
alt="Profile picture of the author"
|
|
|
|
/>
|
|
|
|
</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>
|
|
|
|
);
|
|
|
|
/* eslint-enable jsx-a11y/img-redundant-alt*/
|
2016-03-21 18:03:01 +01:00
|
|
|
|
2017-03-08 17:53:24 +01:00
|
|
|
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">
|
|
|
|
© All rights reserved.
|
|
|
|
</p>
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-03-11 23:28:19 +01:00
|
|
|
}
|
|
|
|
|
2016-06-03 13:05:50 +02:00
|
|
|
SiteSidebar.propTypes = {
|
2017-03-08 17:53:24 +01:00
|
|
|
location: React.PropTypes.object,
|
|
|
|
};
|
2016-03-11 23:28:19 +01:00
|
|
|
|
2017-03-08 17:53:24 +01:00
|
|
|
export default SiteSidebar;
|
2016-03-11 23:28:19 +01:00
|
|
|
|