From f242be780324014de93b4946e4f2d59c6455801d Mon Sep 17 00:00:00 2001 From: AE <98699388+A-EDev@users.noreply.github.com> Date: Mon, 16 Nov 2026 19:38:22 +0200 Subject: [PATCH 1/2] feat(support): redesign the support page --- .../donations/CryptoDonationCard.tsx | 73 ++++++ src/components/donations/SupportMethodRow.tsx | 30 +++ src/lib/i18n/strings.json | 1 + src/lib/supportLinks.ts | 46 ++++ src/pages/Donations.tsx | 208 ++---------------- 5 files changed, 169 insertions(+), 189 deletions(-) create mode 100644 src/components/donations/CryptoDonationCard.tsx create mode 100644 src/components/donations/SupportMethodRow.tsx diff --git a/src/components/donations/CryptoDonationCard.tsx b/src/components/donations/CryptoDonationCard.tsx new file mode 100644 index 000000000..48c471f14 --- /dev/null +++ b/src/components/donations/CryptoDonationCard.tsx @@ -0,0 +1,73 @@ +import { useState } from "react"; +import { Copy } from "lucide-react"; +import { Button } from "../ui/Button"; +import { SegmentedControl } from "../ui/SegmentedControl"; +import { copyText } from "../../lib/clipboard"; +import { getString } from "../../lib/i18n/index"; +import { CRYPTO_METHODS } from "../../lib/supportLinks"; +import { useUiStore } from "../../store/useUiStore"; + +/** One coin at a time, so the page shows a single QR code instead of a wall of them. */ +export function CryptoDonationCard() { + const [ticker, setTicker] = useState(CRYPTO_METHODS[0]!.ticker); + const method = CRYPTO_METHODS.find((item) => item.ticker === ticker) ?? CRYPTO_METHODS[0]!; + + const copyAddress = async () => { + const copied = await copyText(method.address); + useUiStore.getState().showToast({ + variant: copied ? "success" : "error", + message: getString(copied ? "donations_address_copied" : "donations_copy_failed"), + }); + }; + + return ( +
+

{getString("donations_crypto_label")}

+
+ ({ value: item.ticker, label: item.name }))} + /> + +
+
+ {getString("donations_qr_alt", +
+ +
+
+ {method.name} + + {method.ticker} + +
+
+
+
{getString("donations_network_label")}
+
{method.network}
+
+
+
{getString("donations_address_label")}
+
+ {method.address} +
+
+
+ +
+
+ +

{getString("donations_crypto_hint")}

+
+
+ ); +} diff --git a/src/components/donations/SupportMethodRow.tsx b/src/components/donations/SupportMethodRow.tsx new file mode 100644 index 000000000..37bec61c3 --- /dev/null +++ b/src/components/donations/SupportMethodRow.tsx @@ -0,0 +1,30 @@ +import type { ReactNode } from "react"; + +interface SupportMethodRowProps { + icon: ReactNode; + title: string; + badge?: string; + description: string; + action: ReactNode; +} + +/** One way to give, laid out like a settings row so the page reads as one list. */ +export function SupportMethodRow({ icon, title, badge, description, action }: SupportMethodRowProps) { + return ( +
+ + {icon} + +
+
+

{title}

+ {badge && ( + {badge} + )} +
+

{description}

+
+
{action}
+
+ ); +} diff --git a/src/lib/i18n/strings.json b/src/lib/i18n/strings.json index df60c7d2f..35f6eb929 100644 --- a/src/lib/i18n/strings.json +++ b/src/lib/i18n/strings.json @@ -2077,6 +2077,7 @@ "donations_crypto_label": "Cryptocurrency", "donations_crypto_hint": "Scan a QR code with a compatible wallet, or copy the address. Always verify the address and network before sending.", "donations_network_label": "Network", + "donations_address_label": "Address", "donations_copy_address": "Copy address", "donations_address_copied": "Address copied to clipboard", "donations_copy_failed": "Could not copy address", diff --git a/src/lib/supportLinks.ts b/src/lib/supportLinks.ts index dc9f2913f..cbade9469 100644 --- a/src/lib/supportLinks.ts +++ b/src/lib/supportLinks.ts @@ -1,2 +1,48 @@ export const OPEN_COLLECTIVE_URL = "https://opencollective.com/flow-tube"; export const PATREON_URL = "https://patreon.com/A_EDev"; + +export type CryptoMethod = { + name: string; + ticker: string; + network: string; + address: string; + qr: string; +}; + +export const CRYPTO_METHODS: readonly CryptoMethod[] = [ + { + name: "Bitcoin", + ticker: "BTC", + network: "Bitcoin", + address: "bc1qgmkkxxvzvsymtpfazqfl93jw6k4jgy0xmrtnv8", + qr: "/donations/bitcoin.png", + }, + { + name: "Ethereum", + ticker: "ETH", + network: "ERC-20", + address: "0xfbac6f464fec7fe458e318971a42ba45b305b70e", + qr: "/donations/ethereum.png", + }, + { + name: "Solana", + ticker: "SOL", + network: "Solana", + address: "7b3SLgiVPb8qQUvERSPGRWoFoiGEDvkFuY98M1GEngug", + qr: "/donations/solana.png", + }, + { + name: "USDT", + ticker: "USDT", + network: "TRC-20", + address: "TRz7VDrTWwCLCfQmYBEJakqcZgbFNWfUMP", + qr: "/donations/usdt-trc20.png", + }, + { + name: "Monero", + ticker: "XMR", + network: "Monero", + address: "8AgaxZnpEvT8VXJpczpL7BQejwSEw97saJmKYqq4zKErbe9bkYSwUhJ813msPPbdYhF11oz4N7tfEj4Zi6k27fKD83ca1if", + qr: "/donations/monero.png", + }, +]; diff --git a/src/pages/Donations.tsx b/src/pages/Donations.tsx index 374b979e4..4d79e0390 100644 --- a/src/pages/Donations.tsx +++ b/src/pages/Donations.tsx @@ -1,220 +1,50 @@ -import type { ReactNode } from "react"; -import { Copy, Heart } from "lucide-react"; +import { Heart } from "lucide-react"; +import { CryptoDonationCard } from "../components/donations/CryptoDonationCard"; +import { SupportMethodRow } from "../components/donations/SupportMethodRow"; +import { SettingsGroup } from "../components/settings/SettingsGroup"; import { Button } from "../components/ui/Button"; import { OpenCollectiveIcon, PatreonIcon } from "../components/ui/SupportPlatformIcons"; import { getString } from "../lib/i18n/index"; -import { copyText } from "../lib/clipboard"; import { openExternal } from "../lib/openExternal"; import { OPEN_COLLECTIVE_URL, PATREON_URL } from "../lib/supportLinks"; -import { useUiStore } from "../store/useUiStore"; - -type CryptoMethod = { - name: string; - ticker: string; - network: string; - address: string; - qr: string; -}; - -const CRYPTO_METHODS: readonly CryptoMethod[] = [ - { - name: "Bitcoin", - ticker: "BTC", - network: "Bitcoin", - address: "bc1qgmkkxxvzvsymtpfazqfl93jw6k4jgy0xmrtnv8", - qr: "/donations/bitcoin.png", - }, - { - name: "Ethereum", - ticker: "ETH", - network: "ERC-20", - address: "0xfbac6f464fec7fe458e318971a42ba45b305b70e", - qr: "/donations/ethereum.png", - }, - { - name: "Solana", - ticker: "SOL", - network: "Solana", - address: "7b3SLgiVPb8qQUvERSPGRWoFoiGEDvkFuY98M1GEngug", - qr: "/donations/solana.png", - }, - { - name: "USDT", - ticker: "USDT", - network: "TRC-20", - address: "TRz7VDrTWwCLCfQmYBEJakqcZgbFNWfUMP", - qr: "/donations/usdt-trc20.png", - }, - { - name: "Monero", - ticker: "XMR", - network: "Monero", - address: "8AgaxZnpEvT8VXJpczpL7BQejwSEw97saJmKYqq4zKErbe9bkYSwUhJ813msPPbdYhF11oz4N7tfEj4Zi6k27fKD83ca1if", - qr: "/donations/monero.png", - }, -]; - -function CryptoMethodCard({ - method, - onCopy, -}: { - method: CryptoMethod; - onCopy: (method: CryptoMethod) => void; -}) { - return ( -
-
- {getString("donations_qr_alt", -
- -
-
- {method.name} - - {method.ticker} - -
- - {method.network} - -
- - -
- ); -} - -function PlatformCard({ - icon, - title, - badge, - description, - action, - primary, -}: { - icon: ReactNode; - title: string; - badge?: string; - description: string; - action: ReactNode; - primary?: boolean; -}) { - return ( -
- - {icon} - -
-
-

{title}

- {badge && ( - - {badge} - - )} -
-

{description}

-
-
{action}
-
- ); -} export default function Donations() { - const showToast = useUiStore((state) => state.showToast); - - const handleCopy = async (method: CryptoMethod) => { - if (await copyText(method.address)) { - showToast({ - variant: "success", - message: getString("donations_address_copied"), - }); - } else { - showToast({ - variant: "error", - message: getString("donations_copy_failed"), - }); - } - }; - return ( -
- {/* Hero */} -
- - - -

- {getString("donations_title")} -

-

- {getString("donations_subtitle")} -

+
+
+

{getString("donations_title")}

+

{getString("donations_subtitle")}

-
- } + + } title={getString("donations_oc_title")} badge={getString("donations_recommended")} description={getString("donations_oc_desc")} action={ - } /> - } + } title={getString("donations_patreon_title")} description={getString("donations_patreon_desc")} action={ - } /> -
- - {/* Crypto */} -
-

