mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Add ReactSpa template
This commit is contained in:
27
templates/ReactSpa/ClientApp/routes.tsx
Normal file
27
templates/ReactSpa/ClientApp/routes.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import * as React from 'react';
|
||||
import { Router, Route, HistoryBase } from 'react-router';
|
||||
import { NavMenu } from './components/NavMenu';
|
||||
import { Home } from './components/Home';
|
||||
import { About } from './components/About';
|
||||
import { Counter } from './components/Counter';
|
||||
|
||||
class Layout extends React.Component<{ body: React.ReactElement<any> }, void> {
|
||||
public render() {
|
||||
return <div>
|
||||
<NavMenu />
|
||||
<div className="container body-content">
|
||||
{ this.props.body }
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2016 - WebApplicationBasic</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export const routes = <Route component={ Layout }>
|
||||
<Route path="/" components={{ body: Home }} />
|
||||
<Route path="/about" components={{ body: About }} />
|
||||
<Route path="/counter" components={{ body: Counter }} />
|
||||
</Route>;
|
||||
Reference in New Issue
Block a user