import React, {Component} from 'react'
import {Redirect, Route, Router, Switch} from 'react-router-dom'
import createBrowserHistory from 'history/createBrowserHistory'
import 'normalize.css'
import './font/font.css'
import Root from './frame'

export default class Frame extends Component{
  history = createBrowserHistory({
    basename: `/zh`
  })

  render(){
    return (<Router pathname='/zh' history={this.history}>
      <Switch>
        <Route exact path="/" render={props=>(
          <Root
            {...props}
          />
        )} />
        <Route path="/chat" render={props=>(
          <Root
            {...props}
          />
        )} />
        <Route path="/group" render={props=>(
          <Root
            {...props}
          />
        )} />
        <Route path="/contact" render={props=>(
          <Root
            {...props}
          />
        )} />
        <Route path="/sub" render={props=>(
          <Root
            {...props}
          />
        )} />
      </Switch>
    </Router>)
  }
}
