'use strict' ;
import React from 'react' ;
import config from '../config' ;
document . title += ` - ${ config . title } ` ;
var App = React . createClass ( {
displayName : 'App' ,
propTypes : {
dispatch : React . PropTypes . func ,
children : React . PropTypes . object
} ,
render : function ( ) {
const monthStart = new Date ( '2019-01-01' ) . toISOString ( ) ;
const monthEnd = new Date ( ) . toISOString ( ) ;
const monthRainUrl = ` https://api.opensensemap.org/statistics/descriptive?boxid= ${ config . senseBox . id } &from-date= ${ monthStart } &to-date= ${ monthEnd } &phenomenon=Niederschlag&window=30d&operation=sum&columns=boxName,unit&format=json&download=false `
return (
< div >
< header className = 'site-header' role = 'banner' >
< div className = 'inner' >
< div className = 'site-headline' >
< span className = 'site-title' > { config . title } < / s p a n >
< span >
< a target = '_blank' href = { 'https://opensensemap.org/explore/' + config . senseBox . id } > 🗺 ️ Karte < / a >
< br / >
< a target = '_blank' href = { monthRainUrl } > Niederschlag / Monat < / a >
< / s p a n >
< / d i v >
< / d i v >
< / h e a d e r >
< main className = 'site-body' role = 'main' >
{ this . props . children }
< / m a i n >
< footer className = 'site-footer' role = 'footer' >
< p > by < a href = 'https://developmentseed.org' title = 'Visit Development Seed website' target = "_blank" > Development Seed < /a> using <a href={'https:/ / opensensemap . org / explore / ' + config.senseBox.id} title=' Visit openSenseMap website ' target = "_blank" > openSenseMap < / a > d a t a . < / p >
< / f o o t e r >
< / d i v >
) ;
}
} ) ;
module . exports = App ;