Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions app/browse/components/BrowsePageClient.tsx

This file was deleted.

74 changes: 0 additions & 74 deletions app/browse/components/BrowsePageHeader.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions app/browse/loading.tsx

This file was deleted.

43 changes: 0 additions & 43 deletions app/browse/page.tsx

This file was deleted.

51 changes: 1 addition & 50 deletions app/layouts/topbar/pageRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import {
faHouse as faHouseLight,
faBookmark as faBookmarkLight,
faCommentsQuestion,
faGrid3 as faGrid3Light,
} from '@fortawesome/pro-light-svg-icons';
import { Shield, Hash, Users, Activity, Settings } from 'lucide-react';
import Image from 'next/image';
import { Shield, Users, Activity, Settings } from 'lucide-react';
import { Icon } from '@/components/ui/icons';
import { getTopicEmoji } from '@/components/Topic/TopicEmojis';
import { toTitleCase } from '@/utils/stringUtils';
import { getSourceLogo, getPreprintDisplayName } from '@/utils/preprintUtil';
import { HOME_TAB_PATHS, isHomeTabPath } from '@/hooks/useFundTabs';

export interface PageInfo {
Expand All @@ -25,7 +20,6 @@ export const ROOT_NAVIGATION_PATHS = new Set([
'/peer-review',
'/journal',
'/notebook',
'/browse',
'/lists',
'/settings',
'/endowment',
Expand All @@ -48,13 +42,6 @@ const ROUTE_RULES: RouteRule[] = [
icon: <FontAwesomeIcon icon={faHouseLight} fontSize={24} color="#000" />,
}),
},
{
match: (p) => p === '/browse',
getInfo: () => ({
title: 'Browse',
icon: <FontAwesomeIcon icon={faGrid3Light} fontSize={24} color="#000" />,
}),
},
{
match: (p) => p === '/my-funding',
getInfo: () => ({
Expand Down Expand Up @@ -196,42 +183,6 @@ const ROUTE_RULES: RouteRule[] = [
icon: <Icon name="profile" size={24} className="text-gray-900" />,
}),
},
{
match: (p) => p.startsWith('/topic/'),
getInfo: (pathname) => {
const topicSlug = pathname.split('/topic/')[1]?.split('/')[0];
if (!topicSlug) return { title: '' };

const preprintLogo = getSourceLogo(topicSlug);
if (preprintLogo && preprintLogo !== 'rhJournal2') {
return {
title: '',
icon: (
<Image
src={preprintLogo}
alt={getPreprintDisplayName(topicSlug)}
width={80}
height={24}
className="object-contain"
style={{ maxHeight: '24px' }}
/>
),
};
}

const emoji = getTopicEmoji(topicSlug);
const topicName = toTitleCase(topicSlug.replace(/-/g, ' '));

return {
title: topicName,
icon: emoji ? (
<span className="text-2xl">{emoji}</span>
) : (
<Hash className="w-6 h-6 text-gray-400" />
),
};
},
},
];

export const getPageInfo = (pathname: string, searchParams?: URLSearchParams): PageInfo | null => {
Expand Down
18 changes: 3 additions & 15 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const STATIC_ROUTES: MetadataRoute.Sitemap = [
{ url: `${SITE_URL}/fund/proposals`, changeFrequency: 'daily', priority: 0.8 },
{ url: `${SITE_URL}/peer-review`, changeFrequency: 'daily', priority: 0.8 },
{ url: `${SITE_URL}/journal`, changeFrequency: 'daily', priority: 0.7 },
{ url: `${SITE_URL}/browse`, changeFrequency: 'daily', priority: 0.6 },
{ url: `${SITE_URL}/lists`, changeFrequency: 'daily', priority: 0.5 },
{ url: `${SITE_URL}/about`, changeFrequency: 'monthly', priority: 0.5 },
{ url: `${SITE_URL}/researchcoin`, changeFrequency: 'monthly', priority: 0.5 },
Expand All @@ -80,7 +79,7 @@ const STATIC_ROUTES: MetadataRoute.Sitemap = [
];

export async function generateSitemaps() {
return [{ id: 0 }, { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }];
return [{ id: 0 }, { id: 1 }, { id: 2 }, { id: 3 }];
}

export default async function sitemap({
Expand All @@ -97,23 +96,12 @@ export default async function sitemap({
(item) => item.content_object
);

if (sitemapId === 2) {
const hubs = await fetchAllPages<{ slug: string }>('/api/hub/?page_size=1000');
return dedupe(
hubs.map((hub) => ({
url: `${SITE_URL}/topic/${hub.slug}`,
changeFrequency: 'daily' as const,
priority: 0.6,
}))
);
}

if (sitemapId === 3)
if (sitemapId === 2)
return buildSlugSitemap(
'/api/researchhubpost/?document_type=PREREGISTRATION&page_size=1000',
'/proposal/'
);
if (sitemapId === 4)
if (sitemapId === 3)
return buildSlugSitemap('/api/researchhubpost/?document_type=GRANT&page_size=100', '/grant/');

return [];
Expand Down
9 changes: 0 additions & 9 deletions app/topic/[slug]/latest/page.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions app/topic/[slug]/layout.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions app/topic/[slug]/page.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions app/topic/[slug]/popular/page.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions components/Feed/DocumentFeedSortAndFilters.tsx

This file was deleted.

23 changes: 23 additions & 0 deletions components/Feed/FeedItemJournalBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import { FC } from 'react';
import { HashtagBadge } from '@/components/ui/badges/HashtagBadge';
import { Journal } from '@/types/journal';
import { getSourceLogo } from '@/utils/preprintUtil';

interface FeedItemJournalBadgeProps {
journal?: Journal;
}

/**
* The hashtag-style journal badge (e.g. #biorxiv) on a paper feed item. Only
* the ResearchHub Journal has a page to link to.
*/
export const FeedItemJournalBadge: FC<FeedItemJournalBadgeProps> = ({ journal }) => {
if (!journal?.name || !journal.slug) return null;
const logo = getSourceLogo(journal.slug);
if (!logo) return null;
return (
<HashtagBadge label={journal.slug} href={logo === 'rhJournal2' ? '/journal' : undefined} />
);
};
Loading
Loading