Skip to content

Commit

Permalink
chore(navlink): add loading status
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed May 26, 2024
1 parent b376803 commit c7f3645
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions views/components/navlink/navlink.templ
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ templ NavLink(title, imageUrl, path string, showTilte ...bool) {
hx-swap="innerHTML"
hx-trigger="click,submit"
hx-on::after-request={ updateStyle() }
data-loading-target="#loading"
data-loading-class-remove="hidden"
data-loading-path={ path + "?no_layout=true" }
>
if imageUrl != "" {
<div class={ "flex", "gap-x-3", "items-center" }>
Expand Down Expand Up @@ -45,6 +48,9 @@ templ JustLink(path, title string, child templ.Component) {
hx-swap="innerHTML"
hx-trigger="click,submit"
hx-on::after-request={ updateStyle() }
data-loading-target="#loading"
data-loading-class-remove="hidden"
data-loading-path={ path + "?no_layout=true" }
>
<div
id={ path }
Expand Down

0 comments on commit c7f3645

Please sign in to comment.