From 171cd643d55fd58a6754f0c85443475a72ff04fc Mon Sep 17 00:00:00 2001 From: Gabriel Cozma Date: Fri, 27 Dec 2024 23:15:54 +0200 Subject: [PATCH] cleanup(funding): dryer code --- src/pages/funding.astro | 175 ++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 105 deletions(-) diff --git a/src/pages/funding.astro b/src/pages/funding.astro index af556d2..1cbebf0 100644 --- a/src/pages/funding.astro +++ b/src/pages/funding.astro @@ -188,22 +188,6 @@ const legendIcons = [ title: "More information", }, ]; - -const people: PeopleList = { - github: [], - other: [ - "Christopher (kit) Eubanks", - "Black_file", - "Chris", - "Robin Lee", - "Andrew Ego", - "Sonny Piers", - "Dan G", - "Caleb Woodbine", - "Robert Krisztian Sandor", - "+ All the anonymous donations", - ], -}; --- @@ -254,43 +238,22 @@ const people: PeopleList = {

{method.name}

- {method.recurring && method.oneTime ? ( - - One-Time / Recurring - - ) : method.recurring ? ( - - Recurring - - ) : method.oneTime ? ( - - One-Time - - ) : ( - "" - )} - - {method.preferred ? ( - - Preferred Method - - ) : ( - "" - )} - {method.flexible ? ( - - Flexible Subscription - - ) : ( - "" - )} - {method.crypto ? ( - - Bitcoin, Ethereum, and more - - ) : ( - "" - )} + {["One-Time / Recurring", "Recurring", "One-Time", "Preferred Method", "Flexible Subscription", "Bitcoin, Ethereum, and more"].map((text, index) => { + const conditions = [ + method.recurring && method.oneTime, + method.recurring && !method.oneTime, + method.oneTime && !method.recurring, + method.preferred, + method.flexible, + method.crypto, + ]; + const condition = conditions[index]; + return condition ? ( + + {text} + + ) : null; + })}
-
-

- Ethereum (ETH) -

-

Network: ERC20

- - 0xef6a653c63db31403f507bca277f719d2f3d44f8 - -
-
-
-

Bitcoin (BTC)

-

- Network: BTC(SegWit) -

- - bc1q2svx64v90hyyd7jt8xamvqm9vc5248l5rgzwpm - -
-
-
-

Litecoin (LTC)

-

Network: LTC

- - LWqpd2411CQTuWD15bcPP7bfAw3wmYHScm - -
-
-
-

Ripple (XRP)

-

Network: XRP

- - rNxp4h8apvRis6mJf9Sh8C6iRxfrDWN7AV - -
-

The following MEMO is required: 420078619.

-

If you can't add the MEMO, coins will be lost.

+ {[ + { + name: "Ethereum (ETH)", + network: "ERC20", + address: "0xef6a653c63db31403f507bca277f719d2f3d44f8", + icon: "material-symbols:check-circle", + suggested: true, + }, + { + name: "Bitcoin (BTC)", + network: "BTC(SegWit)", + address: "bc1q2svx64v90hyyd7jt8xamvqm9vc5248l5rgzwpm", + }, + { + name: "Litecoin (LTC)", + network: "LTC", + address: "LWqpd2411CQTuWD15bcPP7bfAw3wmYHScm", + }, + { + name: "Ripple (XRP)", + network: "XRP", + address: "rNxp4h8apvRis6mJf9Sh8C6iRxfrDWN7AV", + memo: "420078619", + }, + ].map((crypto, index) => ( +
+

+ {crypto.name}{" "} + {crypto.suggested == true && ( + + )} +

+

+ Network: {crypto.network} +

+ + {crypto.address} + + {crypto.memo && ( +
+

The following MEMO is required: {crypto.memo}.

+

If you can't add the MEMO, coins will be lost.

+
+ )} + {index < 3 && ( +
+ )}
-
+ ))}