diff --git a/pages/shop/shop.pixy b/pages/shop/shop.pixy index bf018454..27215ba2 100644 --- a/pages/shop/shop.pixy +++ b/pages/shop/shop.pixy @@ -10,10 +10,12 @@ component Shop(user *arn.User, items []*arn.Item) component ShopTabs(user *arn.User) .tabs Tab("Support", "heart", "/support") - Tab("Shop", "shopping-cart", "/shop") - Tab("Inventory", "briefcase", "/inventory") - Tab("History", "history", "/shop/history") - Tab(strconv.Itoa(user.Balance), "diamond", "/charge") + + if user != nil + Tab("Shop", "shopping-cart", "/shop") + Tab("Inventory", "briefcase", "/inventory") + Tab("History", "history", "/shop/history") + Tab(strconv.Itoa(user.Balance), "diamond", "/charge") component ShopItem(item *arn.Item) .shop-item.mountable(data-item-id=item.ID) diff --git a/pages/support/support.go b/pages/support/support.go index 3eb1e643..ffc14835 100644 --- a/pages/support/support.go +++ b/pages/support/support.go @@ -1,8 +1,6 @@ package support import ( - "net/http" - "github.com/aerogo/aero" "github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/utils" @@ -11,10 +9,11 @@ import ( // Get support page. func Get(ctx *aero.Context) string { user := utils.GetUser(ctx) + profileLink := "/" - if user == nil { - return ctx.Error(http.StatusUnauthorized, "Not logged in", nil) + if user != nil { + profileLink = "/+" + user.Nick } - return ctx.HTML(components.Support(user)) + return ctx.HTML(components.Support(profileLink, user)) } diff --git a/pages/support/support.pixy b/pages/support/support.pixy index 349a7714..9d5abba5 100644 --- a/pages/support/support.pixy +++ b/pages/support/support.pixy @@ -1,4 +1,4 @@ -component Support(user *arn.User) +component Support(profileLink string, user *arn.User) ShopTabs(user) h1.mountable Why support us? @@ -79,7 +79,7 @@ component Support(user *arn.User) p.feature-card-text Lastly, activate the freshly bought item in your inventory. - a.feature-card.mountable.ajax(href="/+" + user.Nick) + a.feature-card.mountable.ajax(href=profileLink) .feature-card-icon RawIcon("user-circle")