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:
parent
55af294e33
commit
9d968b7322
@ -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>
|
||||
|
@ -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"
|
||||
|
@ -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 flat leftIcon="(Unleash)">
|
||||
<Navigation />
|
||||
</AppBar>
|
||||
{this.props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
15
packages/unleash-frontend-next/src/Features.jsx
Normal file
15
packages/unleash-frontend-next/src/Features.jsx
Normal 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>
|
||||
);
|
||||
}
|
||||
};
|
15
packages/unleash-frontend-next/src/Navigation.jsx
Normal file
15
packages/unleash-frontend-next/src/Navigation.jsx
Normal 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>
|
||||
);
|
||||
}
|
||||
};
|
10
packages/unleash-frontend-next/src/Strategies.jsx
Normal file
10
packages/unleash-frontend-next/src/Strategies.jsx
Normal file
@ -0,0 +1,10 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
|
||||
export default class Strategies extends Component {
|
||||
render () {
|
||||
return (
|
||||
<h1>Strategies</h1>
|
||||
);
|
||||
}
|
||||
};
|
@ -1,5 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('app'));
|
15
packages/unleash-frontend-next/src/index.jsx
Normal file
15
packages/unleash-frontend-next/src/index.jsx
Normal 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'));
|
Loading…
Reference in New Issue
Block a user