From c06eb371e6601c740c5998aa4c7e492f336e00eb Mon Sep 17 00:00:00 2001 From: diondiondion Date: Thu, 11 Dec 2025 18:06:26 +0100 Subject: [PATCH 1/2] Add Wrapstodon footer links (#37207) --- .../annual_report/shared_page.module.scss | 23 ++++++++++++++++--- .../features/annual_report/shared_page.tsx | 23 +++++++++++++++++++ app/javascript/mastodon/locales/en.json | 2 ++ app/views/wrapstodon/show.html.haml | 1 + 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/annual_report/shared_page.module.scss b/app/javascript/mastodon/features/annual_report/shared_page.module.scss index 954f5bc8f9..b29ab51707 100644 --- a/app/javascript/mastodon/features/annual_report/shared_page.module.scss +++ b/app/javascript/mastodon/features/annual_report/shared_page.module.scss @@ -13,12 +13,13 @@ $mobile-breakpoint: 540px; } .footer { - text-align: center; - margin-top: 2rem; display: flex; flex-direction: column; - gap: 0.75rem; align-items: center; + gap: 0.75rem; + margin-top: 2rem; + font-size: 16px; + text-align: center; color: var(--color-text-secondary); } @@ -26,3 +27,19 @@ $mobile-breakpoint: 540px; width: 2rem; opacity: 0.6; } + +.nav { + display: flex; + flex-wrap: wrap; + gap: 12px; + + a:any-link { + color: inherit; + text-decoration: underline; + text-underline-offset: 0.2em; + } + + a:hover { + color: var(--color-text-primary); + } +} diff --git a/app/javascript/mastodon/features/annual_report/shared_page.tsx b/app/javascript/mastodon/features/annual_report/shared_page.tsx index 6ec533983c..ebf01da7f1 100644 --- a/app/javascript/mastodon/features/annual_report/shared_page.tsx +++ b/app/javascript/mastodon/features/annual_report/shared_page.tsx @@ -3,6 +3,7 @@ import type { FC } from 'react'; import { FormattedMessage } from 'react-intl'; import { IconLogo } from '@/mastodon/components/logo'; +import { me } from '@/mastodon/initial_state'; import { AnnualReport } from './index'; import classes from './shared_page.module.scss'; @@ -18,6 +19,28 @@ export const WrapstodonSharedPage: FC = () => { defaultMessage='Generated with {heart} by the Mastodon team' values={{ heart: '♥' }} /> + ); diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index d01900a4e8..0d46b446a7 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -117,7 +117,9 @@ "annual_report.announcement.action_view": "View my Wrapstodon", "annual_report.announcement.description": "Discover more about your engagement on Mastodon over the past year.", "annual_report.announcement.title": "Wrapstodon {year} has arrived", + "annual_report.shared_page.donate": "Donate", "annual_report.shared_page.footer": "Generated with {heart} by the Mastodon team", + "annual_report.shared_page.sign_up": "Sign up", "annual_report.summary.archetype.booster.desc_public": "{name} stayed on the hunt for posts to boost, amplifying other creators with perfect aim.", "annual_report.summary.archetype.booster.desc_self": "You stayed on the hunt for posts to boost, amplifying other creators with perfect aim.", "annual_report.summary.archetype.booster.name": "The Archer", diff --git a/app/views/wrapstodon/show.html.haml b/app/views/wrapstodon/show.html.haml index ed1e64d466..519c862d3f 100644 --- a/app/views/wrapstodon/show.html.haml +++ b/app/views/wrapstodon/show.html.haml @@ -11,6 +11,7 @@ = render 'og_description', account: @account = render 'og_image', report: @generated_annual_report + = render_initial_state = vite_typescript_tag 'wrapstodon.tsx', crossorigin: 'anonymous' - content_for :html_classes, 'theme-dark' From dfbf908870fcde76396ebccfb3d71ee1a06ffe82 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 11 Dec 2025 18:49:26 +0100 Subject: [PATCH 2/2] Fix wrapstodon modal closing on any click (#37209) --- .../mastodon/features/annual_report/modal.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/annual_report/modal.tsx b/app/javascript/mastodon/features/annual_report/modal.tsx index 7be8e529a0..c67a6ca19c 100644 --- a/app/javascript/mastodon/features/annual_report/modal.tsx +++ b/app/javascript/mastodon/features/annual_report/modal.tsx @@ -16,9 +16,15 @@ const AnnualReportModal: React.FC<{ }, [onChangeBackgroundColor]); const dispatch = useAppDispatch(); - const handleCloseModal = useCallback(() => { - dispatch(closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false })); - }, [dispatch]); + const handleCloseModal = useCallback>( + (e) => { + if (e.target === e.currentTarget) + dispatch( + closeModal({ modalType: 'ANNUAL_REPORT', ignoreFocus: false }), + ); + }, + [dispatch], + ); return ( // It's fine not to provide a keyboard handler here since there is a global