mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-21 14:18:36 +00:00
Updates Wrapstodon footer with dedicated local server info (#37270)
This commit is contained in:
@@ -10,6 +10,7 @@ module WrapstodonHelper
|
|||||||
).as_json
|
).as_json
|
||||||
|
|
||||||
payload[:me] = current_account.id.to_s if user_signed_in?
|
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
|
json_string = payload.to_json
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function loaded() {
|
|||||||
|
|
||||||
const initialState = JSON.parse(
|
const initialState = JSON.parse(
|
||||||
propsNode.textContent,
|
propsNode.textContent,
|
||||||
) as ApiAnnualReportResponse & { me?: string };
|
) as ApiAnnualReportResponse & { me?: string; domain: string };
|
||||||
|
|
||||||
const report = initialState.annual_reports[0];
|
const report = initialState.annual_reports[0];
|
||||||
if (!report) {
|
if (!report) {
|
||||||
@@ -38,6 +38,7 @@ function loaded() {
|
|||||||
meta: {
|
meta: {
|
||||||
locale: document.documentElement.lang,
|
locale: document.documentElement.lang,
|
||||||
me: initialState.me,
|
me: initialState.me,
|
||||||
|
domain: initialState.domain,
|
||||||
},
|
},
|
||||||
accounts: initialState.accounts,
|
accounts: initialState.accounts,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import { NewPosts } from './new_posts';
|
|||||||
|
|
||||||
const moduleClassNames = classNames.bind(styles);
|
const moduleClassNames = classNames.bind(styles);
|
||||||
|
|
||||||
const accountSelector = createAppSelector(
|
export const accountSelector = createAppSelector(
|
||||||
[(state) => state.accounts, (state) => state.annualReport.report],
|
[(state) => state.accounts, (state) => state.annualReport.report],
|
||||||
(accounts, report) => {
|
(accounts, report) => {
|
||||||
if (report?.schema_version === 2) {
|
if (report?.schema_version === 2) {
|
||||||
|
|||||||
@@ -16,23 +16,17 @@ $mobile-breakpoint: 540px;
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 1.8rem;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
line-height: 1.4;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: var(--color-text-secondary);
|
color: var(--color-text-secondary);
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
strong {
|
||||||
width: 2rem;
|
font-weight: 600;
|
||||||
opacity: 0.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 12px;
|
|
||||||
|
|
||||||
a:any-link {
|
a:any-link {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
@@ -43,3 +37,22 @@ $mobile-breakpoint: 540px;
|
|||||||
color: var(--color-text-primary);
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,43 +2,66 @@ import type { FC } from 'react';
|
|||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
import { DisplayName } from '@/mastodon/components/display_name';
|
||||||
import { IconLogo } from '@/mastodon/components/logo';
|
import { IconLogo } from '@/mastodon/components/logo';
|
||||||
import { useAppSelector } from '@/mastodon/store';
|
import { useAppSelector } from '@/mastodon/store';
|
||||||
|
|
||||||
import { AnnualReport } from './index';
|
import { AnnualReport, accountSelector } from './index';
|
||||||
import classes from './shared_page.module.scss';
|
import classes from './shared_page.module.scss';
|
||||||
|
|
||||||
export const WrapstodonSharedPage: FC = () => {
|
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 (
|
return (
|
||||||
<main className={classes.wrapper}>
|
<main className={classes.wrapper}>
|
||||||
<AnnualReport />
|
<AnnualReport />
|
||||||
<footer className={classes.footer}>
|
<footer className={classes.footer}>
|
||||||
|
<div className={classes.footerSection}>
|
||||||
<IconLogo className={classes.logo} />
|
<IconLogo className={classes.logo} />
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='annual_report.shared_page.footer'
|
id='annual_report.shared_page.footer'
|
||||||
defaultMessage='Generated with {heart} by the Mastodon team'
|
defaultMessage='Generated with {heart} by the Mastodon team'
|
||||||
values={{ heart: '🐘' }}
|
values={{ heart: '🐘' }}
|
||||||
|
tagName='p'
|
||||||
/>
|
/>
|
||||||
<nav className={classes.nav}>
|
<ul className={classes.linkList}>
|
||||||
|
<li>
|
||||||
<a href='https://joinmastodon.org'>
|
<a href='https://joinmastodon.org'>
|
||||||
<FormattedMessage id='footer.about' defaultMessage='About' />
|
|
||||||
</a>
|
|
||||||
{!isLoggedIn && (
|
|
||||||
<a href='https://joinmastodon.org/servers'>
|
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='annual_report.shared_page.sign_up'
|
id='footer.about_mastodon'
|
||||||
defaultMessage='Sign up'
|
defaultMessage='About Mastodon'
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
)}
|
</li>
|
||||||
|
<li>
|
||||||
<a href='https://joinmastodon.org/sponsors'>
|
<a href='https://joinmastodon.org/sponsors'>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='annual_report.shared_page.donate'
|
id='annual_report.shared_page.donate'
|
||||||
defaultMessage='Donate'
|
defaultMessage='Donate'
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={classes.footerSection}>
|
||||||
|
<FormattedMessage
|
||||||
|
id='annual_report.shared_page.footer_server_info'
|
||||||
|
defaultMessage='{username} uses {domain}, one of many communities powered by Mastodon.'
|
||||||
|
values={{
|
||||||
|
username: <DisplayName variant='simple' account={account} />,
|
||||||
|
domain: <strong>{domain}</strong>,
|
||||||
|
}}
|
||||||
|
tagName='p'
|
||||||
|
/>
|
||||||
|
<a href='/about'>
|
||||||
|
<FormattedMessage
|
||||||
|
id='footer.about_server'
|
||||||
|
defaultMessage='About {domain}'
|
||||||
|
values={{ domain }}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
"annual_report.nav_item.badge": "New",
|
"annual_report.nav_item.badge": "New",
|
||||||
"annual_report.shared_page.donate": "Donate",
|
"annual_report.shared_page.donate": "Donate",
|
||||||
"annual_report.shared_page.footer": "Generated with {heart} by the Mastodon team",
|
"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_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.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",
|
"annual_report.summary.archetype.booster.name": "The Archer",
|
||||||
@@ -441,6 +441,8 @@
|
|||||||
"follow_suggestions.who_to_follow": "Who to follow",
|
"follow_suggestions.who_to_follow": "Who to follow",
|
||||||
"followed_tags": "Followed hashtags",
|
"followed_tags": "Followed hashtags",
|
||||||
"footer.about": "About",
|
"footer.about": "About",
|
||||||
|
"footer.about_mastodon": "About Mastodon",
|
||||||
|
"footer.about_server": "About {domain}",
|
||||||
"footer.about_this_server": "About",
|
"footer.about_this_server": "About",
|
||||||
"footer.directory": "Profiles directory",
|
"footer.directory": "Profiles directory",
|
||||||
"footer.get_app": "Get the app",
|
"footer.get_app": "Get the app",
|
||||||
|
|||||||
Reference in New Issue
Block a user