mirror of
				https://github.com/mastermindzh/rickvanlieshout.com
				synced 2025-11-04 10:40:09 +01:00 
			
		
		
		
	refactor: fixes linting errors components/SiteSidebar/index.jsx
This commit is contained in:
		@@ -1,58 +1,63 @@
 | 
			
		||||
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'
 | 
			
		||||
import profilePic from '../../pages/photo.jpg'
 | 
			
		||||
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';
 | 
			
		||||
 | 
			
		||||
class SiteSidebar extends React.Component {
 | 
			
		||||
    render() {
 | 
			
		||||
        const {location, children} = this.props
 | 
			
		||||
        const isHome = location.pathname === prefixLink('/')
 | 
			
		||||
  render() {
 | 
			
		||||
    const { location } = this.props;
 | 
			
		||||
    const isHome = location.pathname === prefixLink('/');
 | 
			
		||||
 | 
			
		||||
        let header = (
 | 
			
		||||
        <header>
 | 
			
		||||
          <Link style={ {    textDecoration: 'none',    borderBottom: 'none',    outline: 'none'} } to={ prefixLink('/') }>
 | 
			
		||||
          <img src={prefixLink(profilePic)} 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>
 | 
			
		||||
        )
 | 
			
		||||
    /* eslint-disable jsx-a11y/img-redundant-alt*/
 | 
			
		||||
    const header = (
 | 
			
		||||
      <header>
 | 
			
		||||
        <Link style={{ textDecoration: 'none', borderBottom: 'none', outline: 'none' }} to={prefixLink('/')}>
 | 
			
		||||
          <img
 | 
			
		||||
            src={prefixLink(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*/
 | 
			
		||||
 | 
			
		||||
        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>
 | 
			
		||||
            );
 | 
			
		||||
    }
 | 
			
		||||
    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>
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
SiteSidebar.propTypes = {
 | 
			
		||||
    children: React.PropTypes.any,
 | 
			
		||||
    location: React.PropTypes.object,
 | 
			
		||||
}
 | 
			
		||||
  location: React.PropTypes.object,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default SiteSidebar
 | 
			
		||||
export default SiteSidebar;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user