updated/consolidated lit+zustand
This commit is contained in:
parent
648412dd6d
commit
2178304c76
7 changed files with 83 additions and 307 deletions
|
|
@ -6,7 +6,6 @@ import "./page-home.js";
|
|||
import "./page-items.js";
|
||||
|
||||
class AppRoot extends LitElement {
|
||||
#hydrated = new StoreController(this, store, s => s._hydrated);
|
||||
#user = new StoreController(this, store, s => s.user);
|
||||
#route = new StoreController(this, store, s => s.route);
|
||||
|
||||
|
|
@ -15,19 +14,9 @@ class AppRoot extends LitElement {
|
|||
display: block;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
height: 100vh;
|
||||
opacity: 0.4;
|
||||
}
|
||||
`;
|
||||
|
||||
render() {
|
||||
if (!this.#hydrated.value) {
|
||||
return html`<div class="loading">loading...</div>`;
|
||||
}
|
||||
return html`
|
||||
<nav-bar .user=${this.#user.value}></nav-bar>
|
||||
<main>${this.#renderRoute()}</main>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue