Make profile card entierely clickable.Unverified
02fcf1e parent: 83ee19e modified
internal/tmpl/partials/profile-card.html +4 -3 | @@ -1,8 +1,8 @@ | ||
| 1 | 1 | {{define "profile-card.html"}} |
| 2 | -<div class="bg-spot-surface rounded-xl p-4 flex items-center gap-3 hover:bg-spot-hover-50 transition relative group"> | |
| 2 | +<a href="/profile/{{.DID}}" class="bg-spot-surface rounded-xl p-4 flex items-center gap-3 hover:bg-spot-hover-50 transition relative group"> | |
| 3 | 3 | {{if .AvatarURL}}<img src="{{.AvatarURL}}" class="w-10 h-10 rounded-full">{{end}} |
| 4 | 4 | <div class="min-w-0 flex-1"> |
| 5 | - <a href="/profile/{{.DID}}" class="font-bold text-spot-text hover:text-spot-green transition">@{{.Handle}}</a> | |
| 5 | + <span class="font-bold text-spot-text hover:text-spot-green transition">@{{.Handle}}</span> | |
| 6 | 6 | {{if .IsFollowed}} |
| 7 | 7 | <span class="inline-flex items-center gap-0.5 text-[10px] font-medium text-spot-green bg-spot-green/10 px-1.5 py-0.5 rounded-full ml-1.5">Following</span> |
| 8 | 8 | {{end}} |
| @@ -12,9 +12,10 @@ | ||
| 12 | 12 | {{if not .IsFollowed}} |
| 13 | 13 | <button hx-post="/recs/dismiss-person" hx-target="closest .group" hx-swap="outerHTML swap:0.3s" |
| 14 | 14 | hx-vals='{"target_did": "{{.DID}}"}' |
| 15 | + onclick="event.preventDefault(); event.stopPropagation();" | |
| 15 | 16 | class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition text-spot-muted hover:text-spot-red p-1 rounded-md hover:bg-spot-red/10" title="Hide"> |
| 16 | 17 | <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> |
| 17 | 18 | </button> |
| 18 | 19 | {{end}} |
| 19 | -</div> | |
| 20 | +</a> | |
| 20 | 21 | {{end}} |
| @@ -1,8 +1,8 @@ | |||
| 1 | {{define "profile-card.html"}} | 1 | {{define "profile-card.html"}} |
| 2 | -<div class="bg-spot-surface rounded-xl p-4 flex items-center gap-3 hover:bg-spot-hover-50 transition relative group"> | 2 | +<a href="/profile/{{.DID}}" class="bg-spot-surface rounded-xl p-4 flex items-center gap-3 hover:bg-spot-hover-50 transition relative group"> |
| 3 | {{if .AvatarURL}}<img src="{{.AvatarURL}}" class="w-10 h-10 rounded-full">{{end}} | 3 | {{if .AvatarURL}}<img src="{{.AvatarURL}}" class="w-10 h-10 rounded-full">{{end}} |
| 4 | <div class="min-w-0 flex-1"> | 4 | <div class="min-w-0 flex-1"> |
| 5 | - <a href="/profile/{{.DID}}" class="font-bold text-spot-text hover:text-spot-green transition">@{{.Handle}}</a> | 5 | + <span class="font-bold text-spot-text hover:text-spot-green transition">@{{.Handle}}</span> |
| 6 | {{if .IsFollowed}} | 6 | {{if .IsFollowed}} |
| 7 | <span class="inline-flex items-center gap-0.5 text-[10px] font-medium text-spot-green bg-spot-green/10 px-1.5 py-0.5 rounded-full ml-1.5">Following</span> | 7 | <span class="inline-flex items-center gap-0.5 text-[10px] font-medium text-spot-green bg-spot-green/10 px-1.5 py-0.5 rounded-full ml-1.5">Following</span> |
| 8 | {{end}} | 8 | {{end}} |
| @@ -12,9 +12,10 @@ | |||
| 12 | {{if not .IsFollowed}} | 12 | {{if not .IsFollowed}} |
| 13 | <button hx-post="/recs/dismiss-person" hx-target="closest .group" hx-swap="outerHTML swap:0.3s" | 13 | <button hx-post="/recs/dismiss-person" hx-target="closest .group" hx-swap="outerHTML swap:0.3s" |
| 14 | hx-vals='{"target_did": "{{.DID}}"}' | 14 | hx-vals='{"target_did": "{{.DID}}"}' |
| 15 | + onclick="event.preventDefault(); event.stopPropagation();" | ||
| 15 | class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition text-spot-muted hover:text-spot-red p-1 rounded-md hover:bg-spot-red/10" title="Hide"> | 16 | class="absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition text-spot-muted hover:text-spot-red p-1 rounded-md hover:bg-spot-red/10" title="Hide"> |
| 16 | <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> | 17 | <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg> |
| 17 | </button> | 18 | </button> |
| 18 | {{end}} | 19 | {{end}} |
| 19 | -</div> | 20 | +</a> |
| 20 | {{end}} | 21 | {{end}} |