nicolium: Navigate to profile directory from empty accounts page

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-17 12:49:58 +01:00
parent 63c2b09564
commit 62d445ac63
2 changed files with 43 additions and 0 deletions

View File

@ -1,14 +1,18 @@
import clsx from 'clsx';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '@/components/accounts/account-container';
import { EmptyMessage } from '@/components/empty-message';
import Hashtag from '@/components/hashtag';
import ScrollableList from '@/components/scrollable-list';
import StatusContainer from '@/components/statuses/status-container';
import TrendingLink from '@/components/trending-link';
import Button from '@/components/ui/button';
import PlaceholderAccount from '@/features/placeholder/components/placeholder-account';
import PlaceholderHashtag from '@/features/placeholder/components/placeholder-hashtag';
import PlaceholderStatus from '@/features/placeholder/components/placeholder-status';
import { useFeatures } from '@/hooks/use-features';
import { useSuggestedAccounts } from '@/queries/trends/use-suggested-accounts';
import { useTrendingLinks } from '@/queries/trends/use-trending-links';
import { useTrendingStatuses } from '@/queries/trends/use-trending-statuses';
@ -21,6 +25,8 @@ interface ITrendsColumn {
}
const TrendsColumn: React.FC<ITrendsColumn> = ({ type, multiColumn }) => {
const features = useFeatures();
const {
data: accounts,
isFetching: isFetchingAccounts,
@ -56,6 +62,40 @@ const TrendsColumn: React.FC<ITrendsColumn> = ({ type, multiColumn }) => {
isFetching = isFetchingAccounts;
isLoading = isLoadingAccounts;
placeholderComponent = PlaceholderAccount;
console.log(accounts, isFetching, isLoading);
if (!isFetching && !isLoading && accounts?.length === 0) {
children = [
<EmptyMessage
key='key-is-required'
text={
<div className='flex flex-col items-center gap-4'>
<FormattedMessage
id='trends.no_accounts.first_line'
defaultMessage='No suggested accounts found.'
/>
<br />
{features.profileDirectory ? (
<>
<FormattedMessage
id='trends.no_accounts.second_line'
defaultMessage='Try entering a search query or browsing the profile directory to find accounts to follow.'
/>
<Button to='/directory' theme='muted'>
<FormattedMessage id='column.directory' defaultMessage='Profile directory' />
</Button>
</>
) : (
<FormattedMessage
id='trends.no_accounts.second_line.no_directory'
defaultMessage='Try entering a search query to find accounts to follow.'
/>
)}
</div>
}
/>,
];
}
break;
}
case 'hashtags': {

View File

@ -2015,6 +2015,9 @@
"timeline.gap.load_recent": "Load recent posts",
"toast.view": "View",
"trends.count_by_accounts": "{count} {rawCount, plural, one {person} other {people}} talking",
"trends.no_accounts.first_line": "No suggested accounts found.",
"trends.no_accounts.second_line": "Try entering a search query or browsing the profile directory to find accounts to follow.",
"trends.no_accounts.second_line.no_directory": "Try entering a search query to find accounts to follow.",
"trends.title": "Trends",
"trends_panel.view_all": "View all",
"unauthorized_modal.text": "You need to be logged in to do that.",