Skip to content
Open
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
1 change: 1 addition & 0 deletions components/Feed/BaseFeedItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ export const BaseFeedItem: FC<BaseFeedItemProps> = ({
relatedDocumentUnifiedDocumentId={
'unifiedDocumentId' in content ? content.unifiedDocumentId : undefined
}
relatedDocumentTitle={'title' in content ? content.title : undefined}
showPeerReviews={showPeerReviews}
onFeedItemClick={onFeedItemClick}
bounties={showBountyInfo ? undefined : content.bounties}
Expand Down
5 changes: 4 additions & 1 deletion components/Feed/FeedItemActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ interface FeedItemActionsProps {
tips?: Tip[]; // Tips received on this content
relatedDocumentTopics?: Topic[];
relatedDocumentUnifiedDocumentId?: string;
relatedDocumentTitle?: string; // Title of the related document for list modal
showPeerReviews?: boolean;
onFeedItemClick?: () => void;
}
Expand Down Expand Up @@ -203,6 +204,7 @@ export const FeedItemActions: FC<FeedItemActionsProps> = ({
tips = [],
relatedDocumentTopics,
relatedDocumentUnifiedDocumentId,
relatedDocumentTitle,
showPeerReviews = true,
onFeedItemClick,
}) => {
Expand Down Expand Up @@ -642,7 +644,7 @@ export const FeedItemActions: FC<FeedItemActionsProps> = ({
? 'text-green-600 hover:text-green-600'
: 'text-gray-900 hover:text-gray-600'
)}
tooltip={'Save'}
tooltip={isDocumentInList ? 'Manage' : 'Save'}
onClick={handleAddToList}
disabled={isTogglingDefaultList}
>
Expand Down Expand Up @@ -716,6 +718,7 @@ export const FeedItemActions: FC<FeedItemActionsProps> = ({
isOpen={isAddToListModalOpen}
onClose={handleCloseAddToListModal}
unifiedDocumentId={Number.parseInt(relatedDocumentUnifiedDocumentId)}
documentTitle={relatedDocumentTitle}
/>
)}
</>
Expand Down
7 changes: 7 additions & 0 deletions components/UserList/AddToListModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ interface AddToListModalProps {
readonly isOpen: boolean;
readonly onClose: () => void;
readonly unifiedDocumentId: ID;
readonly documentTitle?: string;
}

const TOAST_MESSAGES = {
Expand Down Expand Up @@ -158,6 +159,7 @@ export function AddToListModal({
isOpen,
onClose,
unifiedDocumentId,
documentTitle,
}: Readonly<AddToListModalProps>) {
const { overviewLists, isLoading, listIdsContainingDocument } = useIsInList(
isOpen ? unifiedDocumentId : null
Expand Down Expand Up @@ -358,6 +360,11 @@ export function AddToListModal({
'flex items-center justify-center min-h-[150px]'
)}
>
{!showCreateForm && documentTitle && (
<div className="mb-3 px-3">
<p className="text-xs text-gray-500 truncate">{documentTitle}</p>
</div>
)}
{isLoading && <ListLoadingSkeleton />}

{!isLoading && overviewLists.length === 0 && !showCreateForm && (
Expand Down
2 changes: 2 additions & 0 deletions components/work/WorkLineItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export const WorkLineItems = ({
variant="ghost"
onClick={handleAddToList}
disabled={isTogglingDefaultList}
tooltip={isInList ? 'Manage' : 'Save'}
className={cn(
'flex items-center justify-center !px-4 !min-w-0 rounded-lg',
isInList
Expand Down Expand Up @@ -540,6 +541,7 @@ export const WorkLineItems = ({
isOpen={isAddToListModalOpen}
onClose={() => setIsAddToListModalOpen(false)}
unifiedDocumentId={work.unifiedDocumentId}
documentTitle={work.title}
/>
)}

Expand Down