Use instance domain for local timeline

This commit is contained in:
Alex Gleason 2024-06-06 21:37:57 -05:00
parent e47eb6530c
commit c7ff472ae0
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
4 changed files with 8 additions and 13 deletions

View File

@ -248,8 +248,8 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
<SidebarLink <SidebarLink
to='/timeline/local' to='/timeline/local'
icon={features.federating ? require('@tabler/icons/outline/users-group.svg') : require('@tabler/icons/outline/world.svg')} icon={features.federating ? require('@tabler/icons/outline/at.svg') : require('@tabler/icons/outline/world.svg')}
text={features.federating ? instance.title : <FormattedMessage id='tabs_bar.all' defaultMessage='All' />} text={features.federating ? instance.domain : <FormattedMessage id='tabs_bar.all' defaultMessage='All' />}
onClick={onClose} onClick={onClose}
/> />

View File

@ -178,8 +178,8 @@ const SidebarNavigation = () => {
{(account || !restrictUnauth.timelines.local) && ( {(account || !restrictUnauth.timelines.local) && (
<SidebarNavigationLink <SidebarNavigationLink
to='/timeline/local' to='/timeline/local'
icon={features.federating ? require('@tabler/icons/outline/users-group.svg') : require('@tabler/icons/outline/world.svg')} icon={features.federating ? require('@tabler/icons/outline/at.svg') : require('@tabler/icons/outline/world.svg')}
text={features.federating ? instance.title : <FormattedMessage id='tabs_bar.global' defaultMessage='Global' />} text={features.federating ? instance.domain : <FormattedMessage id='tabs_bar.global' defaultMessage='Global' />}
/> />
)} )}

View File

@ -1,23 +1,19 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { expandCommunityTimeline } from 'soapbox/actions/timelines'; import { expandCommunityTimeline } from 'soapbox/actions/timelines';
import { useCommunityStream } from 'soapbox/api/hooks'; import { useCommunityStream } from 'soapbox/api/hooks';
import PullToRefresh from 'soapbox/components/pull-to-refresh'; import PullToRefresh from 'soapbox/components/pull-to-refresh';
import { Column } from 'soapbox/components/ui'; import { Column } from 'soapbox/components/ui';
import { useAppSelector, useAppDispatch, useSettings, useTheme } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch, useSettings, useTheme, useInstance } from 'soapbox/hooks';
import { useIsMobile } from 'soapbox/hooks/useIsMobile'; import { useIsMobile } from 'soapbox/hooks/useIsMobile';
import Timeline from '../ui/components/timeline'; import Timeline from '../ui/components/timeline';
const messages = defineMessages({
title: { id: 'column.community', defaultMessage: 'Local timeline' },
});
const CommunityTimeline = () => { const CommunityTimeline = () => {
const intl = useIntl();
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const theme = useTheme(); const theme = useTheme();
const instance = useInstance();
const settings = useSettings(); const settings = useSettings();
const onlyMedia = settings.community.other.onlyMedia; const onlyMedia = settings.community.other.onlyMedia;
@ -41,7 +37,7 @@ const CommunityTimeline = () => {
}, [onlyMedia]); }, [onlyMedia]);
return ( return (
<Column className='-mt-3 sm:mt-0' label={intl.formatMessage(messages.title)} transparent={!isMobile}> <Column className='-mt-3 sm:mt-0' label={instance.domain} transparent={!isMobile}>
<PullToRefresh onRefresh={handleRefresh}> <PullToRefresh onRefresh={handleRefresh}>
<Timeline <Timeline
className='black:p-4 black:sm:p-5' className='black:p-4 black:sm:p-5'

View File

@ -357,7 +357,6 @@
"column.blocks": "Blocks", "column.blocks": "Blocks",
"column.bookmarks": "Bookmarks", "column.bookmarks": "Bookmarks",
"column.chats": "Chats", "column.chats": "Chats",
"column.community": "Local timeline",
"column.crypto_donate": "Donate Cryptocurrency", "column.crypto_donate": "Donate Cryptocurrency",
"column.developers": "Developers", "column.developers": "Developers",
"column.developers.service_worker": "Service Worker", "column.developers.service_worker": "Service Worker",