mirror of https://github.com/VERT-sh/VERT.git
feat: note if donating to unofficial instance
please dont change it to your stuff - we would really appreciate if donos go to us!
This commit is contained in:
parent
d713b05748
commit
2760838927
|
|
@ -232,7 +232,9 @@
|
|||
"thank_you": "Thank you for your donation!",
|
||||
"payment_failed": "Payment failed: {message}{period} You have not been charged.",
|
||||
"donation_error": "An error occurred while processing your donation. Please try again later.",
|
||||
"payment_error": "Error fetching payment details. Please try again later."
|
||||
"payment_error": "Error fetching payment details. Please try again later.",
|
||||
"donation_notice_official": "Your donations here go to the official VERT instance (vert.sh), and helps to support the development of the project.",
|
||||
"donation_notice_unofficial": "Your donations here go to the operator of this VERT instance. If you wish to support the official VERT developers, please visit [official_link]vert.sh[/official_link] instead."
|
||||
},
|
||||
"credits": {
|
||||
"title": "Credits",
|
||||
|
|
|
|||
|
|
@ -8,20 +8,20 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { goto } from "$app/navigation";
|
||||
|
||||
import { page } from "$app/state";
|
||||
|
||||
import {
|
||||
PUB_DONATION_URL,
|
||||
PUB_HOSTNAME,
|
||||
PUB_STRIPE_KEY,
|
||||
} from "$env/static/public";
|
||||
import { PUB_DONATION_URL, PUB_STRIPE_KEY } from "$env/static/public";
|
||||
const OFFICIAL_DONATION_URL = "https://donations.vert.sh";
|
||||
const OFFICIAL_STRIPE_KEY =
|
||||
"pk_live_51RDVmAGSxPVad6bQwzVNnbc28nlmzA30krLWk1fefCMpUPiSRPkavMMbGqa8A3lUaOCMlsUEVy2CWDYg0ip3aPpL00ZJlsMkf2";
|
||||
const isOfficial =
|
||||
PUB_DONATION_URL === OFFICIAL_DONATION_URL &&
|
||||
PUB_STRIPE_KEY === OFFICIAL_STRIPE_KEY;
|
||||
|
||||
// import { PUB_STRIPE_KEY, PUB_DONATION_API } from "$env/static/public";
|
||||
import { fade } from "$lib/animation";
|
||||
import FancyInput from "$lib/components/functional/FancyInput.svelte";
|
||||
import Panel from "$lib/components/visual/Panel.svelte";
|
||||
import { effects } from "$lib/store/index.svelte";
|
||||
import { effects, link, sanitize } from "$lib/store/index.svelte";
|
||||
import {
|
||||
loadStripe,
|
||||
type Stripe,
|
||||
|
|
@ -39,6 +39,7 @@
|
|||
import { quintOut } from "svelte/easing";
|
||||
import { m } from "$lib/paraglide/messages";
|
||||
import { ToastManager } from "$lib/toast/index.svelte";
|
||||
import { log } from "$lib/logger";
|
||||
|
||||
let amount = $state(1);
|
||||
let customAmount = $state("");
|
||||
|
|
@ -90,6 +91,18 @@
|
|||
|
||||
onMount(async () => {
|
||||
stripe = await loadStripe(PUB_STRIPE_KEY);
|
||||
|
||||
if (!isOfficial) {
|
||||
log(
|
||||
["about", "donate"],
|
||||
"donations are being sent to an unofficial VERT instance - PUB_DONATION_URL and/or PUB_STRIPE_KEY have been changed.",
|
||||
);
|
||||
} else {
|
||||
log(
|
||||
["about", "donate"],
|
||||
"donations are being sent to the official VERT instance.",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const donate = async () => {
|
||||
|
|
@ -328,4 +341,20 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="text-sm font-normal text-muted">
|
||||
{#if isOfficial}
|
||||
{m["about.donate.donation_notice_official"]()}
|
||||
{:else}
|
||||
{@html sanitize(
|
||||
link(
|
||||
"official_link",
|
||||
m["about.donate.donation_notice_unofficial"](),
|
||||
"https://vert.sh",
|
||||
true,
|
||||
"",
|
||||
),
|
||||
)}
|
||||
{/if}
|
||||
</p>
|
||||
</Panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue