rickvanlieshout.com/components/SiteSidebar/index.jsx

65 lines
1.8 KiB
React
Raw Normal View History

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 {
render() {
const { location } = this.props;
const isHome = location.pathname === prefixLink('/');
2016-03-11 23:28:19 +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}
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
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>
);
}
2016-03-11 23:28:19 +01:00
}
2016-06-03 13:05:50 +02:00
SiteSidebar.propTypes = {
location: React.PropTypes.object,
};
2016-03-11 23:28:19 +01:00
export default SiteSidebar;
2016-03-11 23:28:19 +01:00