wip
This commit is contained in:
@@ -7,15 +7,16 @@ const route = require('page');
|
||||
let page = null;
|
||||
|
||||
export default me => {
|
||||
route('/', index);
|
||||
route('/i>mentions', mentions);
|
||||
route('/channel', channels);
|
||||
route('/post::post', post);
|
||||
route('/search::query', search);
|
||||
route('/:user', user.bind(null, 'home'));
|
||||
route('/:user/graphs', user.bind(null, 'graphs'));
|
||||
route('/:user/:post', post);
|
||||
route('*', notFound);
|
||||
route('/', index);
|
||||
route('/i>mentions', mentions);
|
||||
route('/channel', channels);
|
||||
route('/channel/:channel', channel);
|
||||
route('/post::post', post);
|
||||
route('/search::query', search);
|
||||
route('/:user', user.bind(null, 'home'));
|
||||
route('/:user/graphs', user.bind(null, 'graphs'));
|
||||
route('/:user/:post', post);
|
||||
route('*', notFound);
|
||||
|
||||
function index() {
|
||||
me ? home() : entrance();
|
||||
@@ -55,6 +56,12 @@ export default me => {
|
||||
mount(el);
|
||||
}
|
||||
|
||||
function channel(ctx) {
|
||||
const el = document.createElement('mk-channel-page');
|
||||
el.setAttribute('id', ctx.params.channel);
|
||||
mount(el);
|
||||
}
|
||||
|
||||
function channels() {
|
||||
mount(document.createElement('mk-channels-page'));
|
||||
}
|
||||
@@ -72,6 +79,7 @@ export default me => {
|
||||
};
|
||||
|
||||
function mount(content) {
|
||||
document.documentElement.style.background = '#313a42';
|
||||
document.documentElement.removeAttribute('data-page');
|
||||
if (page) page.unmount();
|
||||
const body = document.getElementById('app');
|
||||
|
Reference in New Issue
Block a user