Readlebee/app/views/home/index.js

18 lines
650 B
JavaScript
Raw Normal View History

import html from 'choo/html';
import { HomeController } from './controller'; // The controller for this view, where processing should happen.
2019-09-14 06:43:07 +02:00
import { loggedOutView } from './loggedOut';
// This is the view function that is exported and used in the view manager.
export const homeView = (state, emit) => {
const controller = new HomeController(state);
// Returning an array in a view allows non-shared parent HTML elements.
// This one doesn't have the problem right now, but it's good to remember.
return [
2019-09-14 06:43:07 +02:00
(!controller.isLoggedIn
? loggedOutView(controller, emit)
: html`<p>lol wut how are u logged in</p>`
),
];
}