1
0
Fork 0
mirror of https://gitlab.com/Alamantus/Readlebee.git synced 2025-07-07 00:24:17 +02:00
Readlebee/app/views/home/index.js

19 lines
695 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-13 22:43:07 -06:00
import { loggedOutView } from './loggedOut';
2019-10-17 20:56:57 -06:00
import { loggedInView } from './loggedIn';
// This is the view function that is exported and used in the view manager.
export const homeView = (state, emit, i18n) => {
const controller = new HomeController(state, i18n);
// 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-13 22:43:07 -06:00
(!controller.isLoggedIn
? loggedOutView(controller, emit)
2019-10-17 20:56:57 -06:00
: loggedInView(controller, emit)
2019-09-13 22:43:07 -06:00
),
];
}