From 2574e7e0e64e6855b17033b6e78509abe59384f0 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Sat, 23 Apr 2022 03:38:19 +0300 Subject: [PATCH] frontend: add username to top bar and improve paddings --- frontend/public/global.css | 16 ++++++++ .../pages/main/ChannelTopBar.svelte | 10 ----- .../src/components/pages/main/Sidebar.svelte | 39 ++++++++++++------- .../components/pages/main/UserTopBar.svelte | 15 +++++++ frontend/src/stores.js | 2 + 5 files changed, 57 insertions(+), 25 deletions(-) create mode 100644 frontend/src/components/pages/main/UserTopBar.svelte diff --git a/frontend/public/global.css b/frontend/public/global.css index b01dc11..23ebc36 100644 --- a/frontend/public/global.css +++ b/frontend/public/global.css @@ -63,6 +63,20 @@ body { background-color: var(--background-color-1); } +/* shared styles for all components */ + +.top-bar { + display: flex; + align-items: center; + justify-content: flex-start; + height: 3.4em; + width: 100%; + padding: var(--space-sm); + border-bottom: 1px solid var(--background-color-2); + flex-grow: 0; + flex-shrink: 0; +} + .h1 { font-size: 2.488rem; } @@ -87,6 +101,8 @@ body { font-size: 0.833rem; } +/* change box model */ + *, ::before, ::after { diff --git a/frontend/src/components/pages/main/ChannelTopBar.svelte b/frontend/src/components/pages/main/ChannelTopBar.svelte index 58cc462..72813be 100644 --- a/frontend/src/components/pages/main/ChannelTopBar.svelte +++ b/frontend/src/components/pages/main/ChannelTopBar.svelte @@ -5,16 +5,6 @@ + +
+ + { $userInfoStore.username } +
\ No newline at end of file diff --git a/frontend/src/stores.js b/frontend/src/stores.js index 13aee94..bf17a1f 100644 --- a/frontend/src/stores.js +++ b/frontend/src/stores.js @@ -13,12 +13,14 @@ class Store { const newLength = this._handlers.push(handler); const handlerIndex = newLength - 1; handler(this.value); + console.log(this.value); return () => { this._handlers.splice(handlerIndex, 1); }; } updated() { + console.log(this.value); this._handlers.forEach(e => { e(this.value); });