Added ability to change username
This commit is contained in:
@@ -29,27 +29,35 @@ templ SelectMenu(activePage string) {
|
||||
menuItems := getMenuItems()
|
||||
page := fmt.Sprintf("{page:'%s'}", activePage)
|
||||
}}
|
||||
<div class="flex w-fit flex-col border-e bg-surface0 rounded-l-xl">
|
||||
<div class="px-4 py-6">
|
||||
<ul class="mt-6 space-y-1" x-data={ page }>
|
||||
for _, item := range menuItems {
|
||||
{{
|
||||
<form
|
||||
class="flex bg-surface0 w-fit border-e border-overlay0
|
||||
rounded-l-xl"
|
||||
hx-post="/account-select-page"
|
||||
hx-target="#account-container"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<div>
|
||||
<div class="px-4 py-6">
|
||||
<ul class="mt-6 space-y-1" x-data={ page }>
|
||||
for _, item := range menuItems {
|
||||
{{
|
||||
activebind := fmt.Sprintf("page === '%s' && 'bg-mantle'", item.name)
|
||||
}}
|
||||
<li>
|
||||
<button
|
||||
type="submit"
|
||||
name="subpage"
|
||||
value={ item.name }
|
||||
class="block rounded-lg px-4 py-2 text-md
|
||||
}}
|
||||
<li>
|
||||
<button
|
||||
type="submit"
|
||||
name="subpage"
|
||||
value={ item.name }
|
||||
class="block rounded-lg px-4 py-2 text-md
|
||||
hover:bg-mantle hover:cursor-pointer"
|
||||
:class={ activebind }
|
||||
>
|
||||
{ item.name }
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
:class={ activebind }
|
||||
>
|
||||
{ item.name }
|
||||
</button>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user