text: import { h, Component } from 'preact'
  import { Router } from 'preact-router'
  
  import Header from './header'
  
  // Code-splitting is automated for routes
  import Home from '../routes/home'
  import Profile from '../routes/profile'
  
  export default class App extends Component {
    /** Gets fired when the route changes.
     *  @param {Object} event   "change" event from [preact-router](http://git.io/preact-router)
     *  @param {string} event.url The newly routed URL
     */
    handleRoute = (event) => {
      this.currentUrl = event.url
      if (typeof window === 'undefined') return
      if (window.ga) window.ga('send', 'pageview', event.url)
    }
  
    render () {
      return (
        <div id='app'>
          <Header />
          <Router onChange={this.handleRoute}>
            <Home path='/' />
            <Profile path='/profile/' user='me' />
            <Profile path='/profile/:user' />
          </Router>
        </div>
      )
    }
  }
  