Created
January 29, 2016 21:48
-
-
Save vonwao/8672a74769e439460685 to your computer and use it in GitHub Desktop.
mantra sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {FlowRouter} from 'meteor/kadira:flow-router'; | |
import {mount} from 'react-mounter'; | |
import MainLayout from '/client/modules/core/components/layout.main.jsx'; | |
import PostList from '/client/modules/core/containers/postlist'; | |
import Post from '/client/modules/core/containers/post'; | |
import NewPost from '/client/modules/core/containers/newpost'; | |
export default function (injectDeps) { | |
const MainLayoutCtx = injectDeps(MainLayout); | |
// Move these as a module and call this from a main file | |
FlowRouter.route('/', { | |
name: 'posts.list', | |
action() { | |
mount(MainLayoutCtx, { | |
content: () => (<PostList />) | |
}); | |
} | |
}); | |
FlowRouter.route('/post/:postId', { | |
name: 'posts.single', | |
action({postId}) { | |
mount(MainLayoutCtx, { | |
content: () => (<Post postId={postId}/>) | |
}); | |
} | |
}); | |
FlowRouter.route('/new-post', { | |
name: 'newpost', | |
action() { | |
mount(MainLayoutCtx, { | |
content: () => (<NewPost/>) | |
}); | |
} | |
}); | |
FlowRouter.route('/ex1', { | |
name: 'newpost', | |
action() { | |
mount(MainLayoutCtx, { | |
content: () => (<NewPost/>) | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment