Create new entrypoint for sharable Wrapstodon (#37121)

This commit is contained in:
Echo authored and GitHub committed 2025-12-04 15:48:10 +00:00
1 parent 75b9e9a8b0
commit 0dac31dfd5
8 files changed
+132 -5

No files matched your search

+8 -2
View File
@@ -1,3 +1,5 @@
import classNames from 'classnames';
import logo from '@/images/logo.svg';
export const WordmarkLogo: React.FC = () => (
@@ -7,8 +9,12 @@ export const WordmarkLogo: React.FC = () => (
</svg>
);
export const IconLogo: React.FC = () => (
<svg viewBox='0 0 79 79' className='logo logo--icon' role='img'>
export const IconLogo: React.FC<{ className?: string }> = ({ className }) => (
<svg
viewBox='0 0 79 79'
className={classNames('logo logo--icon', className)}
role='img'
>
<title>Mastodon</title>
<use xlinkHref='#logo-symbol-icon' />
</svg>
@@ -0,0 +1,19 @@
.wrapper {
max-width: 40rem;
margin: 0 auto;
}
.footer {
text-align: center;
margin-top: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
align-items: center;
color: var(--color-text-secondary);
}
.logo {
width: 2rem;
opacity: 0.6;
}
@@ -0,0 +1,18 @@
import type { FC } from 'react';
import { IconLogo } from '@/mastodon/components/logo';
import { AnnualReport } from './index';
import classes from './share.module.css';
export const WrapstodonShare: FC = () => {
return (
<main className={classes.wrapper}>
<AnnualReport share={false} />
<footer className={classes.footer}>
<IconLogo className={classes.logo} />
Generated with ♥ by the Mastodon team
</footer>
</main>
);
};
@@ -1,3 +1,4 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import {
@@ -29,7 +30,12 @@ interface AnnualReportState {
const annualReportSlice = createSlice({
name: 'annualReport',
initialState: {} as AnnualReportState,
reducers: {},
reducers: {
setReport(state, action: PayloadAction<AnnualReport>) {
state.report = action.payload;
state.state = 'available';
},
},
extraReducers(builder) {
builder
.addCase(fetchReportState.fulfilled, (state, action) => {
@@ -47,6 +53,7 @@ const annualReportSlice = createSlice({
});
export const annualReport = annualReportSlice.reducer;
export const { setReport } = annualReportSlice.actions;
export const selectWrapstodonYear = createAppSelector(
[(state) => state.server.getIn(['server', 'wrapstodon'])],