From 9d968b732260de023d3646f987d742ccd1ab72ce Mon Sep 17 00:00:00 2001 From: Ivar Date: Mon, 12 Sep 2016 21:39:54 +0200 Subject: [PATCH] added react-router #153 --- packages/unleash-frontend-next/index.html | 2 +- packages/unleash-frontend-next/package.json | 1 + packages/unleash-frontend-next/src/App.jsx | 21 ++++++++----------- .../unleash-frontend-next/src/Features.jsx | 15 +++++++++++++ .../unleash-frontend-next/src/Navigation.jsx | 15 +++++++++++++ .../unleash-frontend-next/src/Strategies.jsx | 10 +++++++++ packages/unleash-frontend-next/src/index.js | 5 ----- packages/unleash-frontend-next/src/index.jsx | 15 +++++++++++++ 8 files changed, 66 insertions(+), 18 deletions(-) create mode 100644 packages/unleash-frontend-next/src/Features.jsx create mode 100644 packages/unleash-frontend-next/src/Navigation.jsx create mode 100644 packages/unleash-frontend-next/src/Strategies.jsx delete mode 100644 packages/unleash-frontend-next/src/index.js create mode 100644 packages/unleash-frontend-next/src/index.jsx diff --git a/packages/unleash-frontend-next/index.html b/packages/unleash-frontend-next/index.html index ae65d99b7e..03531c870c 100644 --- a/packages/unleash-frontend-next/index.html +++ b/packages/unleash-frontend-next/index.html @@ -1,7 +1,7 @@ - Sample App + Unleash UI diff --git a/packages/unleash-frontend-next/package.json b/packages/unleash-frontend-next/package.json index bc1b0f9b06..b383ceda41 100644 --- a/packages/unleash-frontend-next/package.json +++ b/packages/unleash-frontend-next/package.json @@ -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" diff --git a/packages/unleash-frontend-next/src/App.jsx b/packages/unleash-frontend-next/src/App.jsx index 0df8deaa1a..36e5d6354a 100644 --- a/packages/unleash-frontend-next/src/App.jsx +++ b/packages/unleash-frontend-next/src/App.jsx @@ -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 ( - -
- - - - - -
-
+
+ + + + {this.props.children} +
); } }; diff --git a/packages/unleash-frontend-next/src/Features.jsx b/packages/unleash-frontend-next/src/Features.jsx new file mode 100644 index 0000000000..45cd7b72e0 --- /dev/null +++ b/packages/unleash-frontend-next/src/Features.jsx @@ -0,0 +1,15 @@ +import React, { Component } from 'react'; +import { Layout, Panel } from 'react-toolbox'; + + +export default class Features extends Component { + render () { + return ( + + +

Feture toggles

+
+
+ ); + } +}; diff --git a/packages/unleash-frontend-next/src/Navigation.jsx b/packages/unleash-frontend-next/src/Navigation.jsx new file mode 100644 index 0000000000..3c5596387c --- /dev/null +++ b/packages/unleash-frontend-next/src/Navigation.jsx @@ -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 ( + + Feature Toggles + Strategies + GitHub + + ); + } +}; diff --git a/packages/unleash-frontend-next/src/Strategies.jsx b/packages/unleash-frontend-next/src/Strategies.jsx new file mode 100644 index 0000000000..2a2606b8c6 --- /dev/null +++ b/packages/unleash-frontend-next/src/Strategies.jsx @@ -0,0 +1,10 @@ +import React, { Component } from 'react'; + + +export default class Strategies extends Component { + render () { + return ( +

Strategies

+ ); + } +}; diff --git a/packages/unleash-frontend-next/src/index.js b/packages/unleash-frontend-next/src/index.js deleted file mode 100644 index a22f17594a..0000000000 --- a/packages/unleash-frontend-next/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -ReactDOM.render(, document.getElementById('app')); diff --git a/packages/unleash-frontend-next/src/index.jsx b/packages/unleash-frontend-next/src/index.jsx new file mode 100644 index 0000000000..68bbdcd517 --- /dev/null +++ b/packages/unleash-frontend-next/src/index.jsx @@ -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(( + + + + + + +), document.getElementById('app'));