Home
/
risinglegends.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cbfebd1
)
fix: add button that goes back to town from any page
author
xangelo
<me@xangelo.ca>
Thu, 31 Aug 2023 21:08:26 +0000
(17:08 -0400)
committer
xangelo
<me@xangelo.ca>
Thu, 31 Aug 2023 21:08:26 +0000
(17:08 -0400)
src/server/views/components/button.ts
patch
|
blob
|
history
diff --git
a/src/server/views/components/button.ts
b/src/server/views/components/button.ts
index a6daca0784cf6a282817b102c85ff3f3a10ff332..11a9948ca9875fc2e938ca55b0ddfc5cd61b2a10 100644
(file)
--- a/
src/server/views/components/button.ts
+++ b/
src/server/views/components/button.ts
@@
-33,3
+33,11
@@
export function Button(attrs: CoreAttributes & Record<string, any>, value: strin
return `<button ${attributes.join(" ")}>${value}</button>`;
}
+
+export function BackToTown(): string {
+ return Button({
+ 'id': 'back-to-town',
+ 'hx-get': '/player/explore',
+ 'hx-target': '#explore'
+ }, 'Back to Town');
+}