diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 8fea44fbc..61253a801 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,3 @@ +patreon: mauriceboe ko_fi: mauriceboe buy_me_a_coffee: mauriceboe diff --git a/README.md b/README.md index ce2e16055..7ac147bba 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ TREK has grown from a travel planner into a whole ecosystem for trips: plan toge   Roadmap   +Patreon +  Ko-fi   BMAC diff --git a/client/src/components/Admin/GitHubPanel.tsx b/client/src/components/Admin/GitHubPanel.tsx index 6bd222ced..a4a1ba2a0 100644 --- a/client/src/components/Admin/GitHubPanel.tsx +++ b/client/src/components/Admin/GitHubPanel.tsx @@ -20,6 +20,7 @@ import { escapeReleaseHtml as escapeHtml, parseReleaseNotes } from '../../utils/ import { fs } from '../shared/DialogShell'; import { SETTINGS_BUTTON, SettingsCard, StatusPill } from '../Settings/settingsKit'; import { useGithubReleases } from './useGithubReleases'; +import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon'; const REPO = 'liketrek/TREK'; @@ -136,6 +137,13 @@ export default function GitHubPanel({ isPrerelease = false }: { isPrerelease?: b }; const supportLinks: SupportLink[] = withoutDonationsInApp([ + { + href: PATREON_URL, + brand: PATREON_COLOR, + icon: PatreonIcon, + title: 'Patreon', + hint: t('admin.github.supportMonthly'), + }, { href: 'https://ko-fi.com/mauriceboe', brand: '#ff5e5b', // theme-lint-disable: Ko-fi brand colour diff --git a/client/src/components/Settings/AboutTab.test.tsx b/client/src/components/Settings/AboutTab.test.tsx index 312429722..c8e59d58c 100644 --- a/client/src/components/Settings/AboutTab.test.tsx +++ b/client/src/components/Settings/AboutTab.test.tsx @@ -60,8 +60,9 @@ describe('AboutTab', () => { it('FE-COMP-ABOUT-009: all external links have rel="noopener noreferrer"', () => { render(); const links = document.querySelectorAll('a'); - // Six tiles, and the sponsor panel: its logo, its button and the name in its title and body. - expect(links).toHaveLength(10); + // Seven tiles, and the sponsor panel: its logo, its button and the name in its title and body. + expect(links).toHaveLength(11); + expect(document.querySelector('a[href="https://www.patreon.com/cw/mauriceboe"]')).not.toBeNull(); links.forEach((link) => { expect(link).toHaveAttribute('rel', 'noopener noreferrer'); }); diff --git a/client/src/components/Settings/AboutTab.tsx b/client/src/components/Settings/AboutTab.tsx index e513120af..59b837956 100644 --- a/client/src/components/Settings/AboutTab.tsx +++ b/client/src/components/Settings/AboutTab.tsx @@ -17,6 +17,7 @@ import { useTranslation } from '../../i18n'; import { useAuthStore } from '../../store/authStore'; import { donationsShown } from '../../utils/donations'; import { fs } from '../shared/DialogShell'; +import PatreonIcon, { PATREON_COLOR, PATREON_URL } from '../shared/PatreonIcon'; import Section from './Section'; import { StatusPill } from './settingsKit'; @@ -246,6 +247,13 @@ export default function AboutTab({ appVersion }: Props): React.ReactElement { {/* Not in the native apps, whose store rules allow no outside payment links. */} {donationsShown() && ( <> + } + title="Patreon" + hint={t('admin.github.supportMonthly')} + /> = {}): SystemNoticeDT introKey: 'rel.intro', featuresLabelKey: 'rel.features.label', features: [ - { iconName: 'Mountain', visual: 'tours', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' }, - { iconName: 'BookOpen', visual: 'studio', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' }, - { iconName: 'Sparkles', visual: 'assistant', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' }, + { iconName: 'Mail', visual: 'mail', titleKey: 'rel.f1.title', bodyKey: 'rel.f1.body' }, + { iconName: 'Plane', visual: 'flight', titleKey: 'rel.f2.title', bodyKey: 'rel.f2.body' }, + { iconName: 'FileText', visual: 'pdf', titleKey: 'rel.f3.title', bodyKey: 'rel.f3.body' }, ], note: { eyebrowKey: 'rel.note.eyebrow', @@ -85,9 +85,9 @@ describe('ReleaseNoticeModal', () => { renderModal(); expect(screen.getByText('rel.f1.title')).toBeInTheDocument(); expect(document.querySelectorAll('.rn-feature')).toHaveLength(3); - expect(document.querySelector('.rn-vis-tours')).not.toBeNull(); - expect(document.querySelector('.rn-vis-studio')).not.toBeNull(); - expect(document.querySelector('.rn-vis-assist')).not.toBeNull(); + expect(document.querySelector('.rn-vis-mail')).not.toBeNull(); + expect(document.querySelector('.rn-vis-flight')).not.toBeNull(); + expect(document.querySelector('.rn-vis-pdf')).not.toBeNull(); }); it('FE-RN-004: splits the note body on the blank line into separate paragraphs', () => { @@ -201,20 +201,19 @@ describe('ReleaseNoticeModal', () => { const n = releaseNotice(); n.release!.features = [ ...n.release!.features, - { iconName: 'LifeBuoy', visual: 'help', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' }, + { iconName: 'Search', visual: 'search', layout: 'wide', titleKey: 'rel.f4.title', bodyKey: 'rel.f4.body' }, ]; renderModal(n); const cards = document.querySelectorAll('.rn-feature'); expect(cards).toHaveLength(4); expect(cards[3].classList.contains('rn-feature-wide')).toBe(true); expect([...cards].slice(0, 3).some((c) => c.classList.contains('rn-feature-wide'))).toBe(false); - // The help drawing: the help button and two rows of greetings, each written twice to loop. + // The search drawing: the field and its three results, the right place on top. const wide = cards[3]; - expect(wide.querySelector('.rn-vis-help-q')).not.toBeNull(); - expect(wide.querySelectorAll('.rn-vis-hello-row')).toHaveLength(2); - expect(wide.querySelectorAll('.rn-vis-hello').length % 2).toBe(0); - // The tours card lists the kinds of tour along its foot. - expect(cards[0].querySelectorAll('.rn-vis-tours-kind')).toHaveLength(5); + expect(wide.querySelector('.rn-vis-search-field')).not.toBeNull(); + expect(wide.querySelectorAll('.rn-vis-search-row')).toHaveLength(3); + // The mail card ends on the booking it added, with its tick. + expect(cards[0].querySelector('.rn-vis-mail-row-new .rn-vis-mail-check')).not.toBeNull(); }); it('FE-RN-016: the close button belongs to the panel, not the note', () => { diff --git a/client/src/components/SystemNotices/ReleaseNoticeModal.tsx b/client/src/components/SystemNotices/ReleaseNoticeModal.tsx index 47244ce1b..e66d75e3e 100644 --- a/client/src/components/SystemNotices/ReleaseNoticeModal.tsx +++ b/client/src/components/SystemNotices/ReleaseNoticeModal.tsx @@ -2,6 +2,7 @@ import { ArrowRight, Heart, Infinity as InfinityIcon, ShieldCheck, X } from 'luc import React from 'react'; import { useTranslation } from '../../i18n/TranslationContext.js'; import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js'; +import { PATREON_PATH } from '../shared/PatreonIcon'; import { ReleaseFeatureVisual } from './ReleaseNoticeVisuals.js'; import './releaseNotice.css'; @@ -11,6 +12,7 @@ interface Props { onDismiss: () => void; onCTA: () => void; onSecondaryCTA: () => void; + onTertiaryCTA: () => void; } /** Lucide's coffee cup, drawn here so its three steam strokes can drift up in waves. */ @@ -74,7 +76,7 @@ function paragraphs(text: string): string[] { * generic modal's behaviour: the host hook still owns ESC, the scroll lock and * the dismissal, this component only draws. */ -export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA }: Props) { +export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecondaryCTA, onTertiaryCTA }: Props) { const { t } = useTranslation(); const release = notice.release; if (!release) return null; @@ -208,6 +210,26 @@ export function ReleaseNoticeModal({ notice, visible, onDismiss, onCTA, onSecond )}
+ {notice.tertiaryCta && ( + + )} {notice.cta && ( )} + {tertiaryCtaLabel && ( + + )}
) : (notice.dismissible || isLastPage) && (