Create login view; Add footer

This commit is contained in:
Robbie Antenesse 2019-09-08 14:04:26 -06:00
parent 0934fea892
commit d5de474368
3 changed files with 35 additions and 1 deletions

View File

@ -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', () => {});

21
app/views/login/index.js Normal file
View File

@ -0,0 +1,21 @@
import html from 'choo/html';
export const loginPartial = (state, emit) => {
return html`<section>
<article class="card">
<div class="container wide">
<label>
<span>Email</span>
<input type="email" name="email">
</label>
<label>
<span>Password</span>
<input type="password" name="password">
</label>
<input type="submit" value="Log In!">
</div>
</article>
</section>`;
}

View File

@ -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) => {
<main class="container">
${htmlContent}
</main>
<footer>
<nav>
<div class="links">
<a href="https://gitlab.com/Alamantus/book-tracker" class="pseudo button">Repo</a>
<a href="https://gitter.im/book-tracker/general" class="pseudo button">Chat</a>
</div>
</nav>
</footer>
</body>`;
return view;