Add Tip Jar link to sidebar more menu

This commit is contained in:
thePR0M3TH3AN committed 2025-10-27 18:02:32 -04:00
1 parent f72a8e4df5
commit 243b768be7
5 files changed
+45

No files matched your search

+22
View File
@@ -299,6 +299,28 @@
/>
<span class="sidebar-text">DNS</span>
</a>
<a
href="#"
data-tip-jar-link
class="sidebar-nav-link sidebar-nav-link--sub"
title="Tip Jar"
rel="noopener noreferrer"
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
class="sidebar-icon"
aria-hidden="true"
fill="currentColor"
>
<path
d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm0 18v-1.511h-.5v1.511h-1v-1.511h-2.484l.25-1.489h.539c.442 0 .695-.425.695-.854v-4.444c0-.416-.242-.702-.683-.702h-.817v-1.5h2.5v-1.5h1v1.5h.5v-1.5h1v1.526c2.158.073 3.012.891 3.257 1.812.29 1.09-.429 2.005-1.046 2.228.75.192 1.789.746 1.789 2.026 0 1.742-1.344 2.908-4 2.908v1.5h-1zm-.5-5.503v2.503c1.984 0 3.344-.188 3.344-1.258 0-1.148-1.469-1.245-3.344-1.245zm0-.997c1.105 0 2.789-.078 2.789-1.25 0-1-1.039-1.25-2.789-1.25v2.5z"
/>
</svg>
<span class="sidebar-text">Tip Jar</span>
</a>
</nav>
</div>
</footer>
+11
View File
@@ -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.
*
+3
View File
@@ -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");
}
+2
View File
@@ -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 };
+7
View File
@@ -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) => {