mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
added react-router #153
This commit is contained in:
parent
55af294e33
commit
9d968b7322
@ -1,7 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Sample App</title>
|
<title>Unleash UI</title>
|
||||||
<link rel="stylesheet" href="/static/bundle.css" />
|
<link rel="stylesheet" href="/static/bundle.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"immutability-helper": "^2.0.0",
|
"immutability-helper": "^2.0.0",
|
||||||
"react": "^15.3.1",
|
"react": "^15.3.1",
|
||||||
|
"react-addons-css-transition-group": "^15.3.1",
|
||||||
"react-dom": "^15.3.1",
|
"react-dom": "^15.3.1",
|
||||||
"react-router": "^2.8.0",
|
"react-router": "^2.8.0",
|
||||||
"react-toolbox": "^1.2.1"
|
"react-toolbox": "^1.2.1"
|
||||||
|
@ -1,20 +1,17 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { AppBar } from 'react-toolbox/lib/app_bar';
|
import { AppBar } from 'react-toolbox';
|
||||||
import { Navigation} from 'react-toolbox/lib/navigation';
|
|
||||||
import Link from 'react-toolbox/lib/link';
|
import Navigation from './Navigation';
|
||||||
|
|
||||||
export default class App extends Component {
|
export default class App extends Component {
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<AppBar>
|
|
||||||
<div>
|
<div>
|
||||||
<Navigation type='horizontal' className="navigation">
|
<AppBar flat leftIcon="(Unleash)">
|
||||||
<Link href='' label='Feature Toggles' />
|
<Navigation />
|
||||||
<Link href='' active label='Strategies' />
|
|
||||||
<Link href='' active label='Documentation' />
|
|
||||||
</Navigation>
|
|
||||||
</div>
|
|
||||||
</AppBar>
|
</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