mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-04-19 18:31:18 +00:00
shrink and simplify ui, show link to source code.
This commit is contained in:
parent
f0257eb0c8
commit
28e4d1aeb3
@ -39,13 +39,7 @@ func userRowComponent(ctx context.Context, profile sdk.ProfileMetadata, loggedUs
|
||||
}
|
||||
|
||||
func userNameComponent(profile sdk.ProfileMetadata) HTMLComponent {
|
||||
return A().Href("nostr:" + profile.Npub()).Target("_blank").Children(
|
||||
Span(profile.ShortName()).Attr(
|
||||
"npub", profile.Npub(),
|
||||
"name", profile.ShortName(),
|
||||
"_", `
|
||||
on mouseenter set my innerText to @npub then hide the next <button />
|
||||
on mouseleave set my innerText to @name then show the next <button />`,
|
||||
),
|
||||
return A().Href("https://nosta.me/" + profile.Npub()).Target("_blank").Children(
|
||||
Span(profile.ShortName()).Attr("title", profile.Npub()),
|
||||
).Class("font-mono py-1")
|
||||
}
|
||||
|
10
pages.go
10
pages.go
@ -36,7 +36,11 @@ on click if my innerText is equal to "login" get window.nostr.signEvent({created
|
||||
on load get cookies['nip98'] then if it is undefined set my innerText to "login" otherwise set my innerText to "logout"`),
|
||||
).Class("flex flex-1 items-center justify-center"),
|
||||
Main(inside).Class("m-4"),
|
||||
).Class("mx-4 my-6"),
|
||||
P(
|
||||
Text("powered by "),
|
||||
A().Href("https://github.com/github-tijlxyz/khatru-invite").Text("khatru-invite").Class("hover:underline cursor-pointer text-blue-500"),
|
||||
).Class("text-end my-4 text-sm"),
|
||||
).Class("my-6 mx-auto max-w-min min-w-96"),
|
||||
)
|
||||
}
|
||||
|
||||
@ -50,13 +54,13 @@ func inviteTreePageHTML(ctx context.Context, params InviteTreePageParams) HTMLCo
|
||||
if params.loggedUser != "" {
|
||||
inviteForm = Form(
|
||||
Input("pubkey").Type("text").Placeholder("npub1...").Class("w-96 rounded-md border-0 p-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600"),
|
||||
Button("invite").Class(buttonClass+" p-2 bg-white hover:bg-gray-50"),
|
||||
Button("invite").Class(buttonClass+" ml-2 p-2 bg-white hover:bg-gray-50"),
|
||||
).Attr(
|
||||
"hx-post", "/add-to-whitelist",
|
||||
"hx-trigger", "submit",
|
||||
"hx-target", "#tree",
|
||||
"_", "on htmx:afterRequest(elt, successful) if successful and elt is I call I.reset()",
|
||||
)
|
||||
).Class("flex")
|
||||
}
|
||||
|
||||
return Div(
|
||||
|
Loading…
x
Reference in New Issue
Block a user