From d5de4743686f553b87ad4df7338dd13c7a3387a9 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Sun, 8 Sep 2019 14:04:26 -0600 Subject: [PATCH] Create login view; Add footer --- app/index.js | 2 +- app/views/login/index.js | 21 +++++++++++++++++++++ app/views/manager.js | 13 +++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 app/views/login/index.js 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;