From 077cb982ea58089fb88e814f556c3831b5d84c11 Mon Sep 17 00:00:00 2001 From: Gianluca Esposito Date: Thu, 10 Sep 2015 22:06:17 +0200 Subject: [PATCH] Converted template to ES6 --- pages/_template.cjsx | 58 ----------------------------------------- pages/_template.jsx | 62 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 58 deletions(-) delete mode 100644 pages/_template.cjsx create mode 100644 pages/_template.jsx diff --git a/pages/_template.cjsx b/pages/_template.cjsx deleted file mode 100644 index 4afd57a..0000000 --- a/pages/_template.cjsx +++ /dev/null @@ -1,58 +0,0 @@ -React = require 'react' -Router = require 'react-router' -{RouteHandler, Link} = Router -{Container, Grid, Breakpoint, Span} = require 'react-responsive-grid' -Typography = require 'typography' -require '../css/styles.css' -{link} = require 'gatsby-helpers' - -typography = Typography() -{rhythm, fontSizeToMS} = typography - -module.exports = React.createClass - render: -> - if @props.state.path is link('/') - header = ( -

- - {@props.config.blogTitle} - -

- ) - else - header = ( -

- - {@props.config.blogTitle} - -

- ) - - - {header} - - - diff --git a/pages/_template.jsx b/pages/_template.jsx new file mode 100644 index 0000000..a5251d9 --- /dev/null +++ b/pages/_template.jsx @@ -0,0 +1,62 @@ +import React from 'react'; +import { RouteHandler, Link } from 'react-router'; +import { Container, Grid, Breakpoint, Span } from 'react-responsive-grid'; +import Typography from 'typography'; +import { link } from 'gatsby-helpers'; + +var typography = new Typography(); +var rhythm = typography.rhythm, fontSizeToMS = typography.fontSizeToMS; + +import '../css/styles.css'; + +module.exports = React.createClass({displayName: "exports", + render: function() { + var header; + if (this.props.state.path === link('/')) { + header = ( +

+ + {this.props.config.blogTitle} + +

+ ); + } else { + header = ( +

+ + {this.props.config.blogTitle} + +

+ ); + } + return ( + + {header} + + + ); + } +});