f189ad978728aad3e52f1f7a6914dc5741e222a0

Author
TheEdgeOfClaw <openclaw@theedgeofrage.com>
Committer
GitHub <noreply@github.com>
Date

Message

Replace shorts toggle button text with icon on channels page (#3)

Diff

This diff is truncated to protect this page.

 1diff --git a/pages/channels.templ b/pages/channels.templ
 2index 421796fa7e55d7a4f0693ca62c968efb5cefb0cf..0b22722f3af7acd02098acbadbbb6940a6a53a9f 100644
 3--- a/pages/channels.templ
 4+++ b/pages/channels.templ
 5@@ -43,8 +43,16 @@ templ shortsToggle(channel models.Channel) {
 6 		hx-vals={ fmt.Sprintf(`{"enable": %t}`, !channel.EnableShorts) }
 7 		hx-target={ fmt.Sprintf("#channel-card-%s", channel.ID) }
 8 		hx-swap="outerHTML"
 9+		title={ toggleLabel(channel.EnableShorts) }
10 	>
11-		{ toggleLabel(channel.EnableShorts) }
12+		<svg
13+			xmlns="http://www.w3.org/2000/svg"
14+			height="24"
15+			viewBox="0 0 24 24"
16+			width="24"
17+			focusable="false"
18+			fill="currentColor"
19+		><path d="m13.974 2.052-8 4.7a4 4 0 00.385 7.097l.942.423-1.327.78a4 4 0 004.052 6.897l8-4.7a4.001 4.001 0 00-.384-7.096L16.7 9.73l1.326-.78a4 4 0 10-4.052-6.897ZM10 15V9l5 3-5 3Z"></path></svg>
20 	</a>
21 }
22 
23diff --git a/pages/channels_templ.go b/pages/channels_templ.go
24index ae614d9390b80a3e9fad516065a3bd0abf39c01f..e70c2dcb433001e9a960c0d018f27568c7a85fe0 100644
25--- a/pages/channels_templ.go
26+++ b/pages/channels_templ.go
27@@ -173,20 +173,20 @@ func shortsToggle(channel models.Channel) templ.Component {
28 		if templ_7745c5c3_Err != nil {
29 			return templ_7745c5c3_Err
30 		}
31-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" hx-swap=\"outerHTML\">")
32+		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" hx-swap=\"outerHTML\" title=\"")
33 		if templ_7745c5c3_Err != nil {
34 			return templ_7745c5c3_Err
35 		}
36 		var templ_7745c5c3_Var12 string
37 		templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(toggleLabel(channel.EnableShorts))
38 		if templ_7745c5c3_Err != nil {
39-			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/channels.templ`, Line: 47, Col: 37}
40+			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/channels.templ`, Line: 46, Col: 43}
41 		}
42 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
43 		if templ_7745c5c3_Err != nil {
44 			return templ_7745c5c3_Err
45 		}
46-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</a>")