- {getString("donations_crypto_label")} -

-

- {getString("donations_crypto_hint")} -

+ -
- {CRYPTO_METHODS.map((method) => ( - - ))} -
-
+ -

+

+ {getString("donations_thank_you")}

From 2d5fe95f2eb6322e0dd7343734f4acb53487dd2c Mon Sep 17 00:00:00 2001 From: AE <98699388+A-EDev@users.noreply.github.com> Date: Mon, 16 Nov 2026 19:38:52 +0200 Subject: [PATCH 2/2] docs(changelog): note the support page redesign --- changelog/v0.1.0-beta4.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog/v0.1.0-beta4.txt b/changelog/v0.1.0-beta4.txt index 783412d7c..37808ba33 100644 --- a/changelog/v0.1.0-beta4.txt +++ b/changelog/v0.1.0-beta4.txt @@ -331,6 +331,9 @@ NIGHTLY BUILDS - Flow Nightly now updates itself to the newest nightly build, on Windows, macOS and Linux. A nightly build installed before this change needs one new install by hand first. - The Nightly release and Flow Nightly's update window list what has changed since the last release, from the changelog of the next one. +SUPPORT +- The Support Flow page is simpler. Open Collective and Patreon sit in one list, and cryptocurrency shows one coin at a time: pick a coin to see its QR code, network and full address, with a button to copy it. + FIXES - The rows on the About page that open something, such as Changelog, can be reached and opened with the keyboard. - Playlist cards show all four covers when two of the songs share a cover.