From e6b0cdcc83750aee357f69f3ff41807b435fe083 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Tue, 16 Dec 2025 16:35:26 +0100 Subject: [PATCH] Updates Wrapstodon footer with dedicated local server info (#37270) --- app/helpers/wrapstodon_helper.rb | 1 + app/javascript/entrypoints/wrapstodon.tsx | 3 +- .../mastodon/features/annual_report/index.tsx | 2 +- .../annual_report/shared_page.module.scss | 35 ++++++--- .../features/annual_report/shared_page.tsx | 71 ++++++++++++------- app/javascript/mastodon/locales/en.json | 4 +- 6 files changed, 78 insertions(+), 38 deletions(-) diff --git a/app/helpers/wrapstodon_helper.rb b/app/helpers/wrapstodon_helper.rb index 8031c51179e..5a0075a0e58 100644 --- a/app/helpers/wrapstodon_helper.rb +++ b/app/helpers/wrapstodon_helper.rb @@ -10,6 +10,7 @@ module WrapstodonHelper ).as_json payload[:me] = current_account.id.to_s if user_signed_in? + payload[:domain] = Addressable::IDNA.to_unicode(Rails.configuration.x.local_domain) json_string = payload.to_json diff --git a/app/javascript/entrypoints/wrapstodon.tsx b/app/javascript/entrypoints/wrapstodon.tsx index e2c8d5a38e5..9fff41a1330 100644 --- a/app/javascript/entrypoints/wrapstodon.tsx +++ b/app/javascript/entrypoints/wrapstodon.tsx @@ -25,7 +25,7 @@ function loaded() { const initialState = JSON.parse( propsNode.textContent, - ) as ApiAnnualReportResponse & { me?: string }; + ) as ApiAnnualReportResponse & { me?: string; domain: string }; const report = initialState.annual_reports[0]; if (!report) { @@ -38,6 +38,7 @@ function loaded() { meta: { locale: document.documentElement.lang, me: initialState.me, + domain: initialState.domain, }, accounts: initialState.accounts, }), diff --git a/app/javascript/mastodon/features/annual_report/index.tsx b/app/javascript/mastodon/features/annual_report/index.tsx index 218d60d26db..ef6f73fff28 100644 --- a/app/javascript/mastodon/features/annual_report/index.tsx +++ b/app/javascript/mastodon/features/annual_report/index.tsx @@ -27,7 +27,7 @@ import { NewPosts } from './new_posts'; const moduleClassNames = classNames.bind(styles); -const accountSelector = createAppSelector( +export const accountSelector = createAppSelector( [(state) => state.accounts, (state) => state.annualReport.report], (accounts, report) => { if (report?.schema_version === 2) { 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 b29ab517070..ea3ea471b90 100644 --- a/app/javascript/mastodon/features/annual_report/shared_page.module.scss +++ b/app/javascript/mastodon/features/annual_report/shared_page.module.scss @@ -16,22 +16,16 @@ $mobile-breakpoint: 540px; display: flex; flex-direction: column; align-items: center; - gap: 0.75rem; + gap: 1.8rem; margin-top: 2rem; font-size: 16px; + line-height: 1.4; text-align: center; color: var(--color-text-secondary); -} -.logo { - width: 2rem; - opacity: 0.6; -} - -.nav { - display: flex; - flex-wrap: wrap; - gap: 12px; + strong { + font-weight: 600; + } a:any-link { color: inherit; @@ -43,3 +37,22 @@ $mobile-breakpoint: 540px; color: var(--color-text-primary); } } + +.logo { + width: 2rem; + opacity: 0.6; +} + +.footerSection { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; +} + +.linkList { + list-style: none; + display: flex; + flex-wrap: wrap; + gap: 12px; +} diff --git a/app/javascript/mastodon/features/annual_report/shared_page.tsx b/app/javascript/mastodon/features/annual_report/shared_page.tsx index f2b26bf2aac..3defe7194a3 100644 --- a/app/javascript/mastodon/features/annual_report/shared_page.tsx +++ b/app/javascript/mastodon/features/annual_report/shared_page.tsx @@ -2,43 +2,66 @@ import type { FC } from 'react'; import { FormattedMessage } from 'react-intl'; +import { DisplayName } from '@/mastodon/components/display_name'; import { IconLogo } from '@/mastodon/components/logo'; import { useAppSelector } from '@/mastodon/store'; -import { AnnualReport } from './index'; +import { AnnualReport, accountSelector } from './index'; import classes from './shared_page.module.scss'; export const WrapstodonSharedPage: FC = () => { - const isLoggedIn = useAppSelector((state) => !!state.meta.get('me')); + const account = useAppSelector(accountSelector); + const domain = useAppSelector((state) => state.meta.get('domain') as string); return (
); diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index bafbb3fafda..00b3029587b 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -121,7 +121,7 @@ "annual_report.nav_item.badge": "New", "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.shared_page.footer_server_info": "{username} uses {domain}, one of many communities powered by Mastodon.", "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", @@ -441,6 +441,8 @@ "follow_suggestions.who_to_follow": "Who to follow", "followed_tags": "Followed hashtags", "footer.about": "About", + "footer.about_mastodon": "About Mastodon", + "footer.about_server": "About {domain}", "footer.about_this_server": "About", "footer.directory": "Profiles directory", "footer.get_app": "Get the app",