import React from 'react' import {Link} from 'next-url-prettifier' import {Router} from '../routes' export default class GreetingPage extends React.Component { static getInitialProps ({query: {lang, name}}) { return {lang, name} } renderSwitchLangageLink () { const {lang, name} = this.props const switchLang = lang === 'fr' ? 'en' : 'fr' return ( {switchLang === 'fr' ? 'Français' : 'English'} ) } render () { const {lang, name} = this.props return (

{lang === 'fr' ? 'Bonjour' : 'Hello'} {name}

{this.renderSwitchLangageLink()}
) } } GreetingPage.propTypes = { lang: React.PropTypes.string, name: React.PropTypes.string }