From 243b768be7ba12520bf10e1e71c16e2f48044375 Mon Sep 17 00:00:00 2001
From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
Date: Mon, 27 Oct 2025 18:02:32 -0400
Subject: [PATCH] Add Tip Jar link to sidebar more menu
---
components/sidebar.html | 22 ++++++++++++++++++++++
config/instance-config.js | 11 +++++++++++
config/validate-config.js | 3 +++
js/config.js | 2 ++
js/index.js | 7 +++++++
5 files changed, 45 insertions(+)
diff --git a/components/sidebar.html b/components/sidebar.html
index 46966c9b..a2aa5c9f 100644
--- a/components/sidebar.html
+++ b/components/sidebar.html
@@ -299,6 +299,28 @@
/>
+
diff --git a/config/instance-config.js b/config/instance-config.js
index f2c341d5..93fe02f6 100644
--- a/config/instance-config.js
+++ b/config/instance-config.js
@@ -119,6 +119,17 @@ export const BETA_URL = "https://beta.bitvid.network/";
*/
export const DNS_URL = "https://bitvid.network/";
+/**
+ * Optional external destination for the Tip Jar menu link.
+ *
+ * Configure this with the Lightning tipping experience you want to surface in
+ * the sidebar dropup. When left empty (null or an empty string) the Tip Jar
+ * entry is removed entirely so operators that do not collect donations are not
+ * forced to show the control.
+ */
+export const TIP_JAR_URL =
+ "https://nostrtipjar.netlify.app/?n=npub13yarr7j6vjqjjkahd63dmr27curypehx45ucue286ac7sft27y0srnpmpe";
+
/**
* Default image included in automated moderation DMs.
*
diff --git a/config/validate-config.js b/config/validate-config.js
index f0edc3e0..83118535 100644
--- a/config/validate-config.js
+++ b/config/validate-config.js
@@ -14,6 +14,7 @@ import {
GITHUB_URL,
BETA_URL,
DNS_URL,
+ TIP_JAR_URL,
} from "./instance-config.js";
function assertSuperAdminConfigured(value) {
@@ -123,6 +124,7 @@ function resolveConfig(overrides = {}) {
githubUrl: overrides.GITHUB_URL ?? GITHUB_URL,
betaUrl: overrides.BETA_URL ?? BETA_URL,
dnsUrl: overrides.DNS_URL ?? DNS_URL,
+ tipJarUrl: overrides.TIP_JAR_URL ?? TIP_JAR_URL,
};
}
@@ -178,4 +180,5 @@ export function validateInstanceConfig(overrides) {
assertOptionalHttpUrl(config.githubUrl, "GITHUB_URL");
assertOptionalHttpUrl(config.betaUrl, "BETA_URL");
assertOptionalHttpUrl(config.dnsUrl, "DNS_URL");
+ assertOptionalHttpUrl(config.tipJarUrl, "TIP_JAR_URL");
}
diff --git a/js/config.js b/js/config.js
index 2864a36d..32c5c207 100644
--- a/js/config.js
+++ b/js/config.js
@@ -14,6 +14,7 @@ import {
GITHUB_URL,
BETA_URL,
DNS_URL,
+ TIP_JAR_URL,
MAX_WALLET_DEFAULT_ZAP,
PLATFORM_FEE_PERCENT,
PLATFORM_LUD16_OVERRIDE,
@@ -70,6 +71,7 @@ export { NOSTR_URL };
export { GITHUB_URL };
export { BETA_URL };
export { DNS_URL };
+export { TIP_JAR_URL };
export { MAX_WALLET_DEFAULT_ZAP };
export { PLATFORM_FEE_PERCENT };
export { PLATFORM_LUD16_OVERRIDE };
diff --git a/js/index.js b/js/index.js
index c9d5f167..e2189682 100644
--- a/js/index.js
+++ b/js/index.js
@@ -26,6 +26,7 @@ import {
GITHUB_URL,
BETA_URL,
DNS_URL,
+ TIP_JAR_URL,
isLockdownMode,
} from "./config.js";
import AuthService from "./services/authService.js";
@@ -664,6 +665,12 @@ async function bootstrapInterface() {
label: "Sidebar DNS link",
});
+ bindOptionalExternalLink({
+ selector: "[data-tip-jar-link]",
+ url: TIP_JAR_URL,
+ label: "Sidebar Tip Jar link",
+ });
+
const headerSearchForm = document.getElementById("headerSearchForm");
if (headerSearchForm) {
headerSearchForm.addEventListener("submit", async (event) => {