Rename timeline "My Nostr" to "Home"

merge-requests/3340/head
danidfra 2025-02-26 23:02:33 -03:00
rodzic af21019e73
commit bf2e942741
10 zmienionych plików z 45 dodań i 45 usunięć

Wyświetl plik

@ -100,7 +100,7 @@ const dequeueTimeline = (timelineId: string, expandFunc?: (lastStatusId: string)
} else {
if (timelineId === 'home') {
dispatch(clearTimeline(timelineId));
dispatch(expandHomeTimeline(optionalExpandArgs));
dispatch(expandFollowsTimeline(optionalExpandArgs));
} else if (timelineId === 'community') {
dispatch(clearTimeline(timelineId));
dispatch(expandCommunityTimeline(optionalExpandArgs));
@ -194,20 +194,20 @@ const expandTimeline = (timelineId: string, path: string, params: Record<string,
});
};
interface ExpandHomeTimelineOpts {
interface ExpandFollowsTimelineOpts {
maxId?: string;
url?: string;
}
interface HomeTimelineParams {
interface FollowsTimelineParams {
max_id?: string;
exclude_replies?: boolean;
with_muted?: boolean;
}
const expandHomeTimeline = ({ url, maxId }: ExpandHomeTimelineOpts = {}, done = noOp) => {
const expandFollowsTimeline = ({ url, maxId }: ExpandFollowsTimelineOpts = {}, done = noOp) => {
const endpoint = url || '/api/v1/timelines/home';
const params: HomeTimelineParams = {};
const params: FollowsTimelineParams = {};
if (!url && maxId) {
params.max_id = maxId;
@ -337,7 +337,7 @@ export {
deleteFromTimelines,
clearTimeline,
expandTimeline,
expandHomeTimeline,
expandFollowsTimeline,
expandPublicTimeline,
expandRemoteTimeline,
expandCommunityTimeline,

Wyświetl plik

@ -1,9 +1,8 @@
import affiliateFilledIcon from '@tabler/icons/filled/affiliate.svg';
import bellFilledIcon from '@tabler/icons/filled/bell.svg';
import circlesFilledIcon from '@tabler/icons/filled/circles.svg';
import homeFilledIcon from '@tabler/icons/filled/home.svg';
import settingsFilledIcon from '@tabler/icons/filled/settings.svg';
import userFilledIcon from '@tabler/icons/filled/user.svg';
import affiliateIcon from '@tabler/icons/outline/affiliate.svg';
import bellIcon from '@tabler/icons/outline/bell.svg';
import bookmarkIcon from '@tabler/icons/outline/bookmark.svg';
import calendarEventIcon from '@tabler/icons/outline/calendar-event.svg';
@ -11,6 +10,7 @@ import circlesIcon from '@tabler/icons/outline/circles.svg';
import codeIcon from '@tabler/icons/outline/code.svg';
import dashboardIcon from '@tabler/icons/outline/dashboard.svg';
import dotsCircleHorizontalIcon from '@tabler/icons/outline/dots-circle-horizontal.svg';
import homeIcon from '@tabler/icons/outline/home.svg';
import listIcon from '@tabler/icons/outline/list.svg';
import mailIcon from '@tabler/icons/outline/mail.svg';
import messagesIcon from '@tabler/icons/outline/messages.svg';
@ -148,7 +148,7 @@ const SidebarNavigation = () => {
<Stack space={6}>
<Link key='logo' to='/' data-preview-title-id='column.home' className='ml-4 flex shrink-0 items-center'>
<SiteLogo alt='Logo' className='h-10 w-auto cursor-pointer' />
<span className='hidden'><FormattedMessage id='tabs_bar.my_nostr' defaultMessage='My Nostr' /></span>
<span className='hidden'><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></span>
</Link>
<Search openInRoute autosuggest />
@ -156,9 +156,9 @@ const SidebarNavigation = () => {
<Stack space={2}>
<SidebarNavigationLink
to='/'
icon={affiliateIcon}
activeIcon={affiliateFilledIcon}
text={<FormattedMessage id='tabs_bar.my_nostr' defaultMessage='My Nostr' />}
icon={homeIcon}
activeIcon={homeFilledIcon}
text={<FormattedMessage id='tabs_bar.home' defaultMessage='Home' />}
/>
{account && (

Wyświetl plik

@ -1,11 +1,11 @@
import affiliateFilledIcon from '@tabler/icons/filled/affiliate.svg';
import bellFilledIcon from '@tabler/icons/filled/bell.svg';
import circlesFilledIcon from '@tabler/icons/filled/circles.svg';
import homeFilledIcon from '@tabler/icons/filled/home.svg';
import mailFilledIcon from '@tabler/icons/filled/mail.svg';
import affiliateIcon from '@tabler/icons/outline/affiliate.svg';
import bellIcon from '@tabler/icons/outline/bell.svg';
import circlesIcon from '@tabler/icons/outline/circles.svg';
import dashboardIcon from '@tabler/icons/outline/dashboard.svg';
import homeIcon from '@tabler/icons/outline/home.svg';
import mailIcon from '@tabler/icons/outline/mail.svg';
import messagesIcon from '@tabler/icons/outline/messages.svg';
import searchIcon from '@tabler/icons/outline/search.svg';
@ -66,9 +66,9 @@ const ThumbNavigation: React.FC = (): JSX.Element => {
}}
>
<ThumbNavigationLink
src={affiliateIcon}
activeSrc={affiliateFilledIcon}
text={<FormattedMessage id='navigation.my_nostr' defaultMessage='My Nostr' />}
src={homeIcon}
activeSrc={homeFilledIcon}
text={<FormattedMessage id='navigation.home' defaultMessage='Home' />}
to='/'
exact
/>

Wyświetl plik

@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react';
import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { expandHomeTimeline } from 'soapbox/actions/timelines.ts';
import { expandFollowsTimeline } from 'soapbox/actions/timelines.ts';
import PullToRefresh from 'soapbox/components/pull-to-refresh.tsx';
import { Column } from 'soapbox/components/ui/column.tsx';
import Stack from 'soapbox/components/ui/stack.tsx';
@ -14,10 +14,10 @@ import { useFeatures } from 'soapbox/hooks/useFeatures.ts';
import { useInstance } from 'soapbox/hooks/useInstance.ts';
const messages = defineMessages({
title: { id: 'column.my_nostr', defaultMessage: 'My Nostr' },
title: { id: 'column.home', defaultMessage: 'Home' },
});
const HomeTimeline: React.FC = () => {
const FollowsTimeline: React.FC = () => {
const intl = useIntl();
const dispatch = useAppDispatch();
const features = useFeatures();
@ -29,7 +29,7 @@ const HomeTimeline: React.FC = () => {
const next = useAppSelector(state => state.timelines.get('home')?.next);
const handleLoadMore = (maxId: string) => {
dispatch(expandHomeTimeline({ url: next, maxId }));
dispatch(expandFollowsTimeline({ url: next, maxId }));
};
// Mastodon generates the feed in Redis, and can return a partial timeline
@ -37,7 +37,7 @@ const HomeTimeline: React.FC = () => {
const checkIfReloadNeeded = () => {
if (isPartial) {
polling.current = setInterval(() => {
dispatch(expandHomeTimeline());
dispatch(expandFollowsTimeline());
}, 3000);
} else {
stopPolling();
@ -52,7 +52,7 @@ const HomeTimeline: React.FC = () => {
};
const handleRefresh = () => {
return dispatch(expandHomeTimeline());
return dispatch(expandFollowsTimeline());
};
useEffect(() => {
@ -111,4 +111,4 @@ const HomeTimeline: React.FC = () => {
};
export default HomeTimeline;
export default FollowsTimeline;

Wyświetl plik

@ -1,16 +1,14 @@
import { useState, lazy, Suspense } from 'react';
import { useState, Suspense } from 'react';
import { FormattedMessage } from 'react-intl';
import Tabs from 'soapbox/components/ui/tabs.tsx';
import { CommunityTimeline, FollowsTimeline } from 'soapbox/features/ui/util/async-components.ts';
import { useAppSelector } from 'soapbox/hooks/useAppSelector.ts';
import { useInstance } from 'soapbox/hooks/useInstance.ts';
const HomeTimeline = lazy(() => import('soapbox/features/my-nostr-timeline/home-timeline.tsx'));
const CommunityTimeline = lazy(() => import('soapbox/features/my-nostr-timeline/community-timeline.tsx'));
const MyNostrTimeline = () => {
const HomeTimeline = () => {
const { instance } = useInstance();
const [activeTab, setActiveTab] = useState('forYou');
const [activeTab, setActiveTab] = useState('follows');
const notifications = useAppSelector((state) => state.notificationsTab);
return (
@ -18,9 +16,9 @@ const MyNostrTimeline = () => {
<Tabs
items={[
{
name: 'forYou',
text: <FormattedMessage id='tabs_bar.for_you' defaultMessage='For You' />,
action: () => setActiveTab('forYou'),
name: 'follows',
text: <FormattedMessage id='tabs_bar.follows' defaultMessage='Follows' />,
action: () => setActiveTab('follows'),
notification: notifications.home,
},
{
@ -34,10 +32,10 @@ const MyNostrTimeline = () => {
/>
<Suspense fallback={<div className='p-4 text-center'><FormattedMessage id='loading_indicator.label' defaultMessage='Loading...' /></div>}>
{activeTab === 'forYou' ? <HomeTimeline /> : <CommunityTimeline />}
{activeTab === 'follows' ? <FollowsTimeline /> : <CommunityTimeline />}
</Suspense>
</>
);
};
export default MyNostrTimeline;
export default HomeTimeline;

Wyświetl plik

@ -114,7 +114,7 @@ const Navbar = () => {
>
<Link key='logo' to='/' data-preview-title-id='column.home' className='ml-4 flex shrink-0 items-center'>
<SiteLogo alt='Logo' className='h-5 w-auto cursor-pointer' />
<span className='hidden'><FormattedMessage id='tabs_bar.my_nostr' defaultMessage='My Nostr' /></span>
<span className='hidden'><FormattedMessage id='tabs_bar.home' defaultMessage='Home' /></span>
</Link>
{account && (

Wyświetl plik

@ -10,7 +10,7 @@ import { expandNotifications } from 'soapbox/actions/notifications.ts';
import { registerPushNotifications } from 'soapbox/actions/push-notifications/registerer.ts';
import { fetchScheduledStatuses } from 'soapbox/actions/scheduled-statuses.ts';
import { fetchSuggestionsForTimeline } from 'soapbox/actions/suggestions.ts';
import { expandHomeTimeline } from 'soapbox/actions/timelines.ts';
import { expandFollowsTimeline } from 'soapbox/actions/timelines.ts';
import { useUserStream } from 'soapbox/api/hooks/index.ts';
import { useCustomEmojis } from 'soapbox/api/hooks/useCustomEmojis.ts';
import SidebarNavigation from 'soapbox/components/sidebar-navigation.tsx';
@ -51,7 +51,7 @@ import {
RemoteTimeline,
AccountTimeline,
AccountGallery,
MyNostrTimeline,
HomeTimeline,
Followers,
Following,
DirectTimeline,
@ -183,7 +183,7 @@ const SwitchingColumnsArea: React.FC<ISwitchingColumnsArea> = ({ children }) =>
<WrappedRoute path='/logout' page={EmptyPage} component={LogoutPage} publicRoute exact />
{isLoggedIn ? (
<WrappedRoute path='/' exact page={HomePage} component={MyNostrTimeline} content={children} />
<WrappedRoute path='/' exact page={HomePage} component={HomeTimeline} content={children} />
) : (
<WrappedRoute path='/' exact page={LandingPage} component={LandingTimeline} content={children} publicRoute />
)}
@ -418,7 +418,7 @@ const UI: React.FC<IUI> = ({ children }) => {
const loadAccountData = () => {
if (!account) return;
dispatch(expandHomeTimeline({}, () => {
dispatch(expandFollowsTimeline({}, () => {
dispatch(fetchSuggestionsForTimeline());
}));

Wyświetl plik

@ -5,7 +5,7 @@ export const EmojiPicker = lazy(() => import('soapbox/features/emoji/components/
export const EmojiPickerModal = lazy(() => import('soapbox/features/ui/components/modals/emoji-picker-modal.tsx'));
export const Notifications = lazy(() => import('soapbox/features/notifications/index.tsx'));
export const LandingTimeline = lazy(() => import('soapbox/features/landing-timeline/index.tsx'));
export const MyNostrTimeline = lazy(() => import('soapbox/features/my-nostr-timeline/index.tsx'));
export const HomeTimeline = lazy(() => import('soapbox/features/home-timeline/index.tsx'));
export const PublicTimeline = lazy(() => import('soapbox/features/public-timeline/index.tsx'));
export const RemoteTimeline = lazy(() => import('soapbox/features/remote-timeline/index.tsx'));
export const HashtagTimeline = lazy(() => import('soapbox/features/hashtag-timeline/index.tsx'));
@ -181,3 +181,5 @@ export const ZapSplitModal = lazy(() => import('soapbox/features/ui/components/m
export const CaptchaModal = lazy(() => import('soapbox/features/ui/components/modals/captcha-modal/captcha-modal.tsx'));
export const NostrBunkerLogin = lazy(() => import('soapbox/features/nostr/nostr-bunker-login.tsx'));
export const StreakModal = lazy(() => import('soapbox/features/ui/components/modals/streak-modal.tsx'));
export const FollowsTimeline = lazy(() => import('soapbox/features/home-timeline/follows-timeline.tsx'));
export const CommunityTimeline = lazy(() => import('soapbox/features/home-timeline/community-timeline.tsx'));

Wyświetl plik

@ -408,6 +408,7 @@
"column.group_blocked_members": "Banned Members",
"column.group_pending_requests": "Pending requests",
"column.groups": "Groups",
"column.home": "Home",
"column.import_data": "Import data",
"column.info": "Server information",
"column.lists": "Lists",
@ -420,7 +421,6 @@
"column.mfa_setup": "Proceed to Setup",
"column.migration": "Account migration",
"column.mutes": "Mutes",
"column.my_nostr": "My Nostr",
"column.notifications": "Notifications",
"column.pins": "Pinned posts",
"column.preferences": "Preferences",
@ -1120,7 +1120,7 @@
"navigation.dashboard": "Dashboard",
"navigation.developers": "Developers",
"navigation.direct_messages": "Messages",
"navigation.my_nostr": "My Nostr",
"navigation.home": "Home",
"navigation.notifications": "Notifications",
"navigation.search": "Discover",
"navigation_bar.account_aliases": "Account aliases",
@ -1614,11 +1614,11 @@
"sw.url": "Script URL",
"tabs_bar.all": "All",
"tabs_bar.dashboard": "Dashboard",
"tabs_bar.for_you": "For You",
"tabs_bar.follows": "Follows",
"tabs_bar.global": "Global",
"tabs_bar.groups": "Groups",
"tabs_bar.home": "Home",
"tabs_bar.more": "More",
"tabs_bar.my_nostr": "My Nostr",
"tabs_bar.notifications": "Notifications",
"tabs_bar.profile": "Profile",
"tabs_bar.search": "Discover",