diff --git a/app/layouts/MobileBottomNav.tsx b/app/layouts/MobileBottomNav.tsx
index 31650c990..e376ccc11 100644
--- a/app/layouts/MobileBottomNav.tsx
+++ b/app/layouts/MobileBottomNav.tsx
@@ -13,7 +13,7 @@ import {
faBars,
} from '@fortawesome/pro-light-svg-icons';
import { faXTwitter, faDiscord, faGithub, faLinkedin } from '@fortawesome/free-brands-svg-icons';
-import { Sprout } from 'lucide-react';
+import { Sprout, Star } from 'lucide-react';
import { ChangelogLink } from '@/components/changelog/ChangelogLink';
import { Icon } from '@/components/ui/icons';
import { IconName } from '@/components/ui/icons/Icon';
@@ -22,7 +22,7 @@ import { SwipeableDrawer } from '@/components/ui/SwipeableDrawer';
import { useAuthenticatedAction } from '@/contexts/AuthModalContext';
import { useCurrencyPreference } from '@/contexts/CurrencyPreferenceContext';
import { useScrollContainer } from '@/contexts/ScrollContainerContext';
-import { useUser } from '@/contexts/UserContext';
+import { isHomeTabPath } from '@/hooks/useFundTabs';
interface NavItem {
label: string;
@@ -43,11 +43,11 @@ const moreNavItems: NavItem[] = [
// Check if a path is active
const isPathActive = (path: string, currentPath: string): boolean => {
- if (path === '/for-you' || path === '/popular') {
- return ['/popular', '/for-you', '/latest', '/following', '/'].includes(currentPath);
+ if (path === '/') {
+ return isHomeTabPath(currentPath);
}
- if (path === '/fund') {
- return currentPath.startsWith('/fund');
+ if (path === '/fund/dashboard') {
+ return currentPath === '/fund/dashboard' || currentPath.startsWith('/fund/dashboard/');
}
if (path === '/notebook') {
return currentPath.startsWith('/notebook');
@@ -73,15 +73,11 @@ export const MobileBottomNav: React.FC = () => {
const { executeAuthenticatedAction } = useAuthenticatedAction();
const { showUSD, toggleCurrency } = useCurrencyPreference();
const scrollContainerRef = useScrollContainer();
- const { user } = useUser();
-
- // Home href depends on auth state: logged in -> /for-you, logged out -> /popular
- const homeHref = user ? '/for-you' : '/popular';
const mainNavItems: NavItem[] = [
- { label: 'Home', href: homeHref, iconKey: 'home', isDynamicHome: true },
- { label: 'Earn', href: '/earn', iconKey: 'earn' },
- { label: 'Fund', href: '/fund', iconKey: 'fund' },
+ { label: 'Home', href: '/', iconKey: 'home', isDynamicHome: true },
+ { label: 'Peer Review', href: '/earn', iconKey: 'peer-review' },
+ { label: 'Your Funding', href: '/fund/dashboard', iconKey: 'fund', requiresAuth: true },
{ label: 'Wallet', href: '/researchcoin', iconKey: 'wallet' },
{ label: 'More', isMore: true, iconKey: 'more' },
];
@@ -142,6 +138,15 @@ export const MobileBottomNav: React.FC = () => {
color={iconColor}
/>
);
+ case 'peer-review':
+ return (
+
+ );
case 'earn':
return (
= ({
}) => {
const { executeAuthenticatedAction } = useAuthenticatedAction();
const router = useRouter();
- const { user } = useUser();
// Dismissable "New" badge for the Endowment nav item. Lifted to the parent
// so the click handler in NavLink can call dismissFeature() without each
@@ -99,27 +99,25 @@ export const Navigation: React.FC = ({
[router]
);
- // Home href depends on auth state: logged in -> /for-you, logged out -> /popular
- const homeHref = user ? '/for-you' : '/popular';
-
const navigationItems: NavigationItem[] = [
{
label: 'Home',
- href: homeHref,
+ href: '/',
iconKey: 'home',
isFontAwesome: true,
description: 'Navigate to the home page',
},
{
- label: 'Fund',
- href: '/fund',
+ label: 'Your Funding',
+ href: '/fund/dashboard',
iconKey: 'fund',
- description: 'Browse grants and fundraising opportunities',
+ requiresAuth: true,
+ description: 'Track the impact of the research you fund',
},
{
- label: 'Earn',
+ label: 'Peer Review',
href: '/earn',
- iconKey: 'earn',
+ isLucideStar: true,
description: 'Earn RSC for completing peer reviews',
},
{
@@ -152,13 +150,12 @@ export const Navigation: React.FC = ({
};
const isPathActive = (path: string) => {
- // Special case for home page
- if (path === '/for-you' || path === '/popular') {
- return ['/popular', '/for-you', '/latest', '/following'].includes(currentPath);
+ if (path === '/') {
+ return isHomeTabPath(currentPath);
}
- if (path === '/fund') {
- return currentPath.startsWith('/fund');
+ if (path === '/fund/dashboard') {
+ return currentPath === '/fund/dashboard' || currentPath.startsWith('/fund/dashboard/');
}
if (path === '/earn') {
@@ -243,6 +240,13 @@ export const Navigation: React.FC = ({
/>
) : item.isLucideSprout ? (
+ ) : item.isLucideStar ? (
+
) : item.iconKey ? (
) : (
diff --git a/app/layouts/PublishMenu.tsx b/app/layouts/PublishMenu.tsx
index 5d7972534..12e1cfee2 100644
--- a/app/layouts/PublishMenu.tsx
+++ b/app/layouts/PublishMenu.tsx
@@ -6,8 +6,6 @@ import { BaseMenu, BaseMenuItem } from '@/components/ui/form/BaseMenu';
import { FundingIcon } from '@/components/ui/icons/FundingIcon';
import { useAuthenticatedAction } from '@/contexts/AuthModalContext';
import Icon from '@/components/ui/icons/Icon';
-import { useUser } from '@/contexts/UserContext';
-import { navigateToAuthorProfile } from '@/utils/navigation';
import { SwipeableDrawer } from '@/components/ui/SwipeableDrawer';
import {
OpenFundingOpportunityModal,
@@ -27,7 +25,7 @@ interface PublishMenuProps {
const PUBLISH_MENU_SECTIONS = [
{
- title: 'Publish on ResearchHub',
+ title: 'Post on ResearchHub',
items: [
{
id: 'give-funding',
@@ -73,7 +71,6 @@ const MenuItemContent: React.FC = ({ icon, title, descript
export const PublishMenu: React.FC = ({ children, forceMinimize = false }) => {
const router = useRouter();
const { executeAuthenticatedAction } = useAuthenticatedAction();
- const { user } = useUser();
const { smAndDown } = useScreenSize();
const [isMobileDrawerOpen, setIsMobileDrawerOpen] = useState(false);
const [isFundingOpportunityModalOpen, setIsFundingOpportunityModalOpen] = useState(false);
@@ -97,10 +94,6 @@ export const PublishMenu: React.FC = ({ children, forceMinimiz
router.push(`/notebook?newGrant=true&grantSource=${method}`);
};
- const handleViewProfile = () => {
- navigateToAuthorProfile(user?.id, false);
- };
-
const handleMenuItemClick = (item: (typeof PUBLISH_MENU_SECTIONS)[number]['items'][number]) => {
executeAuthenticatedAction(() => {
switch (item.handler) {
@@ -133,7 +126,7 @@ export const PublishMenu: React.FC = ({ children, forceMinimiz
}}
>
- Publish
+ Post
);
@@ -227,7 +220,7 @@ export const PublishMenu: React.FC = ({ children, forceMinimiz
}}
role="button"
tabIndex={0}
- aria-label="Open publish menu"
+ aria-label="Open post menu"
>
{standardTrigger}
{compactTrigger}
diff --git a/tsconfig.json b/tsconfig.json
index 5f3434d2c..a9ea71793 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -11,7 +11,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
- "jsx": "preserve",
+ "jsx": "react-jsx",
"incremental": true,
"plugins": [
{