diff --git a/app/index.js b/app/index.js index 2be2c2d..092f5fa 100644 --- a/app/index.js +++ b/app/index.js @@ -27,7 +27,7 @@ app.use((state, emitter) => { } }); - emitter.on('changeView', newView => { + emitter.on('change-view', newView => { // Change the view and call render. Makes it easier to call within views. state.currentView = newView; emitter.emit('render', () => {}); diff --git a/app/views/login/index.js b/app/views/login/index.js new file mode 100644 index 0000000..8831924 --- /dev/null +++ b/app/views/login/index.js @@ -0,0 +1,21 @@ +import html from 'choo/html'; + +export const loginPartial = (state, emit) => { + return html`
+ +
+
+ + + +
+
+ +
`; +} \ No newline at end of file diff --git a/app/views/manager.js b/app/views/manager.js index dc3ebc6..4c2336e 100644 --- a/app/views/manager.js +++ b/app/views/manager.js @@ -13,6 +13,10 @@ export const viewManager = (state, emit) => { htmlContent = homeView(state, emit); break; } + case 'login': { + htmlContent = loginView(state, emit); + break; + } case 'search': { htmlContent = searchView(state, emit); break; @@ -49,6 +53,15 @@ export const viewManager = (state, emit) => {
${htmlContent}
+ + `; return view;