PublicTimeline: hide fediverse explanation on Nostr

environments/review-fedi-expla-0tb2ml/deployments/4601
Alex Gleason 2024-05-11 15:43:25 -05:00
rodzic 66da56236b
commit ea787e5ad4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 34 dodań i 31 usunięć

Wyświetl plik

@ -7,7 +7,7 @@ import { expandPublicTimeline } from 'soapbox/actions/timelines';
import { usePublicStream } from 'soapbox/api/hooks';
import PullToRefresh from 'soapbox/components/pull-to-refresh';
import { Accordion, Column } from 'soapbox/components/ui';
import { useAppSelector, useAppDispatch, useInstance, useSettings, useTheme } from 'soapbox/hooks';
import { useAppSelector, useAppDispatch, useInstance, useSettings, useTheme, useFeatures } from 'soapbox/hooks';
import PinnedHostsPicker from '../remote-timeline/components/pinned-hosts-picker';
import Timeline from '../ui/components/timeline';
@ -17,9 +17,10 @@ const messages = defineMessages({
dismiss: { id: 'fediverse_tab.explanation_box.dismiss', defaultMessage: 'Don\'t show again' },
});
const CommunityTimeline = () => {
const PublicTimeline = () => {
const intl = useIntl();
const dispatch = useAppDispatch();
const features = useFeatures();
const theme = useTheme();
const instance = useInstance();
@ -30,7 +31,7 @@ const CommunityTimeline = () => {
const timelineId = 'public';
const explanationBoxExpanded = settings.explanationBox;
const showExplanationBox = settings.showExplanationBox;
const showExplanationBox = settings.showExplanationBox && !features.nostr;
const dismissExplanationBox = () => {
dispatch(changeSetting(['showExplanationBox'], false));
@ -58,33 +59,35 @@ const CommunityTimeline = () => {
<Column className='-mt-3 sm:mt-0' label={intl.formatMessage(messages.title)} transparent>
<PinnedHostsPicker />
{showExplanationBox && <div className='mb-4 black:mx-4'>
<Accordion
headline={<FormattedMessage id='fediverse_tab.explanation_box.title' defaultMessage='What is the Fediverse?' />}
action={dismissExplanationBox}
actionIcon={require('@tabler/icons/outline/x.svg')}
actionLabel={intl.formatMessage(messages.dismiss)}
expanded={explanationBoxExpanded}
onToggle={toggleExplanationBox}
>
<FormattedMessage
id='fediverse_tab.explanation_box.explanation'
defaultMessage={'{site_title} is part of the Fediverse, a social network made up of thousands of independent social media sites (aka "servers"). The posts you see here are from 3rd-party servers. You have the freedom to engage with them, or to block any server you don\'t like. Pay attention to the full username after the second @ symbol to know which server a post is from. To see only {site_title} posts, visit {local}.'}
values={{
site_title: instance.title,
local: (
<Link to='/timeline/local'>
<FormattedMessage
id='empty_column.home.local_tab'
defaultMessage='the {site_title} tab'
values={{ site_title: instance.title }}
/>
</Link>
),
}}
/>
</Accordion>
</div>}
{showExplanationBox && (
<div className='mb-4 black:mx-4'>
<Accordion
headline={<FormattedMessage id='fediverse_tab.explanation_box.title' defaultMessage='What is the Fediverse?' />}
action={dismissExplanationBox}
actionIcon={require('@tabler/icons/outline/x.svg')}
actionLabel={intl.formatMessage(messages.dismiss)}
expanded={explanationBoxExpanded}
onToggle={toggleExplanationBox}
>
<FormattedMessage
id='fediverse_tab.explanation_box.explanation'
defaultMessage={'{site_title} is part of the Fediverse, a social network made up of thousands of independent social media sites (aka "servers"). The posts you see here are from 3rd-party servers. You have the freedom to engage with them, or to block any server you don\'t like. Pay attention to the full username after the second @ symbol to know which server a post is from. To see only {site_title} posts, visit {local}.'}
values={{
site_title: instance.title,
local: (
<Link to='/timeline/local'>
<FormattedMessage
id='empty_column.home.local_tab'
defaultMessage='the {site_title} tab'
values={{ site_title: instance.title }}
/>
</Link>
),
}}
/>
</Accordion>
</div>
)}
<PullToRefresh onRefresh={handleRefresh}>
<Timeline
className='black:p-4 black:sm:p-5'
@ -100,4 +103,4 @@ const CommunityTimeline = () => {
);
};
export default CommunityTimeline;
export default PublicTimeline;