diff --git a/components/work/WorkRightSidebar.tsx b/components/work/WorkRightSidebar.tsx index d0b9e317a..1608f770c 100644 --- a/components/work/WorkRightSidebar.tsx +++ b/components/work/WorkRightSidebar.tsx @@ -28,7 +28,11 @@ export const WorkRightSidebar = ({ work, metadata }: WorkRightSidebarProps) => { {hasResearchHubJournalVersions && ( )} - + {work.doi && } {work.postType !== 'QUESTION' && } diff --git a/components/work/components/SupportersSection.tsx b/components/work/components/SupportersSection.tsx index 09a46bc17..bd7e75e17 100644 --- a/components/work/components/SupportersSection.tsx +++ b/components/work/components/SupportersSection.tsx @@ -8,7 +8,7 @@ import { HeartHandshake } from 'lucide-react'; import { Button } from '@/components/ui/Button'; import { ResearchCoinIcon } from '@/components/ui/icons/ResearchCoinIcon'; import { Icon } from '@/components/ui/icons/Icon'; -import { Work } from '@/types/work'; +import { Work, ContentType } from '@/types/work'; import { TipContentModal } from '@/components/modals/TipContentModal'; import { CurrencyBadge } from '@/components/ui/CurrencyBadge'; import { useCurrencyPreference } from '@/contexts/CurrencyPreferenceContext'; @@ -16,16 +16,22 @@ import { useCurrencyPreference } from '@/contexts/CurrencyPreferenceContext'; interface SupportersSectionProps { tips: Tip[]; documentId: number; + contentType: ContentType; onTip?: () => void; } -export const SupportersSection: FC = ({ tips = [], documentId, onTip }) => { +export const SupportersSection: FC = ({ + tips = [], + documentId, + contentType, + onTip, +}) => { const [isModalOpen, setIsModalOpen] = useState(false); const [showAllSupporters, setShowAllSupporters] = useState(false); const { showUSD } = useCurrencyPreference(); const hasSupporters = tips && tips.length > 0; - const displayLimit = 5; // Show only top 5 supporters in the sidebar + const displayLimit = 5; const displayedSupporters = showAllSupporters ? tips : tips.slice(0, displayLimit); const hasMoreSupporters = tips.length > displayLimit; @@ -114,12 +120,11 @@ export const SupportersSection: FC = ({ tips = [], docum )} - {/* Tip Modal */} setIsModalOpen(false)} contentId={documentId} - feedContentType="PAPER" + feedContentType={contentType === 'paper' ? 'PAPER' : 'POST'} onTipSuccess={handleTipSuccess} />