about summary refs log tree commit diff
path: root/app/assets/javascripts/components/containers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-13 02:24:40 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-13 02:24:40 +0200
commit2e7aac793ace0e938e45cb54ff601afa5d872214 (patch)
tree5c45c25a21ef9b1068604b8c459e1855ba91f239 /app/assets/javascripts/components/containers
parentd6a64f45fd4530cfee4f7721f0c6e7ca28fe677f (diff)
Adding sense of self to the UI, cleaning up routing, adding third (detail) column
Diffstat (limited to 'app/assets/javascripts/components/containers')
-rw-r--r--app/assets/javascripts/components/containers/navigation_container.jsx8
-rw-r--r--app/assets/javascripts/components/containers/root.jsx22
2 files changed, 20 insertions, 10 deletions
diff --git a/app/assets/javascripts/components/containers/navigation_container.jsx b/app/assets/javascripts/components/containers/navigation_container.jsx
new file mode 100644
index 000000000..4aeea4c37
--- /dev/null
+++ b/app/assets/javascripts/components/containers/navigation_container.jsx
@@ -0,0 +1,8 @@
+import { connect }   from 'react-redux';
+import NavigationBar from '../components/navigation_bar';
+
+const mapStateToProps = (state, props) => ({
+  account: state.getIn(['timelines', 'accounts', state.getIn(['timelines', 'me'])])
+});
+
+export default connect(mapStateToProps)(NavigationBar);
diff --git a/app/assets/javascripts/components/containers/root.jsx b/app/assets/javascripts/components/containers/root.jsx
index e2baefa24..1ded95d3c 100644
--- a/app/assets/javascripts/components/containers/root.jsx
+++ b/app/assets/javascripts/components/containers/root.jsx
@@ -3,25 +3,25 @@ import configureStore                                                        fro
 import Frontend                                                              from '../components/frontend';
 import { setTimeline, updateTimeline, deleteFromTimelines, refreshTimeline } from '../actions/timelines';
 import { setAccessToken }                                                    from '../actions/meta';
+import { setAccountSelf }                                                    from '../actions/accounts';
 import PureRenderMixin                                                       from 'react-addons-pure-render-mixin';
-import { Router, Route, createMemoryHistory }                                from 'react-router';
-import AccountRoute                                                          from '../routes/account_route';
-import StatusRoute                                                           from '../routes/status_route';
+import { Router, Route, hashHistory }                                        from 'react-router';
 
-const store   = configureStore();
-const history = createMemoryHistory();
+const store = configureStore();
 
 const Root = React.createClass({
 
   propTypes: {
     token: React.PropTypes.string.isRequired,
-    timelines: React.PropTypes.object
+    timelines: React.PropTypes.object,
+    account: React.PropTypes.string
   },
 
   mixins: [PureRenderMixin],
 
   componentWillMount() {
     store.dispatch(setAccessToken(this.props.token));
+    store.dispatch(setAccountSelf(JSON.parse(this.props.account)));
 
     for (var timelineType in this.props.timelines) {
       if (this.props.timelines.hasOwnProperty(timelineType)) {
@@ -53,10 +53,12 @@ const Root = React.createClass({
   render () {
     return (
       <Provider store={store}>
-        <Router history={history}>
-          <Route path="/" component={Frontend}>
-            <Route path="/accounts/:account_id" component={AccountRoute} />
-            <Route path="/statuses/:status_id" component={StatusRoute} />
+        <Router history={hashHistory}>
+          <Route path='/' component={Frontend}>
+            <Route path='/settings' component={null} />
+            <Route path='/subscriptions' component={null} />
+            <Route path='/statuses/:statusId' component={null} />
+            <Route path='/accounts/:accountId' component={null} />
           </Route>
         </Router>
       </Provider>