diff --git a/packages/app/src/Element/ZapButton.tsx b/packages/app/src/Element/ZapButton.tsx index 97c600d2..873a72f8 100644 --- a/packages/app/src/Element/ZapButton.tsx +++ b/packages/app/src/Element/ZapButton.tsx @@ -25,10 +25,10 @@ const ZapButton = ({ return ( <> -
setZap(true)}> - +
+ { const [splits, setSplits] = useState([]); const [today, setSumToday] = useState(); + const [onChain, setOnChain] = useState(""); const api = new SnortApi(ApiHost); + async function getOnChainAddress() { + const { address } = await api.onChainDonation(); + setOnChain(address); + } + async function loadData() { const rsp = await api.revenueSplits(); setSplits(rsp); @@ -103,24 +113,43 @@ const DonatePage = () => {

-
-
-
- +
+
+
+ + + + +
+ {today && ( + + + + )} +
+
+
+ + + +
- - -
- {today && ( - - - - )}
+ {onChain && ( + setOnChain("")} id="donate-on-chain"> +
+

+ +

+ + +
+
+ )}

diff --git a/packages/app/src/SnortApi.ts b/packages/app/src/SnortApi.ts index f29a529e..a94ad9c7 100644 --- a/packages/app/src/SnortApi.ts +++ b/packages/app/src/SnortApi.ts @@ -84,6 +84,10 @@ export default class SnortApi { return this.#getJson(`api/v1/preview?url=${encodeURIComponent(url)}`); } + onChainDonation() { + return this.#getJson<{ address: string }>("p/on-chain"); + } + async #getJsonAuthd( path: string, method?: "GET" | string, diff --git a/packages/app/src/lang.json b/packages/app/src/lang.json index 5926ff57..7b59ae7b 100644 --- a/packages/app/src/lang.json +++ b/packages/app/src/lang.json @@ -329,6 +329,9 @@ "BcGMo+": { "defaultMessage": "Notes hold text content, the most popular usage of these notes is to store \"tweet like\" messages." }, + "C1LjMx": { + "defaultMessage": "Lightning Donation" + }, "C5xzTC": { "defaultMessage": "Premium" }, @@ -401,6 +404,9 @@ "EcglP9": { "defaultMessage": "Key" }, + "EjFyoR": { + "defaultMessage": "On-chain Donation Address" + }, "EnCOBJ": { "defaultMessage": "Buy" }, @@ -871,9 +877,6 @@ "ZS+jRE": { "defaultMessage": "Send zap splits to" }, - "ZUZedV": { - "defaultMessage": "Lightning Donation:" - }, "Zr5TMx": { "defaultMessage": "Setup profile" }, @@ -892,6 +895,9 @@ "b5vAk0": { "defaultMessage": "Your handle will act like a lightning address and will redirect to your chosen LNURL or Lightning address" }, + "bLZL5a": { + "defaultMessage": "Get Address" + }, "bQdA2k": { "defaultMessage": "Sensitive Content" }, @@ -991,6 +997,9 @@ "flnGvv": { "defaultMessage": "What's on your mind?" }, + "fqwcJ1": { + "defaultMessage": "On-chain Donation" + }, "fsB/4p": { "defaultMessage": "Saved" }, diff --git a/packages/app/src/translations/en.json b/packages/app/src/translations/en.json index 85042e25..6659d9e0 100644 --- a/packages/app/src/translations/en.json +++ b/packages/app/src/translations/en.json @@ -107,6 +107,7 @@ "BOr9z/": "Snort is an open source project built by passionate people in their free time", "BWpuKl": "Update", "BcGMo+": "Notes hold text content, the most popular usage of these notes is to store \"tweet like\" messages.", + "C1LjMx": "Lightning Donation", "C5xzTC": "Premium", "C81/uG": "Logout", "C8HhVE": "Suggested Follows", @@ -131,6 +132,7 @@ "Ebl/B2": "Translate to {lang}", "EcZF24": "Custom Relays", "EcglP9": "Key", + "EjFyoR": "On-chain Donation Address", "EnCOBJ": "Buy", "Eqjl5K": "Only Snort and our integration partner identifier gives you a colorful domain name, but you are welcome to use other services too.", "F+B3x1": "We have also partnered with nostrplebs.com to give you more options", @@ -285,13 +287,13 @@ "ZKORll": "Activate Now", "ZLmyG9": "Contributors", "ZS+jRE": "Send zap splits to", - "ZUZedV": "Lightning Donation:", "Zr5TMx": "Setup profile", "a5UPxh": "Fund developers and platforms providing NIP-05 verification services", "a7TDNm": "Notes will stream in real time into global and notes tab", "aWpBzj": "Show more", "b12Goz": "Mnemonic", "b5vAk0": "Your handle will act like a lightning address and will redirect to your chosen LNURL or Lightning address", + "bLZL5a": "Get Address", "bQdA2k": "Sensitive Content", "bep9C3": "Public Key", "bfvyfs": "Anon", @@ -324,6 +326,7 @@ "fWZYP5": "Pinned", "filwqD": "Read", "flnGvv": "What's on your mind?", + "fqwcJ1": "On-chain Donation", "fsB/4p": "Saved", "g5pX+a": "About", "g985Wp": "Failed to send vote",