From 8df336ccad75e672773c88f6e16acfdd69363d7f Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 27 May 2024 02:17:05 +0300 Subject: [PATCH 1/5] chore(profile): remove first-name from context --- handlers/handler.go | 5 +---- handlers/keys.go | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/handlers/handler.go b/handlers/handler.go index 42d729f..6d13c35 100644 --- a/handlers/handler.go +++ b/handlers/handler.go @@ -39,7 +39,6 @@ func (a *Handler) OptionalAuthPage(h http.HandlerFunc) http.HandlerFunc { return } ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) h(w, r.WithContext(ctx)) }) } @@ -51,7 +50,6 @@ func (a *Handler) AuthPage(h http.HandlerFunc) http.HandlerFunc { profile, err := a.authenticate(r) authed := err == nil ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) switch { case authed && slices.Contains(noAuthPaths, r.URL.Path): @@ -87,7 +85,6 @@ func (a *Handler) OptionalAuthApi(h http.HandlerFunc) http.HandlerFunc { return } ctx := context.WithValue(r.Context(), ProfileIdKey, profile.Id) - ctx = context.WithValue(ctx, FullNameKey, profile.Name) h(w, r.WithContext(ctx)) } } @@ -132,7 +129,7 @@ func (a *Handler) authenticate(r *http.Request) (entities.Profile, error) { profileRepo. GetDB(). Model(&profile). - Select("id", "name"). + Select("id"). Where("username = ?", username). First(&profile). Error diff --git a/handlers/keys.go b/handlers/keys.go index 6eae5e5..affff75 100644 --- a/handlers/keys.go +++ b/handlers/keys.go @@ -12,6 +12,5 @@ const ( ProfileIdKey = "profile-id" ThemeKey = "theme-name" IsMobileKey = "is-mobile" - FullNameKey = "full-name" PlaylistPermission = "playlist-permission" ) From c6d5d90cd6a654334ac4c0eb7f236208e69e927d Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 27 May 2024 02:17:32 +0300 Subject: [PATCH 2/5] chore(header): remove name from mobile header --- views/components/header/header.templ | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/views/components/header/header.templ b/views/components/header/header.templ index 319f3d7..27d78cf 100644 --- a/views/components/header/header.templ +++ b/views/components/header/header.templ @@ -37,17 +37,6 @@ templ mobileHeader() { />

DankMuzikk

-
-

- if fullName, ok := ctx.Value("full-name").(string); ok { - Hi { fullName } 👋 - } else { - Hiyo 👋 - } -
- Wanna play something? -

-
@search.Search()
From 3c1d1ad41026feefd3ea13a06d157d4560528fce Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 27 May 2024 02:20:03 +0300 Subject: [PATCH 3/5] chore(search): move results a bit down --- views/components/search/search.templ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/components/search/search.templ b/views/components/search/search.templ index c9b9a9d..02b3923 100644 --- a/views/components/search/search.templ +++ b/views/components/search/search.templ @@ -42,7 +42,7 @@ templ Search() {
From 671a86795e156084def1b8dcc23bcb86f40099f6 Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 27 May 2024 02:28:17 +0300 Subject: [PATCH 4/5] chore(header): shrink the mobile header even more --- views/components/header/header.templ | 25 ++++++++++++++----------- views/components/search/search.templ | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/views/components/header/header.templ b/views/components/header/header.templ index 27d78cf..2367e8a 100644 --- a/views/components/header/header.templ +++ b/views/components/header/header.templ @@ -21,25 +21,28 @@ templ homeLinkContainer() { } templ mobileHeader() { -
+
@navlink.LinkContainer("/about", "About", icons.About()) - @themeswitch.ThemeSwitch() -
-
-
+
DankMuzikk Logo

DankMuzikk

-
- @search.Search() -
+ @themeswitch.ThemeSwitch() +
+
+ @search.Search()
} diff --git a/views/components/search/search.templ b/views/components/search/search.templ index 02b3923..e12ddf5 100644 --- a/views/components/search/search.templ +++ b/views/components/search/search.templ @@ -42,7 +42,7 @@ templ Search() {
From 89d9e24bd10a903da1699553fc7095c22890ee42 Mon Sep 17 00:00:00 2001 From: Baraa Al-Masri Date: Mon, 27 May 2024 02:29:40 +0300 Subject: [PATCH 5/5] fix(popover): z-index --- views/components/popover/popover.templ | 2 +- views/components/search/search.templ | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/components/popover/popover.templ b/views/components/popover/popover.templ index 073a0c3..18968dc 100644 --- a/views/components/popover/popover.templ +++ b/views/components/popover/popover.templ @@ -20,7 +20,7 @@ templ Popover(id, title string, button, child templ.Component) {
diff --git a/views/components/search/search.templ b/views/components/search/search.templ index e12ddf5..37607e4 100644 --- a/views/components/search/search.templ +++ b/views/components/search/search.templ @@ -42,7 +42,7 @@ templ Search() {