mirror of
				https://github.com/mastermindzh/rickvanlieshout.com
				synced 2025-11-03 18:19:39 +01:00 
			
		
		
		
	adds react/forbid-prop-types to be ignored in eslintrc could be added in an additional refactoring round right now, I'm not sure what to choose as proptypes...
		
			
				
	
	
		
			35 lines
		
	
	
		
			749 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			749 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import React from 'react';
 | 
						|
import Helmet from 'react-helmet';
 | 
						|
import { config } from 'config';
 | 
						|
 | 
						|
import SitePost from '../components/SitePost';
 | 
						|
import SitePage from '../components/SitePage';
 | 
						|
 | 
						|
class MarkdownWrapper extends React.Component {
 | 
						|
  render() {
 | 
						|
    const { route } = this.props;
 | 
						|
    const post = route.page.data;
 | 
						|
    const layout = post.layout;
 | 
						|
    let template;
 | 
						|
 | 
						|
    if (layout !== 'page') {
 | 
						|
      template = <SitePost {...this.props} />;
 | 
						|
    } else {
 | 
						|
      template = <SitePage {...this.props} />;
 | 
						|
    }
 | 
						|
 | 
						|
    return (
 | 
						|
      <div>
 | 
						|
        <Helmet title={`${post.title} - ${config.siteTitle}`} />
 | 
						|
        {template}
 | 
						|
      </div>
 | 
						|
    );
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
MarkdownWrapper.propTypes = {
 | 
						|
  route: React.PropTypes.object,
 | 
						|
};
 | 
						|
 | 
						|
export default MarkdownWrapper;
 |