Monorepo for Tangled

appview/pages: move to pattern where icon is replaced with loader circle

this avoids changing the width of buttons when a request is inflight.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 9259beb1 6fdd3762

verified
+11 -8
+3 -3
appview/pages/templates/fragments/starBtn.html
··· 15 hx-disabled-elt="#starBtn" 16 > 17 {{ if .IsStarred }} 18 - {{ i "star" "w-4 h-4 fill-current" }} 19 {{ else }} 20 - {{ i "star" "w-4 h-4" }} 21 {{ end }} 22 <span class="text-sm"> 23 {{ .StarCount }} 24 </span> 25 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 26 </button> 27 {{ end }}
··· 15 hx-disabled-elt="#starBtn" 16 > 17 {{ if .IsStarred }} 18 + {{ i "star" "w-4 h-4 fill-current inline group-[.htmx-request]:hidden" }} 19 {{ else }} 20 + {{ i "star" "w-4 h-4 inline group-[.htmx-request]:hidden" }} 21 {{ end }} 22 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 23 <span class="text-sm"> 24 {{ .StarCount }} 25 </span> 26 </button> 27 {{ end }}
+2 -2
appview/pages/templates/repo/pulls/fragments/pullActions.html
··· 38 hx-vals='{"branch": "{{ .BranchDeleteStatus.Branch }}" }' 39 hx-swap="none" 40 class="btn-flat p-2 flex items-center gap-2 no-underline hover:no-underline group text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300"> 41 - {{ i "git-branch" "w-4 h-4" }} 42 - <span>delete branch</span> 43 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 44 </button> 45 {{ end }} 46 {{ if and $isPushAllowed $isOpen $isLastRound }}
··· 38 hx-vals='{"branch": "{{ .BranchDeleteStatus.Branch }}" }' 39 hx-swap="none" 40 class="btn-flat p-2 flex items-center gap-2 no-underline hover:no-underline group text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300"> 41 + {{ i "git-branch" "w-4 h-4 inline group-[.htmx-request]:hidden" }} 42 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 43 + delete branch 44 </button> 45 {{ end }} 46 {{ if and $isPushAllowed $isOpen $isLastRound }}
+6 -3
appview/pages/templates/user/fragments/follow.html
··· 13 hx-swap="outerHTML" 14 > 15 {{ if eq .FollowStatus.String "IsNotFollowing" }} 16 - {{ i "user-round-plus" "w-4 h-4" }} follow 17 {{ else }} 18 - {{ i "user-round-minus" "w-4 h-4" }} unfollow 19 {{ end }} 20 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 21 </button> 22 {{ end }}
··· 13 hx-swap="outerHTML" 14 > 15 {{ if eq .FollowStatus.String "IsNotFollowing" }} 16 + {{ i "user-round-plus" "size-4 inline group-[.htmx-request]:hidden" }} 17 + {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 18 + follow 19 {{ else }} 20 + {{ i "user-round-minus" "size-4 inline group-[.htmx-request]:hidden" }} 21 + {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }} 22 + unfollow 23 {{ end }} 24 </button> 25 {{ end }}