1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00

added react-router #153

This commit is contained in:
Ivar 2016-09-12 21:39:54 +02:00 committed by Ivar Conradi Østhus
parent 55af294e33
commit 9d968b7322
8 changed files with 66 additions and 18 deletions

View File

@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>Sample App</title>
<title>Unleash UI</title>
<link rel="stylesheet" href="/static/bundle.css" />
</head>
<body>

View File

@ -31,6 +31,7 @@
"dependencies": {
"immutability-helper": "^2.0.0",
"react": "^15.3.1",
"react-addons-css-transition-group": "^15.3.1",
"react-dom": "^15.3.1",
"react-router": "^2.8.0",
"react-toolbox": "^1.2.1"

View File

@ -1,20 +1,17 @@
import React, { Component } from 'react';
import { AppBar } from 'react-toolbox/lib/app_bar';
import { Navigation} from 'react-toolbox/lib/navigation';
import Link from 'react-toolbox/lib/link';
import { AppBar } from 'react-toolbox';
import Navigation from './Navigation';
export default class App extends Component {
render () {
return (
<AppBar>
<div>
<Navigation type='horizontal' className="navigation">
<Link href='' label='Feature Toggles' />
<Link href='' active label='Strategies' />
<Link href='' active label='Documentation' />
</Navigation>
</div>
</AppBar>
<div>
<AppBar flat leftIcon="(Unleash)">
<Navigation />
</AppBar>
{this.props.children}
</div>
);
}
};

View File

@ -0,0 +1,15 @@
import React, { Component } from 'react';
import { Layout, Panel } from 'react-toolbox';
export default class Features extends Component {
render () {
return (
<Layout>
<Panel>
<h1>Feture toggles</h1>
</Panel>
</Layout>
);
}
};

View File

@ -0,0 +1,15 @@
import React, { Component } from 'react';
import { Link } from 'react-router';
import { Navigation } from 'react-toolbox';
export default class UnleashNav extends Component {
render () {
return (
<Navigation type="horizontal">
<Link to="/features">Feature Toggles </Link>
<Link to="/strategies">Strategies </Link>
<a href="https://github.com/finn-no/unleash/" target="_blank">GitHub </a>
</Navigation>
);
}
};

View File

@ -0,0 +1,10 @@
import React, { Component } from 'react';
export default class Strategies extends Component {
render () {
return (
<h1>Strategies</h1>
);
}
};

View File

@ -1,5 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('app'));

View File

@ -0,0 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, hashHistory } from 'react-router';
import App from './App';
import Features from './Features';
import Strategies from './Strategies';
ReactDOM.render((
<Router history={hashHistory}>
<Route path="/" component={App}>
<Route path="/features" component={Features} />
<Route path="/Strategies" component={Strategies} />
</Route>
</Router>
), document.getElementById('app'));